Skip to Content
Docs
Authentication sessions

Create a linked authentication session

POST/sessions/authentication/linked

Creates a 3D Secure authentication session linked to an existing charge, hold, or payment method.

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.

  • A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
  • If the first request is still being processed, a retry gets 409 idempotency_error (request_in_progress).
  • The same key on another endpoint, or with another body, gets 400 idempotency_error (invalid_parameters).
  • GET, PUT and PATCH requests ignore the key.

The response repeats the key in its Idempotency-Key header.

Parameters

resourcestringRequired

Unique identifier of the charge, hold, or payment method to authenticate.

return_urlstringRequired

URL to redirect the customer to after authentication completes. Should be an absolute URL.

confirmboolean

Whether to automatically confirm the related transaction after successful authentication.

Default: true

durationinteger

Lifetime of the authentication session, in minutes.

Default: 60

Returns

Returns the authentication session object, with status open, the client_secret and the url to send the customer to.

idstringRequired

Unique identifier for the authentication session.

resourcestringRequired

String representing the object's type.

One of authentication_session.

amountintegerRequired

Amount, in the smallest currency unit.

amount_human_readablestringRequired

Amount in human-readable format.

billing_detailsobject or null
Show 2 child attributesHide child attributes
Option 1object

Billing information for the payment. Fields that were not provided are returned as null.

Show 6 child attributesHide child attributes
addressobject or null

Billing address, if available.

Show 2 child attributesHide child attributes
Option 1object

Address details.

Show 6 child attributesHide child attributes
citystring

City, district, suburb, town, or village.

countrystring

Two-letter country code (ISO 3166-1 alpha-2).

line1string

Address line 1 (for example, street, PO Box, or company name).

line2string or null

Address line 2 (for example, apartment, suite, unit, or building). Responses return null when not set.

postal_codestring

ZIP or postal code.

statestring or null

State, county, province, or region. Null is accepted and returned when not set.

Option 2null
namestring or null

Full name of the billing contact.

emailstring or null

Email address of the billing contact.

phonestring or null

Phone number of the billing contact, if available.

dobstring or null

Date of birth in YYYY-MM-DD format.

national_identification_numberstring or null

National identification number of the billing contact.

Option 2null
chargestring or null

Unique identifier of the Charge linked to this authentication session, for a linked authentication session whose payment succeeded.

currencystringRequired

Three-letter ISO currency code, in lowercase.

createdstring

Time at which the object was created, in ISO 8601 format.

Show 15 more attributesShow fewer attributes
customerstring or null

Unique identifier of the Customer associated with this authentication session, if applicable.

customer_reference_idstring or null

Your unique identifier for the customer, if applicable.

client_secretstring

Client secret (a JWT) used to render the authentication session. Only returned when the session is created. It is also embedded in url.

holdstring or null

Unique identifier of the Hold linked to this authentication session, for a linked authentication session whose payment succeeded.

metadataobject

Set of key-value pairs attached to the object.

payment_methodstring or null

Unique identifier of the Payment Method used in this authentication session, if applicable.

payment_method_detailsobject or null

Details about the payment method used in this authentication session, if applicable.

Show 3 child attributesHide child attributes
typestring

The type of the payment method.

cardobject

Details about the card used for the payment.

Show 21 child attributesHide child attributes
binstring

The first six digits of the card number.

brandstring

The brand of the card.

One of visa, mastercard, amex, discover, unionpay, jcb or diners.

cardholder_currencystring

Three-letter ISO currency code of the cardholder's card, in lowercase.

countrystring

Two-letter ISO code representing the country of the card issuer.

exp_monthstring

Two-digit string representing the card's expiration month.

exp_yearstring

Four-digit string representing the card's expiration year.

fingerprintstring

Unique identifier for this card number, useful for detecting duplicate cards across customers.

fundingstring

The funding type of the card.

One of debit, credit, prepaid or unknown.

last4string

The last four digits of the card number.

networkstring

