Developers

Developer documentation

Build with Paysation's payment gateway API: payments, 3DS, recurring charges, refunds, void / settle, token migration and subscriptions.

Overview

General information required for every request to the Paysation Payment Gateway API.

Base URLs

EnvironmentBase URL
Productionhttps://api.paysation.com

Paysation does not use a separate staging URL. The API endpoint is the same for both test and live. See Test API.

Required headers

Every request must include the following HTTP headers:

HeaderRequiredValueDescription
Content-Typeyesapplication/jsonRequest body is always a JSON document encoded in UTF-8.
AuthorizationyesBearer %API KEY%Merchant API key issued by Paysation. Identifies and authenticates the caller.

Example

Code
POST /<endpoint> HTTP/1.1
Host: api.paysation.com
Content-Type: application/json
Authorization: Bearer %API KEY%

{
  "...": "..."
}

Response format

All responses are returned as JSON encoded in UTF-8. See all possible HTTP response codes in Response codes.

The HTTP status reflects the outcome of the call:

Error response example

Any response with status >= 400 contains a message field with a human-readable explanation:

JSON
1{
2  "message": "Invalid request payload"
3}

Notes

Test API

This page describes how to simulate payment scenarios before going live.

Test environment overview

Paysation does not use a separate staging URL. The API endpoint is the same for both test and live:

Code
https://api.paysation.com

To access the test environment, each client is provisioned with a dedicated set of test resources:

ResourceDescription
Test AccountA separate account isolated from the live account. All test transactions are processed through it.
Test CredentialsAPI key and secret scoped to the Test Account. Use these in place of live credentials when making test requests.
Test Merchant AdminA dedicated admin interface where the client can view test transactions, test credentials, and configuration.

Test credentials and live credentials are completely isolated — a request made with test credentials never affects live funds or live transaction history.

Test cards do not process real funds and work only when authenticated with test credentials.

General rules

Test cards

BrandCard number3Ds ScenarioBehaviour
Visa4111111111111111frictionlessSuccessful authorization
Visa4000000000000002frictionlessAuthorization failed
Visa4742106766751112fingerpringSuccessful authorization
Visa4000123187649263fingerpringAuthorization failed
Visa4008372336662369challengeFill any OTP code for successful authentication. Fill OTP code 101 for failed authorization
Visa4871040656543210NO-3DSCard is not enrolled in 3DS. No fingerprint or challenge step is performed. Response returns threeDStatus: null, message Card is not 3D-enrolled.
Mastercard5101510151015101frictionlessSuccessful authorization
Mastercard5200000000000007frictionlessAuthorization failed
Mastercard5359438730895896fingerpringSuccessful authorization
Mastercard5127880173456453fingerpringAuthorization failed
Mastercard5109486948861999challengeFill any OTP code for successful authentication. Fill OTP code 101 for failed authorization
Mastercard5333476046218777NO-3DSCard is not enrolled in 3DS. No fingerprint or challenge step is performed. Response returns threeDStatus: null, message Card is not 3D-enrolled.
Amex378282246310005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;—Successful transaction
Amex371449635398431&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;—Failed transaction
Discover6011111111111117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;—Successful transaction
Discover6011000000000004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;—Failed transaction

Decline scenario

ScenarioAmountBehaviour
General= 1.01Decline with message General decline.
General= 1.02Decline with message Suspected fraud.
General= 1.03Decline with message Insufficient funds.

Sale

Direct card charge without 3DS authentication. The merchant sends card data server-to-server; the gateway processes the payment and returns the final result.

To split authorization and capture, set capture to false in the request — funds are only authorized. The merchant then calls /settle to capture, or /void to release the hold.

Endpoint

POST<base-url>/payment

Base URLs and required headers (Content-Type, Authorization) are defined in Overview.

Request body

Top-level fields:

FieldRequiredTypeConstraintsDescription
clientTransactionIdrequiredstring3–64 chars, unique per callMerchant-side reference for the transaction — order ID, invoice ID or transaction ID. Used as the idempotency key.
amountrequireddecimal> 0Charge amount (e.g. 49.99).
currencyrequiredstringISO 4217, 3 charsCurrency code (e.g. USD, EUR).
descriptionoptionalstring1–256 charsName of the product or service being sold. Shown in reports and may be passed to the acquirer.
captureoptionalbooleandefault trueIf true, funds are captured immediately. If false, only an authorization is placed and capture must be performed in a separate step.
settleIntervaloptionalinteger1 – max scheme limit (hours)Auto-settle delay in hours. Only valid when capture: false. See Void / Settle.
paymentMethodrequiredobjectsee paymentMethod belowPayment instrument data. The single key inside the object implicitly defines the payment method type.
customerrequiredobjectsee customer belowCustomer and billing data.
external3dsoptionalobjectsee External 3DSPre-completed 3DS authentication data from a merchant-managed or third-party 3DS provider. When present, the gateway skips its own 3DS flow and submits the provided authentication values directly to the processor.
webhookUrloptionalstringHTTPS URLEndpoint to receive the asynchronous payment-result notification.

paymentMethod

The object contains exactly one key, which identifies the payment method type. Supported keys: card / token / applePay / googlePay. This document describes the card method.

card

FieldRequiredTypeConstraintsDescription
numberrequiredstring13–19 digitsFull card PAN.
securityCoderequiredstring3–4 digitsCard security code (CVV / CVC).
expMonthrequiredstring01–12Card expiry month.
expYearrequiredstring2 digits (e.g. 29)Card expiry year, last two digits.
cardHolderNamerequiredstring2–64 charsCardholder name as printed on the card.

