Skip to main content

Checkout transaction

This endpoint is a checkout mode order creation interface. After creating an order, it will redirect to a payment link for payment. This endpoint allows you to process various payment methods, including credit cards, digital wallets, and other payment instruments.

POSThttps://api.efundpay.com/v4/checkout/payments
This endpoint requires the transactions.write scope.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

Headers

x-merchant-account-idstringrequired

The ID of the merchant account to use for this request.

Examples:"default"
idempotency-keystring

A unique key to ensure idempotency of the request. If provided, the same request will not be processed multiple times.

Examples:"unique-key-123"

Body

application/json
amountintegerrequired

The monetary amount to charge, in the smallest currency unit (e.g., 100 cents to charge $1.00).

Range:100 <= x <= 99999999
Examples:"1299"
currencystringrequired

The ISO 4217 three-letter currency code.For redirect requests, this value must match the one specified for currency in payment_method

Length:3
Examples:"USD""EUR""GBP"
external_identifierstringrequired

The merchant reference for this transaction. Used to identify the transaction in your system.

Length:1 - 64
Examples:"order-12345"
countrystring | null

The 2-letter ISO code of the country where the transaction is processed. This is also used to filter the payment services that can process the transaction. If this value is provided for redirect requests and it's not null, it must match the one specified for country in payment_method. Otherwise, the value specified for country in payment_method will be assumed implicitly.

Examples:"US""GB""TH"
redirect_urlstringrequired

The URL to redirect a user back to after the complete 3DS in browser.

Examples:"https://example.com"
webhooks_urlstringrequired

The webhook URL to receive payment status notifications.

Examples:"https://merchant.com/webhooks/payment"
cancel_urlstring

The URL to redirect the user if the payment is cancelled.

Examples:"https://merchant.com/payment/cancel"
buyerobjectrequired

Guest buyer details provided inline rather than creating a buyer resource beforehand and using the buyer_id or buyer_external_identifier keys.

cart_itemsCartItem . object[] | nullrequired

An array of cart items that represents the line items of a transaction.

billing_detailsobject | null

The billing details for this transaction.

shipping_detailsobject | null

The shipping details for this transaction.

metadataobject | null

Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.

Examples:"{"order_id": "12345", "customer_type": "premium"}"

Response

application/json

Successful Response

typestring

The type of resource.

Examples:"transaction"
idstringrequired

The unique identifier for this transaction.

Examples:"7099948d-7286-47e4-aad8-b68f7eb44591"
merchant_account_idstringrequired

The merchant account ID.

Examples:"default"
currencystringrequired

The currency for the transaction.

Examples:"EUR""USD"
amountintegerrequired

The amount for the transaction.

Examples:"1299"
statusstringrequired

The status of the transaction.

Examples:"authorization_succeeded""processing"
external_identifierstringrequired

The external identifier for the transaction.

Examples:"transaction-12345"
payment_url_linkstring | null

The URL link for pending payment.

Examples:"https://pay.efundpay.com/abc123"
countrystring

The country of the transaction.

Examples:"US"
error_codestring

The error code if any.

Examples:"missing_redirect_url"
buyerobject

The buyer information.

shipping_detailsobject

The shipping details.

cart_itemsarray

Cart items.

created_atstring

The creation time.

Examples:"2013-07-16T19:23:00.000+00:00"
curl --request POST \
--url https://api.efundpay.com/v4/checkout/payments \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-account-id: <x-merchant-account-id>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 1299,
"currency": "USD",
"redirect_url": "https://yourdomain.com/redirect",
"webhooks_url": "https://yourdomain.com/webhooks/payment",
"cancel_url": "https://yourdomain.com/cancel",
"buyer": {
"external_identifier": "buyer-12345",
"display_name": "John Doe",
"email_address": "john@example.com",
"first_name": "John",
"last_name": "Doe"
},
"cart_items": [{
"name": "GoPro HD",
"quantity": 1,
"unit_amount": 1299
}],
"external_identifier": "order-12345"
}'
{
"type": "transaction",
"id": "7099948d-7286-47e4-aad8-b68f7eb44591",
"merchant_account_id": "default",
"currency": "USD",
"amount": 1299,
"status": "processing",
"country": "US",
"external_identifier": "order-12345",
"payment_url_link":"https://pay.efundpay.com/abc123"
"buyer": {
"external_identifier": "buyer-12345",
"display_name": "John Doe",
},
"created_at": "2013-07-16T19:23:00.000+00:00"
}
Powered by Docusaurus