Skip to main content
After authorizing a payment, you can return funds to the customer using a refund or undo the transaction with a reversal. Your server initiates both operations.

Refund vs reversal

RefundReversal
Customer visibilityAppears on the customer’s EBT account as a creditDoesn’t appear on the customer’s account
Use caseCustomer returns, order modifications, partial refundsSame-day voids, error correction, duplicate charges
Partial amountsSupportedNot supported (full transaction only)
APIPOST /v1/payment/refundPOST /v1/payment/reverse

Refund a payment

Call POST /v1/payment/refund to credit funds back to the customer’s EBT account. You can refund the full amount or a partial amount.

Request

FieldTypeRequiredDescription
amountintegerYesRefund amount in cents.
paymentTypestringYesSNAP or EBT_CASH.
paymentMethodIdstringYesThe payment method used in the original payment.
paymentIntentIdstringNoThe payment intent to refund.
orderIdstringNoYour identifier for the order.

Response

FieldTypeDescription
refundIntentIdstringA unique identifier for the refund.

Idempotency

Pass an Idempotency-Key header to safely retry refund requests without processing the same refund twice. If the API has already processed a request with the same key, it returns the original response.
const refund = await client.payment.refund(
  {
    amount: 1500,
    paymentType: "SNAP",
    paymentMethodId: "pm_12345",
    paymentIntentId: "pi_xxx",
  },
  {
    headers: { "Idempotency-Key": "refund_abc123" },
  },
);

console.log(refund.refundIntentId);

Reverse a payment

Call POST /v1/payment/reverse to void a transaction. The reversal doesn’t appear on the customer’s EBT account. You can reverse a payment or a refund by providing the corresponding ID.

Request

Provide one of the following:
FieldTypeRequiredDescription
paymentIntentIdstringNoThe payment intent to reverse.
refundIntentIdstringNoThe refund to reverse.

Response

FieldTypeDescription
retrievalReferenceNumberstringA reference number for the reversal.
// Reverse a payment
const reversal = await client.payment.reverse({
  paymentIntentId: "pi_xxx",
});

console.log(reversal.retrievalReferenceNumber);

// Reverse a refund
const refundReversal = await client.payment.reverse({
  refundIntentId: "ri_xxx",
});