Skip to main content

Token Payment

Process one-time payments using an existing payment token. This endpoint allows merchants to charge customers without creating subscriptions, using the securely stored payment information in the token.

POSThttps://api.efundpay.com/v4/tokens/{token_id}/payment
This endpoint requires the subscriptions.write scope.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header in the format `Bearer <token>`, where `<token>` is your authentication token.

Headers

x-merchant-account-idstringrequired

Merchant account ID for this request.

Examples:"default"
idempotency-keystring

Unique key to ensure request idempotency. If provided, identical requests will not be processed multiple times.

Examples:"unique-key-123"
X-Forwarded-Forstringrequired

Original IP address of the client connecting to the server.

Examples:"203.0.113.195"

Body

application/json
amountintegerrequired

Payment amount in cents (smallest currency unit).

Examples:"1000""2999"
currencystringrequired

Payment currency (ISO 4217 format).

Examples:"USD""EUR"
external_identifierstringrequired

Merchant reference identifier for this payment. Used to identify the payment in your system.

Length:1 - 64
Examples:"payment-12345"
descriptionstring

Description of the payment.

Length:1 - 255
Examples:"One-time payment using token"
metadataobject

Custom key-value pairs for additional information.

Examples:"{"campaign": "summer_promotion", "source": "website"}"

Response

application/json

Successful Response

idstringrequired

Unique payment identifier.

Examples:"pay_1234567890abcdef"
objectstringrequired

Object type, always "payment".

Examples:"payment"
token_idstringrequired

Token ID used for this payment.

Examples:"tok_a1b2c3d4"
amountintegerrequired

Payment amount in cents.

Examples:"1000"
currencystringrequired

Payment currency.

Examples:"USD"
statusstringrequired

Payment status: succeeded, failed, processing.

Examples:"succeeded""failed"
external_identifierstringrequired

Merchant reference identifier for this payment.

Examples:"payment-12345"
createdstringrequired

Payment creation time (ISO 8601).

Examples:"2025-08-12T09:00:00Z"
customerobjectrequired

Customer information from the token.

payment_methodobjectrequired

Payment method information from the token.

descriptionstring

Payment description.

Examples:"One-time payment using token"
metadataobject

Custom metadata.

Examples:"{}"
curl --request POST \
--url https://api.efundpay.com/v4/tokens/{token_id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-account-id: <x-merchant-account-id>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: unique-key-123' \
--header 'X-Forwarded-For: 203.0.113.195' \
--data '{
"amount": 1000,
"currency": "USD",
"external_identifier": "payment-12345",
"description": "One-time payment using token",
"metadata": {
"campaign": "summer_promotion",
"source": "website"
}
}'
{
"id": "pay_1234567890abcdef",
"object": "payment",
"token_id": "tok_a1b2c3d4",
"amount": 1000,
"currency": "USD",
"status": "succeeded",
"external_identifier": "payment-12345",
"created": "2025-08-12T09:00:00Z",
"customer": {
"display_name": "John Doe",
"external_identifier": "customer-12345",
"first_name": "John",
"last_name": "Doe",
"email_address": "john@example.com",
"phone_number": "+1234567890"
},
"payment_method": {
"type": "card",
"card": {
"last4": "1111",
"expiration_date": "12/27"
}
},
"description": "One-time payment using token",
"metadata": {
"campaign": "summer_promotion",
"source": "website"
}
}
Powered by Docusaurus