Refund Payment
POST/payments/:paymentId/refundDescription
Refund a payment, returning funds to the customer’s original wallet address. This endpoint is only available for payments created with payment_mode: "two_step".
Requires a signed request to authorize the fund movement. The destination address is determined automatically based on the original payer.
🔐
The API validates the request fields and verifies your signature before executing the refund.
Headers
| Header | Description | Required |
|---|---|---|
| Authorization | Bearer token with your API key | yes |
| Content-Type | application/json | yes |
| X-Signature | ECDSA signature of the JSON-serialized request body, signed with your signing key. | yes |
Path Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| paymentId | string | The unique identifier of the payment to refund. | yes |
Request Body
The request body is signed with your signing key and the signature is sent in the X-Signature header.
| Name | Type | Description | Required |
|---|---|---|---|
| action | string | Must be "refund". | yes |
| payment_id | string | The ID of the payment to refund. Must match the path parameter. | yes |
Example Request
const body = {
action: 'refund',
payment_id: 'pay_0987654321fedcba',
};
const signature = signRequest(body, process.env.SIGNING_PRIVATE_KEY);
const response = await fetch(
'https://checkout.exodus.com/payments/pay_0987654321fedcba/refund',
{
method: 'POST',
headers: {
Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
'Content-Type': 'application/json',
'X-Signature': signature,
},
body: JSON.stringify(body),
}
);Response
SUCCESSFUL REFUND
{
"id": "ref_1234567890abcdef",
"object": "refund",
"payment_id": "pay_0987654321fedcba",
"amount": 5000,
"currency": "USD",
"status": "pending",
"stablecoin": "USDC",
"network": "ethereum",
"destination_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f8fE21",
"created_at": "2024-01-20T15:30:00Z"
}Error Responses
INVALID PAYMENT MODE
{
"error": {
"type": "invalid_request",
"message": "Refund via signed request is only available for two-step payments"
}
}INVALID SIGNATURE
{
"error": {
"type": "authorization_error",
"message": "Invalid signature"
}
}