customer

FieldRequiredTypeConstraintsDescription
firstNamerequiredstring2–32 charsCustomer first name.
lastNamerequiredstring2–32 charsCustomer last name.
addressrequiredstring2–64 charsStreet address.
cityrequiredstring2–32 charsCity.
countryrequiredstringISO 3166-1 alpha-2Country code (e.g. US).
zipcoderequiredstring2–10 charsPostal / ZIP code.
staterequiredstring2–32 charsState / region.
phoneoptionalstring7–15 digitsCustomer phone number.
ipAddressrequiredstringvalid IPv4 / IPv6Customer IP address.
emailrequiredstringvalid emailCustomer email.

Request example

JSON
1{
2  "clientTransactionId": "order_20260512_0091",
3  "amount": 49.99,
4  "currency": "USD",
5  "description": "Premium subscription — 1 month",
6  "paymentMethod": {
7    "card": {
8      "number": "4111111111111111",
9      "securityCode": "737",
10      "expMonth": "09",
11      "expYear": "28",
12      "cardHolderName": "John Doe"
13    }
14  },
15  "customer": {
16    "firstName": "John",
17    "lastName": "Doe",
18    "address": "742 Evergreen Terrace",
19    "city": "Springfield",
20    "country": "US",
21    "zipcode": "90210",
22    "state": "IL",
23    "phone": "14155552671",
24    "ipAddress": "203.0.113.42",
25    "email": "[email protected]"
26  },
27  "webhookUrl": "https://merchant.example.com/webhooks/payment"
28}

Response

HTTP status codes and the error response shape are defined in Overview — Response format.

The response body contains the following fields:

FieldTypeRequiredDescription
statusstringrequiredPayment status. See See possible transaction status
transactionIdstringrequiredGateway transaction identifier.
clientTransactionIdstringrequiredMerchant-side reference echoed from the request.
schemeTransactionIdstringoptionalTransaction ID assigned by the card scheme (Visa / Mastercard). Used for dispute resolution and reconciliation. Omitted when the transaction did not reach the scheme.
paymentTokenstringrequiredStored payment instrument token for future charges. Omitted when no stored credential was produced.
codestringrequiredGateway result code. 00 on success. See Response codes.
messagestringrequiredHuman-readable description of the result.
bankDeclineCodestringoptionalRaw decline code passed through from the card scheme unmodified. Present only when status is failed and the charge was submitted to the scheme.

Example — success

JSON
1{
2  "status": "success",
3  "transactionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
4  "clientTransactionId": "order_20260512_0091",
5  "schemeTransactionId": "012345678901234",
6  "paymentToken": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
7  "code": "00",
8  "message": "Approved"
9}

Payment failed:

JSON
1{
2  "status": "failed",
3  "transactionId": "3c2b1a4e-5d6f-7e8a-9b0c-1d2e3f4a5b6c",
4  "clientTransactionId": "order_20260512_0091",
5  "schemeTransactionId": "998877665544332",
6  "code": "11",
7  "message": "Insufficient funds",
8  "bankDeclineCode": "51"
9}

3D Server-to-Server

Card charge with 3DS authentication. The merchant sends a card data server-to-server. The gateway returns a redirectUrl to which the customer must be redirected to complete 3DS. After authentication, the final status is delivered to:

1. The redirectUrl provided in the request (browser return). 2. The webhookUrl provided in the request (asynchronous server-to-server notification).

The request is identical to Sale with the following additions: 3ds, browserDetails and redirectUrl.

Endpoint

POST<base-url>/payment

Base URLs and required headers (Content-Type, Authorization) are defined in Overview.

Request body

Top-level fields:

FieldRequiredTypeConstraintsDescription
clientTransactionIdrequiredstring3–64 chars, unique per callMerchant-side reference for the transaction — order ID, invoice ID or transaction ID. Used as the idempotency key.
amountrequireddecimal> 0Charge amount (e.g. 49.99).
currencyrequiredstringISO 4217, 3 charsCurrency code (e.g. USD, EUR).
descriptionoptionalstring1–256 charsName of the product or service being sold. Shown in reports and may be passed to the acquirer.
3dsrequiredbooleanmust be trueMarks the request as a 3DS-authenticated payment.
captureoptionalbooleandefault trueIf true, funds are captured immediately after successful 3DS authentication. If false, only an authorization is placed.
paymentMethodrequiredobjectsame structure as SalePayment instrument data.
customerrequiredobjectsame structure as SaleCustomer and billing data.
browserDetailsrequiredobjectsee browserDetails belowCustomer browser data collected on the merchant page. Required by 3DS 2.x for risk assessment.
redirectUrlrequiredstringHTTPS URLCustomer return URL. The browser is redirected here with the final status after 3DS completes.
webhookUrloptionalstringHTTPS URLEndpoint to receive the asynchronous payment-result notification.

Nested objects (paymentMethod, customer) have the same fields and constraints as in Sale.

browserDetails

Collected on the merchant checkout page from the customer browser and passed to the gateway. Field semantics follow the EMV 3DS 2.x specification.