The card's brand, such as visa. The payment's network data is in underlying_network_details.

categorystring

Card category.

One of consumer or business.

security_checksobject

Results of security checks performed on the card.

Show 3 child attributesHide child attributes
address_line1_checkstring or null

Result of the AVS check for address line 1. Null when the acquirer returned no address result.

One of pass, fail, unavailable or unchecked.

address_postal_code_checkstring or null

Result of the AVS check for postal code. Null when the acquirer returned no address result.

One of pass, fail, unavailable or unchecked.

cvc_checkstring

Result of the CVC check. unchecked when the acquirer returned no result.

One of pass, fail, unavailable or unchecked.

walletobject or null

Details about the digital wallet used, if applicable.

Show 4 child attributesHide child attributes
typestring

Type of the digital wallet. One of googlepay, applepay, or ctp (Click to Pay).

One of googlepay, applepay or ctp.

googlepayobject

Google Pay details. Present when type is googlepay.

Show 2 child attributesHide child attributes
typestring

Google Pay authentication method. One of cryptogram_3ds (tokenized card) or pan_only (card stored in the Google account).

One of cryptogram_3ds or pan_only.

physical_card_last4string

The last four digits of the physical card behind the wallet token, if available.

applepayobject

Apple Pay details, if available.

Show 1 child attributeHide child attributes
physical_card_last4string

The last four digits of the physical card behind the wallet token.

ctpobject

Click to Pay details, if available.

Show 4 child attributesHide child attributes
physical_card_last4string

The last four digits of the physical card.

physical_card_binstring

The BIN of the physical card, if available.

physical_card_exp_monthstring

Expiration month of the physical card, if available.

physical_card_exp_yearstring

Expiration year of the physical card, if available.

tokenstring

Token identifier for the card payment method.

three_d_secureobject or null

Details about the 3D Secure authentication, if the payment used 3D Secure. Null otherwise. Not returned to accounts with the new 3D Secure fields enabled, which receive three_ds instead.

Show 2 child attributesHide child attributes
Option 1object

Populated if this payment used 3D Secure authentication. This is the default format; accounts with the new 3D Secure fields enabled receive three_ds instead.

Show 7 child attributesHide child attributes
authentication_flowstring or null

For authenticated transactions: how the customer was authenticated by the issuing bank, for example challenge or frictionless.

resultstring or null

Outcome of the 3D Secure authentication, for example success, failure or error.

result_reasonstring or null

Reason for the result. One of authenticated, rejected, processing_errors, out_of_scope, high_risk, invalid, network_not_supported, acquirer_not_supported, not_enrolled, unavailable, or unknown, if applicable.

versionstring or null

The version of 3D Secure that was used.

ecistring or null

ECI Indicator from the 3D Secure authentication.

cardholder_infostring or null

Text provided by the ACS/issuer to the cardholder during authentication, if applicable.

liability_shiftboolean

Whether the liability shift was applied.

Option 2null
three_dsobject or null

Details about the 3D Secure authentication in the new fields format, if the payment used 3D Secure. Only returned to accounts with the new 3D Secure fields enabled, instead of three_d_secure.

Show 2 child attributesHide child attributes
Option 1object

Populated if this payment used 3D Secure authentication. Returned as three_ds only for accounts with the new 3D Secure fields enabled; other accounts receive three_d_secure.

Show 14 child attributesHide child attributes
authentication_flowstring

For authenticated transactions: how the customer was authenticated by the issuing bank.

resultstring

Outcome of the 3D Secure authentication, for example success, failure or error.

result_reasonstring

Reason for the result. One of authenticated, rejected, processing_errors, out_of_scope, high_risk, invalid, network_not_supported, acquirer_not_supported, not_enrolled, unavailable, or unknown, if applicable.

status_reasonstring or null

Status reason code from the 3D Secure authentication.

protocol_versionstring

The version of 3D Secure that was used.

ecistring

ECI Indicator from the 3D Secure authentication.

cryptogramstring

