Authorization
This endpoint is used to authorize a payment transaction. It requires a JSON payload containing transaction details, order information, and point-of-sale (POS) data.
The URL for this endpoint is https://api.firstoken.co/v1/payments
In case of sandbox environment you should use this URL: https://api.firstoken-staging.co/v1/payments
Request Headers
Content-Type:
application/json
x-api-key:
<Your API Key>
transaction_info {object}
type Type of transaction. Possible values:
authorization
.reference_code Unique reference code for the transaction.
order_info {object}
amount_details {object}
total_amount Total amount to be authorized.
currency Currency code (e.g.,
MXN
for Mexican Peso).
pos {object}
entry_mode Method of entering payment card information into the POS terminal. Possible values:
contact
: Read directly from the chip card via contact.contactless
: Read from a contactless interface using chip data.keyed
: Manually entered into the POS terminal.msd
: Read from a contactless interface using magnetic stripe data (MSD).swiped
: Read from the magnetic stripe of the credit card.
Note: The values
contact
,contactless
, andmsd
are compatible only for EMV transactions.term_capability POS terminal capability. Possible values:
1
: The terminal has only a magnetic stripe reader.2
: The terminal has a magnetic stripe reader and manual input capability.3
: The terminal has only manual input capability.4
: The terminal can read chip cards.5
: The terminal can read chip cards contactlessly; cannot use contact to read chip cards.
Note: For an EMV transaction, the value of this field must be
4
or5
.cat_level Card acceptance terminal (CAT) level.
Possible values:
1
: Automated dispensing machine2
: Self-service terminal3
: Limited amount terminal4
: In-flight commerce (IFC) terminal5
: Radio frequency device6
: Mobile acceptance terminal7
: Electronic cash register8
: E-commerce device at your location9
: Terminal or cash register that uses a dialup connection to connect to the transaction processing network
emv {object}
tags EMV tags.
verification_method EMV verification method.
sequence_number Sequence number for the transaction.
track_data Track data from the card.
verification_method Complete list of cardholder verification methods (CVM) supported by the terminal.
Possible Values:
PIN
: For terminals with a PIN keypad.Signature
: For terminals capable of receiving a signature.pinOnGlass
: For terminals where the PIN is entered on a glass-based capture mechanism.
Example:
["PIN", "Signature"]
term_input_capability List of terminal input capabilities supported by the terminal.
Possible Values:
Keyed
: The terminal can accept card data entered manually.Swiped
: The terminal can accept card data from a magnetic stripe reader.Contact
: The terminal can accept card data in contact mode EMV (card insertion).Contactless
: The terminal can accept card data in contactless mode EMV (card tap).BarCode
: The terminal can read barcodes.QRcode
: The terminal can read or scan QR codes.OCR
: The terminal can perform optical character recognition (OCR) on the card.
Example:
["Keyed", "Swiped", "Contact", "Contactless"]
term_card_capture_capability Indicates whether the terminal can capture the card.
Possible Values:
1
: The terminal can capture the card.0
: The terminal cannot capture the card.
device_id Unique value created by the client software to identify the POS device.
encrypted_key_serial_number Combination of the unique device identifier and a transaction counter used in the process of decrypting the encrypted PIN. The entity that injected the PIN encryption keys into the terminal decrypts the encrypted PIN and creates this value
Request Body
The request body should be a JSON object with the following structure:
Response
The response will be a JSON object with the following structure:
Error Handling
In case of an error, the response will have a status
of fail
and a descriptive message
. The data
object provides more details about the specific issues encountered.
Last updated
Was this helpful?