FieldRequiredTypeConstraintsDescription
acceptHeaderrequiredstringmax 2048 charsExact content of the HTTP Accept header sent by the customer browser.
javaEnabledrequiredbooleanValue of navigator.javaEnabled().
jsEnabledrequiredbooleantrue if JavaScript is enabled in the customer browser.
languagerequiredstring1–8 chars, IETF BCP 47 (e.g. en-US)Value of navigator.language.
colorDepthrequiredintegerone of 1, 4, 8, 15, 16, 24, 32, 48Value of screen.colorDepth, in bits.
screenHeightrequiredinteger> 0Value of screen.height, in pixels.
screenWidthrequiredinteger> 0Value of screen.width, in pixels.
tzOffsetrequiredintegerminutes, range -840…720Value of new Date().getTimezoneOffset() — local time offset from UTC in minutes.
userAgentrequiredstringmax 2048 charsExact content of the HTTP User-Agent header sent by the customer browser.
challengeWindowSizerequiredstring01 (250×400) / 02 (390×400) / 03 (500×600) / 04 (600×400) / 05 (full screen)Preferred size of the 3DS challenge window rendered to the customer.

Request example

JSON
1{
2  "clientTransactionId": "order_20260512_0092",
3  "amount": 49.99,
4  "currency": "USD",
5  "description": "Premium subscription — 1 month",
6  "3ds": true,
7  "paymentMethod": {
8    "card": {
9      "number": "4111111111111111",
10      "securityCode": "737",
11      "expMonth": "09",
12      "expYear": "28",
13      "cardHolderName": "John Doe"
14    }
15  },
16  "customer": {
17    "firstName": "John",
18    "lastName": "Doe",
19    "address": "742 Evergreen Terrace",
20    "city": "Springfield",
21    "country": "US",
22    "zipcode": "90210",
23    "state": "IL",
24    "phone": "14155552671",
25    "ipAddress": "203.0.113.42",
26    "email": "[email protected]"
27  },
28  "browserDetails": {
29    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
30    "javaEnabled": false,
31    "jsEnabled": true,
32    "language": "en-US",
33    "colorDepth": 24,
34    "screenHeight": 1080,
35    "screenWidth": 1920,
36    "tzOffset": -120,
37    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36",
38    "challengeWindowSize": "03"
39  },
40  "redirectUrl": "https://merchant.example.com/checkout/return",
41  "webhookUrl": "https://merchant.example.com/webhooks/payment"
42}

Response

HTTP status codes and the error response shape are defined in Overview — Response format.

The response body contains the following fields:

FieldTypeRequiredDescription
statusstringrequiredPayment status. See possible transaction status
transactionIdstringrequiredGateway transaction identifier.
clientTransactionIdstringrequiredMerchant-side reference echoed from the request.
schemeTransactionIdstringrequiredTransaction ID assigned by the card scheme (Visa / Mastercard). Omitted when the transaction did not reach the scheme (e.g. 3DS failed).
paymentTokenstringrequiredStored payment instrument token for future charges. Present on success only.
codestringrequiredGateway result code. 00 on success. See Response codes.
messagestringrequiredHuman-readable description of the result.
bankDeclineCodestringoptionalRaw decline code from the card scheme. Present only when status is failed and the charge reached the scheme.
threeDSobjectrequired3DS authentication result. See threeDS fields below.

threeDS fields

FieldTypeDescription
threeDStatusstringEMVCo authentication result: Y (authenticated), A (attempted), C (challenge required), N (failed), U (unavailable), R (rejected). Omitted in the initial response before authentication completes.
threeDVersionstring3DS protocol version used (e.g. 2.2.0).
flowstringfingerprint — ACS method iframe (initial response). frictionless — ACS authenticated without cardholder interaction. challenge — cardholder must complete ACS challenge.
authCodestringAuthorization code from the issuer. Present when threeDStatus is Y or A; omitted otherwise.
ecistringElectronic Commerce Indicator. 05/02 = fully authenticated; 06/01 = attempted; 07/00 = no auth. Omitted when authentication failed.
cavvstringIssuer cryptogram — proof of authentication. Omitted when authentication failed.
acsChallengestringY — challenge was required by the issuer; N — frictionless was allowed.
liabilityShiftbooleantrue — liability for fraud chargebacks shifts to the card issuer. false — the merchant bears the fraud risk. Derived from eci: 05/02 and 06/01 → true; 07/00 or absent → false. Present in the final response only.
redirectUrlstringURL where the browser must be redirected. Present when flow is fingerprint or challenge. Absent in the final response.

Example — initial response (fingerprint / challenge)

Returned immediately after the POST request when 3DS redirect is required. HTTP 202.

JSON
1{
2  "status": "pending",
3  "transactionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
4  "clientTransactionId": "order_20260512_0092",
5  "threeDS": {
6    "threeDVersion": "2.2.0",
7    "flow": "fingerprint",
8    "redirectUrl": "https://3ds.paysation.com/fingerprint/9b1deb4d"
9  },
10  "code": "00",
11  "message": "3DS authentication required"
12}

Example — final result (frictionless, success)

Delivered via webhook and browser redirect. HTTP 201.

JSON
1{
2  "status": "success",
3  "transactionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
4  "clientTransactionId": "order_20260512_0092",
5  "schemeTransactionId": "012345678901234",
6  "paymentToken": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
7  "threeDS": {
8    "threeDStatus": "Y",
9    "threeDVersion": "2.2.0",
10    "flow": "frictionless",
11    "authCode": "AUTH123456",
12    "eci": "05",
13    "cavv": "AAABBRRRSSSggghhh777AABBRRS=",
14    "acsChallenge": "N",
15    "liabilityShift": true
16  },
17  "code": "00",
18  "message": "Approved"
19}

