Skip to main content
POST
/
v1
/
payment
/
refund
JavaScript
import Benny from '@bennyapi/sdk';

const client = new Benny({
  subdomain: 'My-Subdomain',
  apiKey: process.env['BENNY_API_KEY'], // This is the default and can be omitted
});

const response = await client.payment.refund({
  amount: 0,
  paymentType: 'SNAP',
  tokenId: 'tokenId',
});

console.log(response.refundIntentId);
{
  "refundIntentId": "<string>"
}

Authorizations

api-key
string
header
required

API key authentication for public endpoints

Headers

Idempotency-Key
string

Unique key to ensure idempotent requests.

Body

application/json
tokenId
string
required
amount
integer
required
paymentType
enum<string>
required
Available options:
SNAP,
EBT_CASH
orderId
string
paymentIntentId
string

Response

Payment refunded successfully.

refundIntentId
string
required

The refund intent ID.