1. Payment Links
PIK
  • Start
    • Getting Started
  • Authentication
    • Authentication Token
      POST
  • Global Account
    • Contacts
      • Create Contact
      • List Contacts
      • Get Contact
      • Count Contacts
    • Virtual Accounts
      • Create Virtual Account
      • List Virtual Accounts
      • Get Virtual Account
    • Transactions
      • List Transactions
      • Get Transaction
    • Account Balance
      • List Account Balances
      • Get Balance by Currency
    • Payout
      • Create Payout
    • Webhooks
      • Unified Webhook Entry
      • Virtual Account Webhook
      • Deposit Webhook
      • Payout Status Webhook
  • Payment Links
    • Payment Links
      • Create Payment Link
      • Update Payment Link
      • Get Payment Link Detail
      • Get Payment Link List
    • Transactions
      • Get Transaction List
  • Webhook
    • Global Account
      • Deposit Webhook
      • Payout Webhook
      • Virtual Account Webhook
    • Payment Links
      • Overview
      • Order Collect Out Webhook
      • Customer Payment Webhook
      • Customer Refund Webhook
      • Master Recharge Webhook
      • Web3 Direct Payment Webhook
      • Withdraw Out Webhook
  1. Payment Links

Customer Refund Webhook

The merchant issues a refund: tokens are sent from a per-link order address back to the original payer (or a designated refund destination).
Read webhook-overview.md first for signature verification, retry policy, and the state machine common to all events.

When it fires#

PIK detects an outbound on-chain transfer from an order address to a destination that is not a master address. This signals the refund flow rather than a collection sweep.
Trigger conditionNotes
fromAddress ∈ PIK order poolRefund originates from the per-link order address
toAddress ∉ PIK master addressesDistinguishes refund from ORDER_COLLECT_OUT

Event identifiers#

FieldValue
eventTypeCUSTOMER_REFUND
businessRefTypeREFUND
directionOUT

State machine#

  PENDING ──── on-chain confirmed ────► CONFIRMED  (refund delivered)
     │
     └──────── reverted ─────────────► FAILED
StatusWhenSide effects
PENDINGRefund transaction submitted and detected on-chainInternal refund record marked in-progress
CONFIRMEDSufficient confirmations reachedRefund is final — funds have reached the customer
FAILEDRefund transaction revertedFunds remain in the order address; ops may retry

Payload examples#

status = PENDING#

{
  "event": "transaction.created",
  "timestamp": 1738810800000,
  "data": {
    "fundEventCode": "FE20260206150000007",
    "paymentLinkName": null,
    "businessRefType": "REFUND",
    "chain": "Ethereum",
    "tokenSymbol": "USDC",
    "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "txHash": "0xeeee777788889999eeee777788889999eeee777788889999eeee777788889999",
    "fromAddress": "0xfedcba0987654321fedcba0987654321fedcba09",
    "toAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "amount": 99.00,
    "direction": "OUT",
    "eventType": "CUSTOMER_REFUND",
    "status": "PENDING",
    "createTimeUtc": "2026-02-06 15:00:00"
  }
}

status = CONFIRMED#

{
  "event": "transaction.created",
  "timestamp": 1738810980000,
  "data": {
    "fundEventCode": "FE20260206150000007",
    "paymentLinkName": null,
    "businessRefType": "REFUND",
    "chain": "Ethereum",
    "tokenSymbol": "USDC",
    "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "txHash": "0xeeee777788889999eeee777788889999eeee777788889999eeee777788889999",
    "fromAddress": "0xfedcba0987654321fedcba0987654321fedcba09",
    "toAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "amount": 99.00,
    "direction": "OUT",
    "eventType": "CUSTOMER_REFUND",
    "status": "CONFIRMED",
    "createTimeUtc": "2026-02-06 15:00:00"
  }
}

status = FAILED#

{
  "event": "transaction.created",
  "timestamp": 1738811040000,
  "data": {
    "fundEventCode": "FE20260206150000007",
    "paymentLinkName": null,
    "businessRefType": "REFUND",
    "chain": "Ethereum",
    "tokenSymbol": "USDC",
    "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "txHash": "0xeeee777788889999eeee777788889999eeee777788889999eeee777788889999",
    "fromAddress": "0xfedcba0987654321fedcba0987654321fedcba09",
    "toAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "amount": 99.00,
    "direction": "OUT",
    "eventType": "CUSTOMER_REFUND",
    "status": "FAILED",
    "createTimeUtc": "2026-02-06 15:00:00"
  }
}

Field notes specific to this event#

FieldNotes
paymentLinkNamenull in the payload, even though the refund originates from a payment-link order address. Reconcile via the order address (fromAddress) if needed
fromAddressThe order address that originally received the customer's payment
toAddressThe refund destination — typically the original payer's wallet
amountNet amount sent back to the customer

Recommended handler logic#

1. Verify signature.
2. Look up local refund record by fundEventCode.
3. Switch on status:
     PENDING   → mark "in flight". Notify customer "refund processing".
     CONFIRMED → mark "refunded". Notify customer "refund delivered".
     FAILED    → mark "failed". Alert ops; manual retry may be required.
4. Respond 200 within 5 seconds.

Related events#

The refund only makes sense in relation to a prior CUSTOMER_PAYMENT on the same order address. The two events have different fundEventCode values — link them via the order address (fromAddress of the refund equals toAddress of the payment).
Modified at 2026-05-25 08:35:28
Previous
Customer Payment Webhook
Next
Master Recharge Webhook
Built with