After 3DS completion

Once the customer completes 3DS, the final payment result is delivered to both endpoints supplied in the request:

ChannelSourcePurpose
redirectUrl (request)Browser redirectReturn the customer to the merchant site with status.
webhookUrl (request)Server-to-server callAuthoritative asynchronous notification.

Recurring

How to charge a customer with a previously stored payment token — for subscription renewals, repeat purchases, and any payment against a stored credential.

Recurring does not have its own endpoint. It reuses Sale (POST /payment) with one difference: the paymentMethod object uses the token key instead of card. Card data (number, securityCode, expMonth, expYear, cardHolderName) is therefore not sent.

The caller must always indicate whether the charge is customer-initiated (cit) or merchant-initiated (mit) via recurringType — this value is required by the card networks (Visa Stored Credential Framework, Mastercard, EMV 3DS) for correct authorization and chargeback liability.

Endpoint

POST<base-url>/payment

Same as Sale. Base URLs and required headers (Content-Type, Authorization) are defined in Overview.

Request body

Top-level fields are the same as in Sale — clientTransactionId, amount, currency, description, capture, customer, webhookUrl. Only the paymentMethod object differs.

In a recurring charge, customer is optional (overrides the Sale requirement). The cardholder is normally not present — especially for mit — and the gateway already has the customer data from the original Sale that produced the token.

paymentMethod

For a recurring charge, paymentMethod contains the single key token (instead of card).

token

FieldRequiredTypeConstraintsDescription
paymentTokenrequiredstring40-char hashStored payment instrument token returned in the original Sale response as paymentToken.
recurringTyperequiredstringcit / mitIndicates who initiates the charge. See recurringType values below.

recurringType values

ValueMeaning
citCustomer-Initiated Transaction. The cardholder is actively present in the checkout flow (e.g. manual repeat purchase, account top-up initiated by the customer).
mitMerchant-Initiated Transaction. The merchant initiates the charge against a stored credential without the cardholder present (e.g. scheduled subscription renewal).

Request example

JSON
1{
2  "clientTransactionId": "order_20260514_0114",
3  "amount": 49.99,
4  "currency": "USD",
5  "paymentMethod": {
6    "token": {
7      "paymentToken": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
8      "recurringType": "mit"
9    }
10  }
11}

Response

The response fields are identical to Sale — Response

The response body contains:

FieldTypeDescription
statusstringPayment status. See status values below.
transactionIdstringGateway transaction identifier.
clientTransactionIdstringMerchant-side reference echoed from the request.
schemeTransactionIdstringTransaction ID assigned by the card scheme. Omitted when the transaction did not reach the scheme.
paymentTokenstringRefreshed token if the stored credential was updated. Omitted otherwise.
codestringGateway result code. 00 on success. See Response codes.
messagestringHuman-readable description of the result.
bankDeclineCodestringRaw decline code from the card scheme. Present only when status is failed and the charge reached the scheme.

Example

JSON
1{
2  "status": "success",
3  "transactionId": "c2f4b8a1-9e3d-4f72-8c0b-5a1d2e6f0b91",
4  "clientTransactionId": "order_20260514_0114",
5  "schemeTransactionId": "012345678901234",
6  "paymentToken": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
7  "code": "00",
8  "message": "Approved"
9}

Payment failed:

JSON
1{
2  "status": "failed",
3  "transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
4  "clientTransactionId": "order_20260514_0114",
5  "schemeTransactionId": "554433221100998",
6  "code": "11",
7  "message": "Insufficient funds",
8  "bankDeclineCode": "51"
9}

Void / Settle

Follow-up operations on a previously authorized Sale. To enable this flow, the original Sale must be submitted with capture: false — funds are then only authorized (held), not captured.

The merchant uses the transactionId returned in the Sale response to:

Each call decides the final outcome of the authorization; only one of the two can be performed per transaction.

Base URLs and required headers (Content-Type, Authorization) are defined in Overview.

Authorization hold management

When submitting a Sale with capture: false, two behaviors are available depending on whether settleInterval is provided.

Manual settle

Omit settleInterval. The merchant decides when to settle by calling /settle, or cancels with /void.

If neither /settle nor /void is called before the card scheme hold limit expires, the gateway automatically sends a void to release the held funds.

Auto-settle

Pass settleInterval (in hours) in the original Sale request. The gateway will automatically submit the settle operation after the specified interval — no separate /settle call is needed.

FieldTypeConstraintsDescription
settleIntervalinteger1 – max scheme limit (hours)Number of hours after authorization before the gateway auto-settles. Cannot exceed the card scheme maximum (see table below).

If the auto-settle fails, the authorization hold remains active and the gateway will retry.

The merchant can still send /void or /settle at any time before settleInterval elapses.

Card scheme hold limits settleInterval cannot exceed the card scheme maximum. If the value is higher, the gateway clamps it to the scheme limit. | Card scheme | Maximum hold period | | --- | --- | | Visa (CIT) | 240 hours (10 days) | | Visa (MIT) | 120 hours (5 days) | | Mastercard and other schemes | 168 hours (7 days) |

Settle

Capture funds from an existing authorized transaction. Settle requests are submitted to the processor in a batch — the gateway returns status: pending immediately and delivers the final result via webhook.

Partial settle

If amount in the request is less than the authorized amount, only that portion is captured. The remaining hold is automatically voided by the gateway immediately after the capture succeeds. Only one settle per authorization is possible — to capture the remainder, use a separate Sale.

