Skip to main content

Create transaction

Create a new payment transaction using EFundFlow API. This endpoint allows you to process various payment methods including credit cards, digital wallets, and other payment instruments.

POSThttps://api.efundpay.com/v4/transactions
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"
X-Forwarded-Forstringrequired

The originating IP address of the client connecting to the server.

Examples:"203.0.113.195"

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"
payment_methodobject | nullrequired

The payment method to be used for this transaction. Includes both card-based and alternative payment methods (APM). For detailed descriptions of each payment method, see Payment Methods.

buyerobject | null

Guest buyer details provided inline rather than creating a buyer resource beforehand and using the buyer_id or buyer_external_identifier keys.When payment_method.method is apm, this field is required.

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"}"
browser_infoobject | null

Information about the browser used by the buyer. This can be used by anti-fraud services. Merchant provided browser info.

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_methodobjectrequired

The payment method used for this transaction.

methodenum<string>required

The method used for the transaction.

Examples:"card"
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.

three_d_secureobject

3D Secure information.

created_atstring

The creation time.

Examples:"2013-07-16T19:23:00.000+00:00"
curl --request POST \
--url https://api.efundpay.com/v4/transactions/payments \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-account-id: <x-merchant-account-id>' \
--header 'X-Forwarded-For: 203.0.113.195' \
--header 'Content-Type: application/json' \
--data '{
"amount": 1299,
"currency": "USD",
"payment_method": {
"method": "card",
"number": "4111111111111111",
"expiration_date": "12/25",
"security_code": "123",
"redirect_url": "https://example.com",
"webhooks_url": "https://yourdomain.com/webhooks/payment",
},
"buyer": {
"display_name": "John Doe",
"email_address": "john@example.com"
},
"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_method": {
"method": "card",
"scheme": "visa",
"expiration_date": "12/25",
"country": "US",
"details": {
"bin": "411111",
"card_type": "credit",
"card_issuer_name": "Test Bank"
},
"payment_url_link":"https://pay.efundpay.com/abc123",
"payment_app_link":"app://pay/abc123",
"url_link_expire_sec":300,
"payment_qr_code":"weixin://wxpay/bizpayurl?pr=abc123",
"payment_qr_code_expire_sec":300
},
"method": "card",
"buyer": {
"type": "buyer",
"id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
"display_name": "John Doe",
"external_identifier": "buyer-12345",
},
"created_at": "2013-07-16T19:23:00.000+00:00"
}
Powered by Docusaurus