Cryptogram from the 3D Secure authentication.

liability_shiftboolean

Whether the liability shift was applied.

cardholder_infostring or null

Text provided by the ACS/issuer to the cardholder during authentication.

acs_transaction_idstring

ACS Transaction ID from the 3D Secure authentication.

three_ds_server_transaction_idstring

3DS Server Transaction ID from the 3D Secure authentication.

ds_transaction_idstring

DS Transaction ID from the 3D Secure authentication.

aresstring

Authentication Response (ARes) from the 3D Secure authentication.

rreqstring

Requestor Response (RReq) from the 3D Secure authentication.

Option 2null
payoutstring or null

Whether the card can receive payouts. One of available or not_available, if known.

One of available or not_available.

name_verificationstring

Result of name verification using ANI (Account Name Inquiry). One of match, partial_match, no_match, not_performed, or not_supported.

One of match, partial_match, no_match, not_performed or not_supported.

partial_approvalobject or null

Details about the partial approval, if the transaction was partially approved. Null otherwise.

Show 2 child attributesHide child attributes
Option 1object

Details about the partial approval, if the transaction was partially approved.

Show 5 child attributesHide child attributes
statusstring

Status of the partial approval:

  • pending: the issuer approved a lower amount, and the payment waits for you to confirm or cancel it.
  • accepted: the lower amount was accepted.
  • canceled: the partial approval was canceled, and the payment wasn't completed.
  • rejected: a partial approval was requested, but the issuer declined the payment for insufficient funds instead. Its amounts are 0.

One of pending, accepted, canceled or rejected.

amount_requestedinteger

Amount requested, in the smallest currency unit.

amount_authorizedinteger

Amount authorized, in the smallest currency unit.

amount_chargedinteger

Amount charged, in the smallest currency unit.

product_idstring

Unique identifier of the product associated with the partial approval.

Option 2null
namestring

The cardholder's name. Only present for specific merchants.

issuerstring

Name of the card issuer. Only present for specific merchants.

referencestring or null

External reference to the payment method, if applicable.

return_urlstring or null

URL to redirect the customer to after the authentication is performed.

shippingobject or null
Show 2 child attributesHide child attributes
Option 1object

Shipping information for the payment.

Show 3 child attributesHide child attributes
addressobject

Address details.

Show 6 child attributesHide child attributes
citystring

City, district, suburb, town, or village.

countrystring

Two-letter country code (ISO 3166-1 alpha-2).

line1string

Address line 1 (for example, street, PO Box, or company name).

line2string or null

Address line 2 (for example, apartment, suite, unit, or building). Responses return null when not set.

postal_codestring

ZIP or postal code.

statestring or null

State, county, province, or region. Null is accepted and returned when not set.

namestring

Full name of the recipient.

phonestring

Phone number of the recipient, preferably in E.164 format. The leading + is optional.

Option 2null
referencestring or null

A string to reference the authentication session, if set.

statusstringRequired

Status of the authentication session. One of open, authenticated, or failed.

One of open, authenticated or failed.

test_modeboolean

Whether the authentication session was created in the sandbox.

urlstring or null

URL to redirect the customer to in order to perform the authentication. It contains the client secret. Null when no client secret was issued.

three_d_secure_detailsobject or null

Result of the 3D Secure authentication (default format, with flow, version and ds_trans_id). Null until the customer is authenticated. Not returned to accounts with the new 3D Secure fields enabled, which receive three_ds instead.

Show 2 child attributesHide child attributes
Option 1object

3D Secure authentication result of an authentication session.

  • In authentication_details.three_ds (standalone sessions) and in three_ds (authentication sessions, for accounts with the new 3D Secure fields enabled), the result uses authentication_flow, protocol_version, ds_transaction_id, acs_transaction_id, three_ds_server_transaction_id, ares and rreq.
  • In three_d_secure_details (authentication sessions, default format), it uses flow, version and ds_trans_id instead.

cavv, xid, eci, cardholder_info and status_reason appear in both formats. Values that are not available are null.