Refunds are limited to the settledAmount returned in the settle response.

Endpoint

POST<base-url>/settle

Request body

FieldRequiredTypeConstraintsDescription
clientTransactionIdrequiredstring3–64 chars, unique per callMerchant-side reference for the settle operation. Used as the idempotency key.
transactionIdrequiredstringvalid UUIDGateway transaction identifier returned in the original Sale response.
amountoptionaldecimal> 0, ≤ authorized amountCapture amount. If omitted, the full authorized amount is captured. Supplying a lower value triggers a partial settle — the remaining hold is voided automatically.

Response

HTTP 201 is returned for all processed requests. Check status and code in the response body for the actual outcome. HTTP status codes and the error response shape are defined in Overview — Response format.

The response body contains:

FieldTypeDescription
typestringOperation type. Always settle.
statusstringOperation status. See status values below.
transactionIdstringGateway transaction identifier (same value as in the request).
clientTransactionIdstringMerchant-side reference echoed from the request.
settledAmountdecimalActual amount captured. Present when status is success.
settledCurrencystringCurrency of the captured amount (ISO 4217). Present when status is success.
codestringGateway result code.
messagestringHuman-readable description of the result.

status values

ValueHTTPMeaning
pending201Settle submitted to the processor batch. Await webhook for the final result.
success201Funds captured. settledAmount reflects the actual captured value.
failed201Settle declined. The authorization hold remains active — a retry is possible.

Void

Cancel an authorization created by a Sale with capture: false. No funds are transferred and the hold is released immediately.

Endpoint

POST<base-url>/void

Request body

FieldRequiredTypeConstraintsDescription
clientTransactionIdrequiredstring3–64 chars, unique per callMerchant-side reference for the void operation. Used as the idempotency key.
transactionIdrequiredstringvalid UUIDGateway transaction identifier returned in the original Sale response.

Response

HTTP 201 is returned for all processed requests. Check status and code in the response body for the actual outcome. HTTP status codes and the error response shape are defined in Overview — Response format.

The response body contains:

FieldTypeDescription
typestringOperation type. Always void.
statusstringOperation status. See status values below.
transactionIdstringGateway transaction identifier (same value as in the request).
clientTransactionIdstringMerchant-side reference echoed from the request.
codestringGateway result code.
messagestringHuman-readable description of the result.

status values

ValueHTTPMeaning
success201Authorization cancelled. Funds released back to the cardholder.
failed201Void declined or not permitted (e.g. transaction already settled).

Refund

Return funds to the cardholder for a previously settled transaction — full or partial.

Base URLs and required headers (Content-Type, Authorization) are defined in Overview.

Endpoint

POST<base-url>/refund

Partial refund

If amount in the request is less than the settled amount, only that portion is returned to the cardholder. Multiple partial refunds against the same transaction are allowed until the full settled amount is exhausted. To check how much remains refundable, use the transaction details endpoint.

Request body

FieldRequiredTypeConstraintsDescription
clientTransactionIdrequiredstring3–64 chars, unique per callMerchant-side reference for the refund operation. Used as the idempotency key.
transactionIdrequiredstringvalid UUIDGateway transaction identifier of the captured payment to refund. Returned by the original Sale.
amountoptionaldecimal> 0, ≤ remaining refundable amountAmount to refund. If omitted, the full remaining amount is refunded. Supplying a lower value triggers a partial refund.
reasonoptionalstringsee accepted values belowReason for the refund. If omitted, the gateway substitutes a processor-specific default. See Refund reason.

Refund reason

Some processors and PSPs require a reason code on every refund request. The gateway handles this transparently: 1. Client provided reason — the gateway maps it to the processor-specific format and forwards it. 2. Client did not provide reason — the gateway substitutes a constant default value (OTHER or equivalent) that satisfies the processor's mandatory field requirement. The merchant does not need to be aware of which processors require it.

Accepted reason values

The following values are accepted in the reason field. They are normalized by the gateway and mapped to the correct format for each processor.

ValueMeaning
customer_requestCardholder requested the refund directly (e.g. order cancellation).
duplicateThe transaction was charged more than once for the same order.
fraudThe transaction was identified as fraudulent or the cardholder did not authorize it.
returnCardholder returned goods or cancelled a service after delivery.
otherAny reason not covered above.

If reason is omitted or the processor does not accept reason codes, the gateway uses the processor's required default constant internally — no error is returned to the merchant.

Request example

JSON
1{
2  "clientTransactionId": "refund_20260516_0021",
3  "transactionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
4  "amount": 19.99,
5  "reason": "customer_request"
6}

Response

The response fields are identical to Sale — Response.

The response body contains:

FieldTypeRequiredDescription
statusstringrequiredOperation status. See status values below.
transactionIdstringrequiredGateway transaction identifier of the refund operation (new ID).
clientTransactionIdstringrequiredMerchant-side reference echoed from the request.
refundedAmountdecimalrequiredAmount successfully refunded. Present when status is success. Omitted when refund failed
refundedCurrencystringrequiredCurrency of the refunded amount (ISO 4217). Present when status is success. Omitted when refund failed
codestringrequiredGateway result code. 00 on success. See Response codes.
messagestringrequiredHuman-readable description of the result.

Example

JSON
1{
2  "status": "success",
3  "transactionId": "a5f8c2e1-1234-4cde-9876-fedcba987654",
4  "clientTransactionId": "refund_20260516_0021",
5  "refundedAmount": 19.99,
6  "refundedCurrency": "USD",
7  "code": "00",
8  "message": "Refund approved"
9}

