Authorization2

Learn how to handle authorization requests.

The Authorization request is made when the customer makes a purchase or pays for a service with a card. It handles pre-authorization and capture in one interface. Once the authorization request is sent to the Payment Gateway, the credit card data and the credit line is verified and the cardholder is charged immediately.

🚧

The authorization flow for cards includes 3DSecure check by default. Contact your Client Relations manager or Technical support for specific rules for your account.

Endpoint

POST https://sandbox.payabl.com/pay/backoffice/payment_authorize

3Ds flow

-> POST Request to /payment_authorize
<- Response (synchronous) with status=2000 (pending) and URL for 3DS redirect

Redirect Customer to to 3DS URL
Customer completes 3D-Secure process
Customer is redirected to Return URL

<- HTML Response with a final status (success or decline) and 3DS related information

<- Callback (asynchronous) with a final status (success or decline) to notification_url

Non-3Ds flow

-> POST Request to /payment_authorize (add param_3d=non3d to your request to avoid 3DS)
<- Response (direct, synchronous) with a final status (success or decline)
Optional <- Callback (asynchronous) with a final status (success or decline) to notification_url

📘

We don't send callbacks for non-3DS transactions by default. Please contact our Technical support team if you wish to receive them.

For additional information on 3DSecure flow, please refer to 3DSecure Transactions section.


Step 1. Send request

Include in your POST request mandatory parameters listed below. You can see a full list of parameters in Authorization API reference.

For Sandbox environment use these Testing Credentials for Credit Cards

ParameterFormatDescription
merchantid40 charactersMerchant identification number assigned during account creation
orderidmax. 40 charactersThe field orderid is optional and exclusively for the merchants' convenience
amountdigits only, either no decimals or two decimal places (e.g. 8 or 8.50)Transaction’s total amount that will be deducted from the customer
currency3 characters. ISO 4217The currency field contains the alpha-3 currency code for the transaction. Links to ISO
payment_method1 for credit cardspayabl. Payment methods IDs
signature40 charactersSignature Calculation2
ccn16-18 digitsCustomer's credit card number
exp_month2 digitsCard expiry month
exp_year4 digitsCard expiry year
cvc_code3 digitsCard CVV/CVC code
cardholder_namemax. 50 charactersCardholder name
emailmax 50 charactersCustomer email. An RFC 822 compliant email address
customeripmax. 39 charactersCustomer IP address
country3 characters. ISO 3166 alpha3 formatCountry of customer. Links to ISO
citymax. 100 charactersThe customer's city
zipmax. 10 charactersThe customer's postal code
streetmax. 100 charactersStreet of the customer's address
url_returnmax. 255 characters starting with http or httpsURL for customer redirection
shop_urlmax. 255 characters starting with http or httpsURL of the website from which request is sent (applied if several domains are used for 1 account)

Request example:

merchantid=gateway_test&orderid=Payabl-Test&amount=19.99&currency=EUR&payment_method=1&language=en&
customerip=93.109.250.238&[email protected]&firstname=John&lastname=Doe&zip=3035&street=Olympion&house=23&
city=Limassol&country=CYP&ccn=4012001036298889&exp_month=07&exp_year=2028&cvc_code=924&cardholder_name=John Doe&
param_3d=try3d&url_return=https://yourshop.example/thank_you&notification_url=https://yourshop.example/notification&
signature=b94ef6f6e4915b583d4997aabaa05503f8d50123

🚧

Public Sandbox information

Do not use your personal email address, Order ID with sensitive information, real customer details and credit card data in the public Sandbox. For email field you may use [email protected].

Step 2. 3D Secure

payabl. will send a response with url_3ds parameter. The status of the transaction will be pending errorcode=2000.

You need to decode it and redirect the customer. Then client will need to provide PIN/passphrase to their bank/customer’s credit card institution for transaction verification.

Response example:

transactionid=104837274&transid=104837274&status=2000&errormessage=pending&errmsg=pending&amount=19.99&price=19.99&
currency=EUR&orderid=Payabl-Test&user_id=466838&url_3ds=https%3A%2F%2Fpay4.sandbox.payabl.com%2F3dss%2Ftest%2Fv1%2F269
3191992fb30b88ae5d6348293b326%2Fredirect

Response fields reference:

ParameterDescription
transactionidpayabl. internal transaction id. Please use this transaction id when referring to the transaction in communications with the payabl. team
transidThe same as transactionid
statusTransaction error code
errormessageBrief explanation of transaction decline reason (empty on success)
errmsgThe same as errormessage
amountTransaction amount
priceThe same as amount
currencyTransaction currency
orderidOptional transaction identifier given by the merchant
url_3dsURL for customer redirection to finalize the payment (URL encoded)
user_idPayment system user identifier

Step 3. Capture response

