Skip to Content

Create Refund

POST/refunds

Description

Create a refund for a completed stablecoin payment. The refund is processed as an on-chain transaction to the customer’s original wallet address. You can refund the full amount or specify a partial amount.

⚠️

You can only refund payments that have been successfully completed and confirmed on-chain. Partial refunds are allowed up to the original payment amount.

Headers

HeaderDescriptionRequired
AuthorizationBearer token with your API keyyes
Content-Typeapplication/jsonyes

Request Body

NameTypeDescriptionRequired
payment_idstringThe ID of the payment to refund.yes
amountnumberAmount to refund in smallest currency unit. If omitted, refunds the full amount.no
reasonstringReason for the refund: "duplicate", "fraudulent", or "requested_by_customer".no
metadataobjectCustom key-value pairs to attach to the refund.no

Example Request

Full Refund

const response = await fetch('https://checkout.exodus.com/refunds', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    payment_id: 'pay_0987654321fedcba',
    reason: 'requested_by_customer',
  }),
});

Partial Refund

const response = await fetch('https://checkout.exodus.com/refunds', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    payment_id: 'pay_0987654321fedcba',
    amount: 2500, // Refund $25.00 of a $50.00 payment
    reason: 'requested_by_customer',
    metadata: {
      refund_ticket: 'TICKET-12345',
    },
  }),
});

Response

SUCCESSFUL REFUND CREATION
{
  "id": "ref_1234567890abcdef",
  "object": "refund",
  "payment_id": "pay_0987654321fedcba",
  "amount": 5000,
  "currency": "USD",
  "status": "pending",
  "reason": "requested_by_customer",
  "stablecoin": "USDC",
  "network": "ethereum",
  "destination_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f8fE21",
  "metadata": {},
  "created_at": "2024-01-20T15:30:00Z"
}

Error Responses

PAYMENT NOT REFUNDABLE
{
  "error": {
    "type": "invalid_request",
    "message": "Payment cannot be refunded. It may not be completed or already fully refunded."
  }
}
AMOUNT EXCEEDS AVAILABLE
{
  "error": {
    "type": "validation_error",
    "message": "Refund amount exceeds the amount available for refund",
    "param": "amount"
  }
}

Start building

XO

Request Demo

Schedule a call with our team

Select a product
Arrow right