Refund rejected:

JSON
1{
2  "status": "failed",
3  "transactionId": "b6a9d3f2-5678-4efg-1234-abcdef012345",
4  "clientTransactionId": "refund_20260516_0021",
5  "code": "51",
6  "message": "Refund not allowed: open dispute on this transaction"
7}

Constraints

Response codes

Reference for all codes returned by the Paysation API. Four independent surfaces:

1. HTTP status codes

All responses are returned as JSON encoded in UTF-8.

StatusMeaningResponse body
201ProcessedThe request was processed. Check status and code in the response body for the actual outcome (success, declined, pending, etc.).
202Action Required3DS step required. Redirect the customer to threeDS.redirectUrl to complete fingerprint or challenge. Await the final result via webhook.
400Bad Request{ "code": "4x", "message": "..." } — Authorization header is missing or empty, or request validation failed (field missing, invalid value, or malformed JSON). See Request validation codes.
401Unauthorized{ "message": "..." } — Authorization header is present but authentication failed (invalid key, revoked, wrong mode, or other credential error). Details are available in the audit log only.
403Forbidden{ "message": "..." } — valid credentials but insufficient permissions.
404Not Found{ "message": "..." } — endpoint or resource not found.
422Unprocessable Entity{ "code": "5x", "message": "..." } — request is structurally valid but cannot be processed due to token or transaction state. See Token errors and Transaction state codes.
429Too Many Requests{ "message": "..." } — rate limit exceeded.
500Internal Server Error{ "code": "3x", "message": "..." } — technical or connection error on the gateway or processor side. See Technical and connection codes.

201 means the request reached the gateway and was processed. The actual payment outcome is always in the response body — check status and code. 202 is returned only when the customer must complete a 3DS step (fingerprint or challenge). It is never returned for other async operations.

2. status values

ValueDescriptionAction
successOperation approved and completed.
pendingGateway is awaiting a response from PSP, ACS, or batch processor. Final result delivered via webhook.Await webhook or poll GET /transaction/{id}.
authorizedFunds reserved. No capture yet.Call /settle or /void.
failedOperation declined or failed. Covers issuer declines, technical errors, validation failures, and unresolvable ambiguous outcomes.Read code and message.

3. code and message values

All codes below are returned inside the JSON response body alongside code and message fields.

code: "00" indicates success and is returned alongside status: success.

The HTTP status that accompanies each code group is noted in each section header.

Success · HTTP 201

CodeMessageDescription
00ApprovedOperation completed successfully.

General issuer declines

CodeMessageDescription
01General declineThe card-issuing bank did not complete the transaction. No specific reason provided.
02Do not honorGeneric issuer decline. Do not retry automatically.
03Retry laterTemporary problem with the card or account. May be retried after a short wait.
04Re-enter transactionGeneral decline; source of error unclear. Retry with the same parameters.

Card validation

CodeMessageDescription
05Invalid CVV2 codeThe CVV/CVC code is incorrect.
06CVV attempts exceededToo many incorrect CVV attempts. Card temporarily locked — cardholder must contact their bank.
07Invalid card numberCard number fails validation or does not exist. Do not retry with the same number.
08Expired cardCard expiration date is invalid or has passed.
09Invalid currencyCurrency not supported on the active MID.

Transaction declines

CodeMessageDescription
10Blocked first useFirst online payment on a newly issued card. Cardholder must unblock it via their bank app.
11Insufficient fundsAccount balance is too low.
12Card amount limit exceededExceeds card-level amount limit (per-transaction or period).
13Frequency limit exceededToo many transactions in a short period.
14Refer to card issuerIssuer decline without explanation — cardholder must call their bank.
15Transaction not permitted to cardholderThis transaction type is not allowed for this card.
16Card brand not supportedCard brand not supported on the active MID.
17Issuer not availableIssuer temporarily unavailable. Retry after a short wait.
18Transaction not allowed at terminalRejected by processor due to MID configuration.
19Merchant velocity limit exceededTransaction velocity is outside processor limits (unrelated to card limits).
20Account closedCardholder account permanently closed.
21Invalid merchantTransaction rejected due to merchant MCC or configuration. Contact support.
22Revocation of all authorizationsCardholder cancelled all recurring payments on this card. Do not retry.
23Permanent blockCard is on issuer permanent block list. Do not retry.

Fraud and anti-fraud

CodeMessageDescription
24Lost or stolen cardCard reported lost or stolen.
25Restricted cardCard restricted by issuer (BIN restriction, regional embargo, etc.).
26Suspected fraudTransaction flagged by the issuing bank as suspicious.
27Blocked by anti-fraud systemBlocked by the gateway anti-fraud system. Contact support if you believe this is a false positive.

3DS and authentication

CodeMessageDescription
28Card authentication failedCardholder failed or abandoned 3DS (wrong OTP, biometric failure, or challenge timeout).
29Card not 3DS enrolledCard does not support 3DS. Fall back to 2D if policy allows.
30Unexpected 3DS errorTechnical error during 3DS not caused by the cardholder (ACS timeout, protocol error).
31Additional authentication requiredSCA / PSD2 requires 3DS. Retry using the 3DS flow.
323DS rejected by issuerACS returned R — issuer explicitly rejected authentication and requests that authorization not be attempted. Do not retry.
333DS session expiredCardholder did not complete the 3DS redirect within the allowed time. Ask the cardholder to retry from the beginning.