When the 3DSecure process is complete. payabl. sends a response with a final status:

  1. HTML response (for a decline) to your side which can be displayed on your return URL.

Response example:

orderid=Payabl-Test&transactionid=105226632&errorcode=-10001&errormessage=3DSecure+verification+failed+or+incomplete&3dProtocolVersion=2.2.0&
3dauthentication_flow=frictionless_flow&3dauthentication_status=R&3dcardholderInformation=Your+cart+requires+additional+verification+contact+your+bank&
3dtransactionStatusReason=12&3dtransactionStatusReasonMessage=Transaction+not+permitted+to+cardholder&type=order&
security=deface93c42747c7ab84e43de5353bfcd8eed4d6

📘

Additional 3DS error information on your Result page

You should include value from the field 3dcardholderInformation to your Return URL page in order to provide more details to your cardholder. This field shows a response directly from the issue on further authentication steps.
The field 3dcardholderInformation is present only in case an Issuer provides this info.

  1. Callback with the security parameter, which you will need to use in order to verify the authenticity of the notification. Signature Calculation.

Callback example: (for success)

errormessage=&type=capture&timestamp=1686139119&3dauthentication_status=Y&orderid=Payabl-Test&3dProtocolVersion=2.2.0&
transactionid=105226633&errorcode=0&3dauthentication_flow=challenge_flow&security=ff8cbf8212b71d918e37076d3452dcd0858f
c177def01fbf3565d8d8d19a7cb9

HTML response/Notification fields reference:

ParameterDescription
transactionidpayabl. internal transaction id. Please use this transaction id when referring to the transaction in communications with the payabl. team
typeTransaction type
errorcodeTransaction error code (0 for success)
errormessageBrief explanation of transaction decline reason (empty on success)
orderidOptional transaction identifier given by the merchant
securitySignature to verify the authenticity of the notification. You can find more information here
timestampNotification timestamp
3dProtocolVersion3DS protocol version (will be 2.2.0 in most cases until further notice)
3dauthentication_status3DS authentication status (possible values: Y, A, N, U, R)
3dauthentication_flow3DS authentication flow (e.g. frictionless_flow)
3dcardholderInformationOnly added on declined transactions to provide additional explanations to the customer. Present if bank sends it.

You may find a full list of decline reasons in the annex.

As mentioned above, for non-3DS transactions there will be only server response.

Server response example: (for non-3DS)

transactionid=105226636&transid=105226636&status=0&errormessage=&errmsg=&amount=19.99&price=19.99&currency=EUR&
orderid=Payabl-Test&user_id=466838

Server Response fields reference: (for non-3DS):

ParameterDescription
transactionidpayabl. internal transaction id. Please use this transaction id when referring to the transaction in communications with the payabl. team
transidThe same as transactionid
statusTransaction error code
errormessageBrief explanation of transaction decline reason (empty on success)
errmsgThe same as errormessage
amountTransaction amount
priceThe same as amount
currencyTransaction currency
orderidOptional transaction identifier given by the merchant
user_idPayment system user identifier

Additional response and Callback parameters

Additional parameters maybe added to payabl. responses and notifications. Please contact Technical support to update your response settings.

The parameters below will provide more data on transaction details. They can be added to both responses and notifications:

ParameterDescription
binCustomer bank BIN
bin_countryCustomer BIN country
payment_methodpayabl. payment method ID
ccn_fourLast 4 digits of customer credit card number
card_typeCustomer card brand - also possible to include specific card type and credit/debit (example VISA INFINITE DEBIT)
cardholderCardholder name
expiry_monthCard expiry month
expiry_yearCard expiry month
amountTransaction amount
currencyTransaction currency

Callback with additional parameters example:

orderid=Payabl-Test&bin_country=DEU&bin=414901&3dProtocolVersion=2.2.0&errorcode=0&3dauthentication_status=Y&3dauthentication_flow=challenge_flow&
ccn_four=0147&transactionid=105226638&payment_method=1&type=capture&card_type=VISA&cardholder=JOHN+DOE&errormessage=&timestamp=1686140177&
security=ab680be69c2dd763285654ed6dcc0a0894b0210619f3e76f6a8895a953ab3bed

Response with additional parameters example: (for non-3DS)

transactionid=105095226&transid=105095226&status=0&errormessage=&errmsg=&amount=19.99&price=19.99&currency=EUR&orderid=Payabl-Test&
bin=401200&payment_method=1&ccn_four=8889&card_type=VISA&cardholder=JOHN%20DOE&expiry_month=12&expiry_year=2026&amount=19.99&
currency=EUR&bin_country=RUS&user_id=466838

Our Technical Support team is there to help you:
Email: [email protected]
Available Monday – Friday between 09:00 and 17:00 CET/CEST