Show 15 child attributesHide child attributes
cavvstring or null

Cardholder Authentication Verification Value (CAVV), the cryptogram returned by the 3D Secure authentication.

xidstring or null

Transaction identifier from 3D Secure 1 authentication, if applicable.

ecistring or null

Electronic Commerce Indicator returned by the authentication, for example 05 or 06.

cardholder_infostring or null

Text provided by the ACS/issuer to the cardholder during authentication, if any.

status_reasonstring or null

Reason code when authentication failed or was not completed, if applicable.

authentication_flowstring or null

Flow performed, for example challenge or frictionless. New format only.

protocol_versionstring or null

3D Secure protocol version used. New format only.

ds_transaction_idstring or null

Directory Server transaction ID. New format only.

acs_transaction_idstring or null

ACS transaction ID. New format only.

three_ds_server_transaction_idstring or null

Transaction ID assigned by the 3DS Server. New format only.

aresstring or null

Raw Authentication Response (ARes) returned by the ACS, as a JSON string. New format only.

rreqstring or null

Raw Results Request (RReq) from the ACS, as a JSON string. New format only.

flowstring or null

Flow performed, for example challenge or frictionless. Default format only.

versionstring or null

3D Secure protocol version used. Default format only.

ds_trans_idstring or null

Directory Server transaction ID. Default format only.

Option 2null
three_dsobject or null

Result of the 3D Secure authentication in the new fields format. Only returned to accounts with the new 3D Secure fields enabled, instead of three_d_secure_details.

Show 2 child attributesHide child attributes
Option 1object

3D Secure authentication result of an authentication session.

  • In authentication_details.three_ds (standalone sessions) and in three_ds (authentication sessions, for accounts with the new 3D Secure fields enabled), the result uses authentication_flow, protocol_version, ds_transaction_id, acs_transaction_id, three_ds_server_transaction_id, ares and rreq.
  • In three_d_secure_details (authentication sessions, default format), it uses flow, version and ds_trans_id instead.

cavv, xid, eci, cardholder_info and status_reason appear in both formats. Values that are not available are null.

Show 15 child attributesHide child attributes
cavvstring or null

Cardholder Authentication Verification Value (CAVV), the cryptogram returned by the 3D Secure authentication.

xidstring or null

Transaction identifier from 3D Secure 1 authentication, if applicable.

ecistring or null

Electronic Commerce Indicator returned by the authentication, for example 05 or 06.

cardholder_infostring or null

Text provided by the ACS/issuer to the cardholder during authentication, if any.

status_reasonstring or null

Reason code when authentication failed or was not completed, if applicable.

authentication_flowstring or null

Flow performed, for example challenge or frictionless. New format only.

protocol_versionstring or null

3D Secure protocol version used. New format only.

ds_transaction_idstring or null

Directory Server transaction ID. New format only.

acs_transaction_idstring or null

ACS transaction ID. New format only.

three_ds_server_transaction_idstring or null

Transaction ID assigned by the 3DS Server. New format only.

aresstring or null

Raw Authentication Response (ARes) returned by the ACS, as a JSON string. New format only.

rreqstring or null

Raw Results Request (RReq) from the ACS, as a JSON string. New format only.

flowstring or null

Flow performed, for example challenge or frictionless. Default format only.

versionstring or null

3D Secure protocol version used. Default format only.

ds_trans_idstring or null

Directory Server transaction ID. Default format only.

Option 2null

Errors

400
Invalid request parameters.
401
The API key or access token is missing, unknown or no longer works (invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).
403
The request was refused: the API key may not make it (for example resource_not_allowed, key_disabled, network_not_allowed, pci_required or merchant_required), or this resource isn't enabled for your account (permission_denied). code says why.
404
Charge, hold, or payment method not found.
409
Another request with the same idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.
500
Internal server error.
503
Service unavailable. Retry after the number of seconds in Retry-After, or after a few seconds when there's none.
Was this page helpful?