Merchant configuration

CodeMessageDescription
39Merchant not configured correctlyProcessing error due to incorrect merchant or MID configuration. Contact support.
60Feature not enabled for this account: \<feature>The requested payment method or flow is not enabled for this account. \<feature> specifies what is disabled: apple_pay, google_pay, recurring, mit, 3ds, void, refund, etc. Contact support to enable it.

Request validation · HTTP 400

Returned when the request body is structurally invalid — a required field is missing, a field value does not pass format validation, or the body is not valid JSON.

CodeMessage (example)Description
40Missing required field: amountA required request field is absent. message names the missing field.
41Invalid value: \<field> \<reason>A field contains an invalid value or format, or the request body is not valid JSON. message specifies the field and reason. Possible messages: Invalid value: currency must be ISO 4217, Invalid value: amount must be greater than 0, Invalid value: eci must be one of 05, 02, 06, 01, Invalid value: authenticationStatus must be Y or A, Invalid value: version must match format 2.x.x, Invalid value: country must be ISO 3166-1 alpha-2, Invalid value: expiry month must be between 01 and 12, Invalid JSON format.
42Duplicate clientTransactionIdA transaction with this clientTransactionId already exists. Use a unique value per request.

Token errors · HTTP 422

Returned when the token in the request is not usable. The request was valid but cannot be processed because the referenced token does not exist, has expired, or has already been consumed.

CodeMessageDescription
56Invalid tokenThe provided paymentToken does not exist or does not belong to this account.
57Token expiredThe paymentToken has passed its expiry time and can no longer be used. A new token must be obtained via a fresh Sale.
58Token already usedThe paymentToken is single-use and has already been consumed. Request a new token.

Transaction state · HTTP 422

Returned when the operation is structurally valid but the referenced transaction is in a state that does not permit the requested action.

CodeMessage (example)Description
50Transaction not foundNo transaction found for the provided transactionId.
51Operation not permitted: \<reason>The requested operation is not allowed in the current transaction state. Possible \<reason> values: transaction already settled, transaction already voided, transaction already fully refunded, void not allowed after capture, authorization hold has expired, refund time limit exceeded, refund not allowed: open dispute on this transaction.
52\<reason>The requested amount exceeds what is available for the operation. Possible messages: Settle amount exceeds authorized amount, Refund amount exceeds settled amount, Refund amount exceeds remaining refundable amount.

Technical and connection · HTTP 500

Returned when a server-side or processor-side failure occurred. The request was valid and reached the gateway, but processing could not be completed due to an infrastructure or connectivity issue. Safe to retry after a short wait.

CodeMessageDescription
37Application errorUnexpected server-side error during processing. Retry after a short wait.
38Connection errorConnection failure between the gateway and the processor. Retry after a short wait.

4. bankDeclineCode

Raw decline code passed through from the card scheme (Visa, Mastercard, American Express, Discover). Present only when the charge was submitted to the scheme and the issuer returned a decline code.

The meaning of the same numeric code differs by scheme. Always consider the card brand when interpreting this field. Use code and message for normalized, scheme-agnostic decline reasons.

Visa

CodeDescription
1Refer to card issuer
2Refer to card issuer, special condition
3Invalid merchant
4Pick up card (no fraud)
5Do not honor
6Error
7Pick up card, special condition (fraud account)
10Partial approval
11Approved (V.I.P)
12Invalid transaction
13Invalid amount or currency conversion field overflow
14Invalid account number (no such number)
15No such issuer
19Re-enter transaction
21No action taken
25Unable to locate record in file
28File temporarily not available for update or inquiry
39No credit account
41Lost card, pick up (fraud account)
43Stolen card, pick up (fraud account)
46Closed account
51Not sufficient funds
52No checking account
53No savings account
54Expired card or expiration date is missing
55Incorrect PIN or PIN missing
57Transaction not permitted to cardholder
58Transaction not allowed at terminal
59Suspected fraud
61Exceeds approval amount limit
62Restricted card (card invalid in this region or country)
63Security violation (source is not correct issuer)
64Transaction does not fulfill AML requirement
65Exceeds withdrawal frequency limit
70PIN data required
74Different value than that used for PIN encryption errors
75Allowable number of PIN entry tries exceeded
76Unsolicited reversal
78Blocked, first used — transaction from new cardholder, card not properly unblocked
79Already reversed (by Switch)
80No financial impact
81Cryptographic error found in PIN
82Negative CAM, dCVV, iCVV, or CVV results
85No reason to decline a request for address verification, CVV2 verification, or a credit voucher or merchandise return
86Cannot verify PIN
89Ineligible to receive financial position information
91Issuer or switch inoperative; STIP not applicable or not available
92Financial institution or intermediate network facility cannot be found for routing
93Transaction cannot be completed — violation of law
1AAdditional customer authentication required
B1Surcharge amount not permitted on Visa cards or EBT food stamps (U.S. acquirers only)
B2Surcharge amount not supported by debit network issuer
N0Force STIP
N3Cash service not available
N4Cash request exceeds issuer or approved limit
N5Ineligible for resubmission
N7Decline for CVV2 failure
N8Transaction amount exceeds preauthorized approval amount
P5Denied PIN unblock — PIN change or unblock request declined by issuer
P6Denied PIN change — requested PIN unsafe
Q1Card authentication failed
R0Stop Payment Order
R2Transaction does not qualify for Visa PIN
R3Revocation of all authorizations order
Z3Unable to go online; offline-declined

