API ReferenceRefunds
Create Refund
Refund a completed transaction back to the customer's wallet.
Create Refund
POST /api/refundsIssues a USDC refund for a completed transaction. The refund is sent on-chain via Coinbase CDP to the customer's original wallet address.
Authentication
Requires API key or Supabase session auth.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | ID of the transaction to refund |
amount | number | No | Refund amount in USD. Defaults to the full transaction amount. |
reason | string | No | Reason for the refund |
Partial refunds are supported. The total refunded amount across all refunds for a transaction cannot exceed the original transaction amount.
Constraints
- Only
completedtransactions can be refunded. - Only EVM networks are supported for refunds (Base, Ethereum, Polygon, and their testnets).
- The merchant must have a CDP wallet configured.
Response
{
"status": "success",
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"transactionId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"merchantWalletAddress": "0xYourWallet",
"customerWalletAddress": "0xCustomerWallet",
"amount": 29.99,
"token": "USDC",
"network": "base",
"mode": "live",
"txHash": "0xRefundTxHash...",
"reason": "Customer requested refund",
"status": "completed",
"createdAt": "2026-03-01T12:00:00.000Z"
}
}Error responses
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing transactionId, invalid amount, or transaction not eligible |
| 404 | NOT_FOUND | Transaction not found or doesn't belong to your account |
| 500 | INTERNAL_ERROR | Server error |