Order Collect Out Webhook
PIK internally sweeps funds from a per-link order address into the merchant master address. This is an automated, internal operation triggered by PIK's collection task — the merchant does not initiate it manually.Read webhook-overview.md first for signature verification, retry policy, and the state machine common to all events.
When it fires#
After a CUSTOMER_PAYMENT has been received on an order address, PIK schedules a collection task to move those funds (minus gas) to the merchant's master address. When that on-chain sweep is detected, this webhook fires.| Trigger condition | Notes |
|---|
fromAddress ∈ PIK order pool | The order address being swept |
toAddress ∈ PIK master addresses | The destination master address |
| Matching collection-task record exists | Identifies this as an authorized sweep |
Event identifiers#
| Field | Value |
|---|
eventType | ORDER_COLLECT_OUT |
businessRefType | COLLECT |
direction | IN |
⚠️ Direction semantics. The event name says OUT (from the order address perspective — funds leaving that address), but direction = IN because PIK reports direction from the master account perspective (funds entering master). When reconciling balance, treat this as a positive movement on the master account.
State machine#
PENDING ──── on-chain confirmed ────► CONFIRMED (master balance increased)
│
└──────── reverted ─────────────► FAILED
| Status | When | Side effects |
|---|
PENDING | Sweep transaction first detected on-chain | Collection task moves to SUCCESS server-side, but balance reconciliation not finalized |
CONFIRMED | Sufficient confirmations | Master available balance is increased by the swept amount; funds are now withdrawable |
FAILED | Sweep reverted | Collection task will be retried by the system |
Payload examples#
status = PENDING#
{
"event": "transaction.created",
"timestamp": 1738803600000,
"data": {
"fundEventCode": "FE20260206130000004",
"paymentLinkName": null,
"businessRefType": "COLLECT",
"chain": "Ethereum",
"tokenSymbol": "USDC",
"tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"txHash": "0xcccc111122223333cccc111122223333cccc111122223333cccc111122223333",
"fromAddress": "0xfedcba0987654321fedcba0987654321fedcba09",
"toAddress": "0xMasterAddressAAAAMasterAddressAAAAMasterAA",
"amount": 98.50,
"direction": "IN",
"eventType": "ORDER_COLLECT_OUT",
"status": "PENDING",
"createTimeUtc": "2026-02-06 13:00:00"
}
}
status = CONFIRMED#
{
"event": "transaction.created",
"timestamp": 1738803780000,
"data": {
"fundEventCode": "FE20260206130000004",
"paymentLinkName": null,
"businessRefType": "COLLECT",
"chain": "Ethereum",
"tokenSymbol": "USDC",
"tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"txHash": "0xcccc111122223333cccc111122223333cccc111122223333cccc111122223333",
"fromAddress": "0xfedcba0987654321fedcba0987654321fedcba09",
"toAddress": "0xMasterAddressAAAAMasterAddressAAAAMasterAA",
"amount": 98.50,
"direction": "IN",
"eventType": "ORDER_COLLECT_OUT",
"status": "CONFIRMED",
"createTimeUtc": "2026-02-06 13:00:00"
}
}
status = FAILED#
{
"event": "transaction.created",
"timestamp": 1738803840000,
"data": {
"fundEventCode": "FE20260206130000004",
"paymentLinkName": null,
"businessRefType": "COLLECT",
"chain": "Ethereum",
"tokenSymbol": "USDC",
"tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"txHash": "0xcccc111122223333cccc111122223333cccc111122223333cccc111122223333",
"fromAddress": "0xfedcba0987654321fedcba0987654321fedcba09",
"toAddress": "0xMasterAddressAAAAMasterAddressAAAAMasterAA",
"amount": 98.50,
"direction": "IN",
"eventType": "ORDER_COLLECT_OUT",
"status": "FAILED",
"createTimeUtc": "2026-02-06 13:00:00"
}
}
Field notes specific to this event#
| Field | Notes |
|---|
paymentLinkName | null — the sweep is an internal operation, not tied to a single payment link in the payload |
fromAddress | Order address being swept |
toAddress | Master address |
amount | The received amount on master (after gas), not necessarily equal to the original customer payment |
Recommended handler logic#
For most merchants, ORDER_COLLECT_OUT is an internal accounting event and may not need user-facing handling — the corresponding CUSTOMER_PAYMENT is what triggers order fulfilment.1. Verify signature.
2. Switch on status:
PENDING → optional: log that a sweep is in progress.
CONFIRMED → reconcile: order-address funds are now in master.
FAILED → flag for ops investigation; system will retry automatically.
3. Respond 200.
This event is downstream of a CUSTOMER_PAYMENT. The original fundEventCode of the payment is not the same as this sweep's fundEventCode — they are separate fund events tied by business logic, not by payload. Funds are only available for WITHDRAW_OUT after this event reaches CONFIRMED. Modified at 2026-05-25 08:34:21