Mastercard

CodeDescription
1Refer to card issuer
3Invalid merchant
4Capture card
5Do not honor
8Honor with ID
10Partial Approval
12Invalid transaction
13Invalid amount
14Invalid card number
15Invalid issuer
30Format error
41Lost card
43Stolen card
46Closed account
51Insufficient funds / over credit limit
54Expired card
55Invalid PIN
57Transaction not permitted to issuer/cardholder
58Transaction not permitted to acquirer/terminal
61Exceeds withdrawal amount limit
62Restricted card
63Security violation
65Exceeds withdrawal count limit
70Contact Card Issuer
71PIN Not Changed
75Allowable number of PIN tries exceeded
76Invalid/nonexistent “To Account” specified
77Invalid/nonexistent “From Account” specified
78Invalid/nonexistent account specified (general)
79Life cycle (Mastercard use only)
80System not available
81Domestic Debit Transaction Not Allowed (Regional use only)
82Policy (Mastercard use only)
83Fraud/Security (Mastercard use only)
84Invalid Authorization Life Cycle
85Not declined
86PIN Validation not possible
87Purchase Amount Only, No Cash Back Allowed
88Cryptographic failure
89Unacceptable PIN — Transaction Declined — Retry
90Cutoff is in progress
91Authorization System or issuer system inoperative
92Unable to route transaction
94Duplication transaction detected
96System error
1ZAuthorization System or issuer system inoperative

American Express

CodeDescription
01Refer to card issuer
03Invalid merchant
04Deny — pick up card
05Deny
06Error
10Partial approval
13Invalid amount
14Invalid account number
25Unable to locate
30Format error
38PIN exceeded
54Expired card
55Invalid PIN
56No card record
57Transaction not permitted to issuer/cardholder
58Not permitted to acquirer/terminal
78Invalid account
85Issuer has no reason to decline the transaction
91Issuer not available
96System error
1AAdditional customer authentication required
DARequired fleet prompts invalid or missing
E2AVS data required
E3CVV2 data required
E4Service not allowed
E5Service not allowed
E6Service not allowed
E7Terminal ID error
E9No reply from network
EAAccount length error
EBCheck digit error
ECCID format error
EDAuthorization is too old for capture
EECard product blocked
EFBRIC on PIN transaction not allowed
EHInvalid card entry method
EIInvalid card ID
EJNo PIN block
EKPinless routing not allowed
ELBRIC storage failed
EMDebit swipe only
ENBRIC response timeout
EOCVV2 mismatch
EQNetwork gateway not available
ESTransaction not allowed due to failure of internal validations
ETEMV data is required for card entry method
EUThe network rejected the item
EVItem already captured
EWFailed regex validation
EXCheck number required
EYContactless MSD not allowed — dip card
N6Decline
N7Invalid card (CID) security code
NRNo valid debit network available to route
RRInvalid data in request — contact support if issue cannot be determined
S4PIN block translation error
S5Unable to locate a matching original purchase transaction
S7Unable to locate a matching original purchase transaction
S9TLV tags invalid

Discover

CodeDescription
01Refer to card issuer
03Invalid merchant
04Capture card
05Do not honor
06Error
07Pick-up card, special condition
08Honor with ID
10Approved partial
12Invalid transaction
13Invalid amount
14Invalid account number
15Invalid issuer
19Re-enter transaction
21No action taken
30Format error
31Bank not supported by switch
33Expired card
34Suspected fraud
35Card acceptor contact acquirer
36Restricted card
37Call — security
38Allowable PIN tries exceeded
39No credit account
40Requested function not supported
41Lost card
43Stolen card
51Decline
53No savings account
54Expired card
55Invalid PIN
56No card record
57Transaction not permitted to issuer/cardholder
58Not permitted to acquirer/terminal
59Suspected fraud
60Card acceptor error
61Exceeds withdrawal amount limit
62Restricted card
63Security violation
64Original amount incorrect
65Exceeds withdrawal count limit
67Hard capture — call
68Response received too late
75Allowable number of PIN tries exceeded
77Invalid/nonexistent account specified
78Invalid/nonexistent account specified (general)
85Issuer has no reason to decline the transaction
87Network unavailable
91Authorization system or issuer system inoperative
92Unable to route transaction
93Decline
94Duplicate transmission detected
96System error
1AAdditional customer authentication required
DARequired fleet prompts invalid or missing
E2AVS data required
E3CVV2 data required
E4Service not allowed
E5Service not allowed
E6Service not allowed
E7Terminal ID error
E9No reply from network
EACheck digit error
EBCheck digit error
ECCID format error
EDAuthorization is too old for capture
EECard product blocked
EFBRIC on PIN transaction not allowed
EHInvalid card entry method
EIInvalid card ID
EJNo PIN block
EKPinless routing not allowed
ELBRIC storage failed
EMDebit swipe only
ENBRIC response timeout
EOCVV2 mismatch
EQNetwork gateway not available
ESTransaction not allowed due to failure of internal validations
ETEMV data is required
EUThe network rejected the item
EVItem already captured
EWFailed regex validation
EXCheck number required
EYContactless MSD not allowed — dip card
N6Decline
N7CVV2/AVS failure
NRNo valid debit network available to route
RRInvalid data in request — contact support if issue cannot be determined
S4PIN block translation error
S5Unable to locate a matching original purchase transaction
S7Unable to locate a matching original purchase transaction
S8Unable to locate a matching authorization
S9TLV tags invalid