Swiftx API facilitate fast payments via bank tranfers to specified beneficiaries.
SwiftX payment API (2.5.1)
- Since quotes are not reusable since v2.5.0, we could now add requirement that quote also contains rate: Quote amount is in base currency (e.g. AED/BHD) and payment amount is in destination currency (e.g. INR) We now check that
payment_amount = quote_amount * quote_rate
/v2/payment_extendpoint is now merged with/v2/paymentendpoint; You must supply details, like sender name, dob, some document id etcQuotes are now per single payment (i.e. no quote reuse, which was possible by accident)
For more efficient routing you can now add amount, bank and bank account details to the quote which allows for more efficient routing of payments.
You can now supply
external_idfor the payment order and fetch the payment status using that id.POST /v2/payment(external_idbody parameter)GET /v2/payments/{id}?external=true(external_idbody parameter)
You can now supply additional parameters to quote request (
amount,accandbankID). These allows us to return best possible quote and increase payment success rate.There is a new
/v2/payment_extendpoint which allows adding sender info. This allows payments for more countries.
Before using this API you need to obtain valid credentials:
- ACCESS KEY: Random base64 encoded string with custom prefix
- SECRET KEY: Random base64 encoded string
If possible, you need to keep ACCESS_KEY private and under no circumstances you should share your SECRET KEY. For user convenience, ACCESS KEY includes custom prefix in the value, e.g.
company-test-sIEUpUP7b41n51WYwhere the first part is your company tag, followed by key usage hint and last part is a random value.
For API authentication we use JWT/Bearer tokens, signed with your SECRET KEY
Currently supported JWT algorithms are:
HS256
JWT token header MUST include kid:
{
"alg": "HS256",
"typ": "JWT",
"kid": "someuser-demo-1234567890ABCDEF"
}JWT token body MUST include the following claims:
{
"sub": "someuser-demo-1234567890ABCD", /* (your `ACCESS KEY`), the same as `kid` */
"exp": 1234, /* (expiration time, UNIX timestamp, UTC) */
"iat": 1234, /* (issued at time, UNIX timestamp, UTC) */
"aud": "https://api.example.net", /* (API URL, e.g. "https://api.swiftxappdev.net") */
"iss": "https://api.example.com" /* (API URL, e.g. "https://api.swiftxappdev.net") */
}In addition to the above, you can add hmac claim for POST requests:
{
"hmac": "str (SHA256 HMAC of the raw POST body)"
}This allows attesting that POST payloads are not modified in transit.
Using fast expiring tokens with HMAC adds additional guards so your requests can't be intercepted/forged, nor replayed.
Swiftx doesn't provide JWT editor for the time being, you can use the excellent jwt.io (password is 'jwtv2')
Transactions accepted by the API can be in one of the following states. As soon as the order is accepted, you will get unique id in the response, which can base used to track the transaction.
Please note that orders rejected up-front by the API with 4xx (authentication or validation errors) are not represented in the state table, since they've never been accepted for processing.
| Status Category | Status | Description | Notes |
|---|---|---|---|
| In Progress | queued | Payment order accepted | Order is accepted and waiting to be submitted for processing |
| In Progress | pending | Payment order pending | DEPRECATED (see processing) |
| In Progress | processing | Payment order is processing | Payment submitted and accepted by processor |
| Success | succeeded | Payment executed successfully | |
| Failed | failed | Payment failed | Payment failed by the processor |
| Failed | rejected | Payment rejected | Payment rejected by processor or by API during processing (e.g API could not route) |
| Failed | canceled | Payment is canceled | DEPRECATED (see reversed) |
| Failed | reversed | Payment is reversed | Payment reversed (and refunded) on the processor side |
| Call Support | unknown | Payment state is unknown | Payment has encountered uknown status by the processor, needs manual intervantion |
Base currency (the currency will be automatically converted to local currency using the provided quote)
Valid currency quote id (UUID4) as returned by POST /v2/quote. Quote currency must match base currency.
The amount in the destination currency (quote.rate * quote.amount). The value must match the value calculated from the quote. It will return Error if the numbers are not the same (up to 4 decimal places)
Full name of the beneficiary (name and surname).
Beneficiary address (street and number)
Bank account id of the beneficiary.
Valid Indian mobile number (ITU E.164 format). Country code prefix (+91).
Valid Indian mobile number (ITU E.164 format). Country code prefix (+91).
If specified, must be a valid email address
If specified, must be a valid email address
Supplementary info and notes for tracking the transaction.
Supplementary info and notes for tracking the transaction.
Sender birthdate
Sender birthdate
Expiry date for the sender identity document
Expiry date for the sender identity document
Sender country (nationality) (ISO 3166-1 alpha-3 Country Code)
Sender country (nationality) (ISO 3166-1 alpha-3 Country Code)
Sender residency/address (street and number)
Sender residency/country (ISO 3166-1 alpha-3 Country Code)
Sender mobile number (ITU E.164 format)
Sender mobile number (ITU E.164 format)
Sender relation to beneficiary (Kin)
Unique ID provided by API user
Unique ID provided by API user
- Mock serverhttps://docs.swiftxpay.com/_mock/openapi/v2/payment
- Swiftx Test serverhttps://api.swiftxapptest.net/v2/payment
- Swiftx Production serverhttps://api.swiftxapp.net/v2/payment
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.swiftxpay.com/_mock/openapi/v2/payment \
-H 'Content-Type: application/json' \
-H 'authorization: string' \
-d '{
"amount": 100,
"bank_name": "HDFC Bank",
"beneficiary_account_number": "7823732431829188",
"beneficiary_account_type": "savings",
"beneficiary_address": "Linking Road",
"beneficiary_city": "Mumbai",
"beneficiary_email": "rkgupta@domain.com",
"beneficiary_mobile": "+918834907438",
"beneficiary_name": "Rakesh Gupta",
"country": "BGD",
"currency": "AED",
"quote": "00000000-0000-4000-A000-000000000000",
"remarks": "test",
"sender_address": "Jumeirah Beach Road",
"sender_birthdate": "1970-01-01",
"sender_city": "Dubai",
"sender_country": "ARE",
"sender_identity_doc": "A987654",
"sender_identity_doc_country": "ARE",
"sender_identity_doc_exp": "2038-01-19",
"sender_identity_doc_type": "idcard",
"sender_mobile": "+9715850185684",
"sender_name": "Ahmed Ahmed",
"sender_relation": "other"
}'Successful Response
{ "id": "00000000-0000-4000-A000-000000000000", "msg": "OK", "status": "queued", "timestamp": "2024-12-01T01:02:03.000000Z" }
Source currency
Bank account id of the beneficiary. [OPTIONAL]
Bank account id of the beneficiary. [OPTIONAL]
Bank branch code of the beneficiary (e.g. IFSC for India) [OPTIONAL]
Bank branch code of the beneficiary (e.g. IFSC for India) [OPTIONAL]
- Mock serverhttps://docs.swiftxpay.com/_mock/openapi/v2/quote
- Swiftx Test serverhttps://api.swiftxapptest.net/v2/quote
- Swiftx Production serverhttps://api.swiftxapp.net/v2/quote
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.swiftxpay.com/_mock/openapi/v2/quote \
-H 'Content-Type: application/json' \
-H 'authorization: string' \
-d '{
"country": "BGD",
"currency": "BHD",
"beneficiary_account_number": "string",
"bank_branch_code": "string",
"amount": 0
}'{ "amount": 100, "amount_destination": 8488.79, "country": "IND", "currency": "USD", "expires": "2024-12-01T01:17:03.000000Z", "id": "00000000-0000-4000-A000-000000000000", "max_amount_destination": 100000, "min_amount_destination": 100, "rate": 84.887912, "timestamp": "2024-12-01T01:02:03.000000Z", "wallet_rate": 84.887912 }
- Mock serverhttps://docs.swiftxpay.com/_mock/openapi/v2/quote/{id}
- Swiftx Test serverhttps://api.swiftxapptest.net/v2/quote/{id}
- Swiftx Production serverhttps://api.swiftxapp.net/v2/quote/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.swiftxpay.com/_mock/openapi/v2/quote/{id}?country=BGD' \
-H 'authorization: string'{ "amount": 100, "amount_destination": 8488.79, "country": "IND", "currency": "USD", "expires": "2024-12-01T01:17:03.000000Z", "id": "00000000-0000-4000-A000-000000000000", "max_amount_destination": 100000, "min_amount_destination": 100, "rate": 84.887912, "timestamp": "2024-12-01T01:02:03.000000Z", "wallet_rate": 84.887912 }
- Mock serverhttps://docs.swiftxpay.com/_mock/openapi/v2/payments/{id}
- Swiftx Test serverhttps://api.swiftxapptest.net/v2/payments/{id}
- Swiftx Production serverhttps://api.swiftxapp.net/v2/payments/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.swiftxpay.com/_mock/openapi/v2/payments/{id}?country=BGD&external=false' \
-H 'authorization: string'Successful Response
Base currency (the currency will be automatically converted to local currency using the provided quote)
Valid currency quote id (UUID4) as returned by POST /v2/quote. Quote currency must match base currency.
The amount in the destination currency (quote.rate * quote.amount). The value must match the value calculated from the quote. It will return Error if the numbers are not the same (up to 4 decimal places)
Full name of the beneficiary (name and surname).
Beneficiary address (street and number)
Bank account id of the beneficiary.
Valid Indian mobile number (ITU E.164 format). Country code prefix (+91).
Valid Indian mobile number (ITU E.164 format). Country code prefix (+91).
If specified, must be a valid email address
If specified, must be a valid email address
Supplementary info and notes for tracking the transaction.
Supplementary info and notes for tracking the transaction.
Sender birthdate
Sender birthdate
Expiry date for the sender identity document
Expiry date for the sender identity document
Sender country (nationality) (ISO 3166-1 alpha-3 Country Code)
Sender country (nationality) (ISO 3166-1 alpha-3 Country Code)
Sender residency/address (street and number)
Sender residency/country (ISO 3166-1 alpha-3 Country Code)
Sender mobile number (ITU E.164 format)
Sender mobile number (ITU E.164 format)
Sender relation to beneficiary (Kin)
Unique ID provided by API user
Unique ID provided by API user
Timestamp of the order (will be filled in automatically server side)
Timestamp of the order (will be filled in automatically server side)
Bank account type
Branch name of the specified bank
Branch name of the specified bank
Bank branch code (e.g. for India it is equivalent to IFSC)
Sender identity document type
Sender identity document type
{ "id": "string", "order": { "amount": 100, "bank_name": "HDFC Bank", "beneficiary_account_number": "7823732431829188", "beneficiary_account_type": "savings", "beneficiary_address": "Linking Road", "beneficiary_city": "Mumbai", "beneficiary_email": "rkgupta@domain.com", "beneficiary_mobile": "+918834907438", "beneficiary_name": "Rakesh Gupta", "country": "IND", "currency": "AED", "quote": "00000000-0000-4000-A000-000000000000", "remarks": "test", "sender_address": "Jumeirah Beach Road", "sender_birthdate": "1970-01-01", "sender_city": "Dubai", "sender_country": "ARE", "sender_identity_doc": "A987654", "sender_identity_doc_country": "ARE", "sender_identity_doc_exp": "2038-01-19", "sender_identity_doc_type": "idcard", "sender_mobile": "+9715850185684", "sender_name": "Ahmed Ahmed", "sender_relation": "other" }, "response": { "id": "00000000-0000-4000-A000-000000000000", "msg": "OK", "status": "queued", "timestamp": "2024-12-01T01:02:03.000000Z" }, "quote": { "amount": 100, "amount_destination": 8488.79, "country": "IND", "currency": "USD", "expires": "2024-12-01T01:17:03.000000Z", "id": "00000000-0000-4000-A000-000000000000", "max_amount_destination": 100000, "min_amount_destination": 100, "rate": 84.887912, "timestamp": "2024-12-01T01:02:03.000000Z", "wallet_rate": 84.887912 } }
- Mock serverhttps://docs.swiftxpay.com/_mock/openapi/v2/payments
- Swiftx Test serverhttps://api.swiftxapptest.net/v2/payments
- Swiftx Production serverhttps://api.swiftxapp.net/v2/payments
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.swiftxpay.com/_mock/openapi/v2/payments?country=BGD&limit=20&offset=0&sorting_order=desc&start_ts=2019-08-24T14%3A15%3A22Z&end_ts=2019-08-24T14%3A15%3A22Z&status=queued&search_type=id&search_term=string' \
-H 'authorization: string'Successful Response
Base currency (the currency will be automatically converted to local currency using the provided quote)
Valid currency quote id (UUID4) as returned by POST /v2/quote. Quote currency must match base currency.
The amount in the destination currency (quote.rate * quote.amount). The value must match the value calculated from the quote. It will return Error if the numbers are not the same (up to 4 decimal places)
Full name of the beneficiary (name and surname).
Beneficiary address (street and number)
Bank account id of the beneficiary.
Valid Indian mobile number (ITU E.164 format). Country code prefix (+91).
Valid Indian mobile number (ITU E.164 format). Country code prefix (+91).
If specified, must be a valid email address
If specified, must be a valid email address
Supplementary info and notes for tracking the transaction.
Supplementary info and notes for tracking the transaction.
Sender birthdate
Sender birthdate
Expiry date for the sender identity document
Expiry date for the sender identity document
Sender country (nationality) (ISO 3166-1 alpha-3 Country Code)
Sender country (nationality) (ISO 3166-1 alpha-3 Country Code)
Sender residency/address (street and number)
Sender residency/country (ISO 3166-1 alpha-3 Country Code)
Sender mobile number (ITU E.164 format)
Sender mobile number (ITU E.164 format)
Sender relation to beneficiary (Kin)
Unique ID provided by API user
Unique ID provided by API user
Timestamp of the order (will be filled in automatically server side)
Timestamp of the order (will be filled in automatically server side)
Bank account type
Branch name of the specified bank
Branch name of the specified bank
Bank branch code (e.g. for India it is equivalent to IFSC)
Sender identity document type
Sender identity document type
[ { "id": "string", "order": { … }, "response": { … }, "quote": { … } } ]