Skip to main content

API

Authorization

Cashier uses JWT tokens for authorization. The tokens are signed using the HS256 algorithm, with the Merchant API User Secret serving as the signing key.

The generated JWT token must be sent with every request in the Authorization header using the Bearer scheme.

Example:

Authorization: Bearer <jwt_token>

Token payload parameters:

NameTypeSize/FormatDescription
expstringtimestampExpiration date. Example: 1738771955
user_uuidstringUUID, Chars (36)Merchant API User identifier

Example:

To generate your unique token, you can enter your data in JSON format into JWT token online generator like: https://jwt.io/

Please see the table below on how to correctly fill the fields in the token generator.

FieldValue
HEADER:{ "alg": "HS256", "typ": "JWT" }
PAYLOAD:{ "user_uuid": "f27cae21-02f3-4215-a5c7-c0746ff9e421", "exp": 1738771955 }
JWT SECRET:Paste your Merchant API User Secret. Example: 123457890123456789012345678901234567890

Resulting JWT:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3V1aWQiOiJmMjdjYWUyMS0wMmYzLTQyMTUtYTVjNy1jMDc0NmZmOWU0MjEiLCJleHAiOjE3Mzg3NzE5NTV9.2oLsmmmT-hVeoWrU9vMODHrpmJdlibSCJRybcC2XbFY

Payment init endpoint

This endpoint is used to initiate new payments on the Cashier side. A successful response will return a redirect link that your customer should follow to be taken to the Cashier Hosted Payment Page.

URL: {api_url}/business-api/v1/intent/init

HTTP Method: POST

Headers:

  • Content-type: application/json
  • Authorization: API JWT bearer token.

Request object description:

NameTypeSize/FormatMandatoryDescription
customerObjecttruePlease refer to Customer object (link to customer object description)
notification_urlstringChar (256) Format: only latin charstrueURL for transaction status notification
origin_transaction_id stringChar (50)falseTransaction ID in merchant's system
langstringChar (2) Format: ISO 639-1 Code (wiki).falseOne of Deposit Page supported language requested by merchant. Default: en
sourcestringPossible values: "WEB", "MOBILE_APP", "MOBILE_WEB"falseSource from Deposit page is requested
gtmstringChar (11)falseGTM Identifier (Google Tag Manager Identifier) to be sent within notification to CRM
variable1stringChar (256)falseCustom variable forwarded from Deposit page to Merchant system via Notifications Webhooks
variable2stringChar (256)falseCustom variable forwarded from Deposit page to Merchant system via Notifications Webhooks
variable3stringChar (256)falseCustom variable forwarded from Deposit page to Merchant system via Notifications Webhooks

Customer object description:

NameTypeSize/FormatMandatoryDescription
idstringChar (100)trueCustomer unique identifier from Merchant system
countrystringISO 2 digits country code: wikitrueCustomer country code
emailstringChar (50). Format: emailtrueCustomer email
full_phone_numberstringChar (50). Format: international phone number format E.164 (link)trueFull phone number
first_namestringChar (50)trueCustomer’s first name
last_namestringChar (50)trueCustomer’s last name
currencystringCurrency ISO Code: wikitrueCustomer trading account currency
addressstringChar (100)falseCustomer address
citystringChar (50)falseCustomer city
postal_codestringChar (20)falseCustomer postal code
is_depositorbooleanfalsetrue - customer has deposits; false - customer doesn't have deposits
affiliate_namestringChar (100)falseCustomer's affiliate name
balancestringChar (20)falseCustomer trading account balance in minor units (wiki)
assigned_to_department_tree_pathstringChar (100)falseDefinition of the department/team associated with the transaction
trading_account_idstringChar (50)falseTrading Account unique identifier of the Customer from Merchant system
documentsArray[]falseArray of Document objects

Document object description:

NameTypeSize/FormatMandatoryDescription
typestringFor now, only valid value is TAX_IDtrueType of document
numberstringChar (50)trueDocument number
countrystringISO 2 digits country code: wikitrueDocument country code

Response object description:

NameTypeDescription
redirect_urlstringRedirect URL which merchant customer should follow to get to Cashier Payment Page

Request example:

curl -X 'POST' \
'https://{api_url}/business-api/v1/intent/init' \
-H 'accept: application/json' \
-H 'Authorization: Bearer {jwt_token}\
-H 'Content-Type: application/json' \
-d '{
"customer": {
"id": "42",
"country": "UA",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"full_phone_number": "+442073238000",
"currency": "USD",
"city": "Kyiv",
"address": "123 Main St",
"postal_code": "01001",
"is_depositor": true,
"affiliate_name": "Affiliate name",
"balance": "1000",
"assigned_to_department_tree_path": "Dev/Team1",
"trading_account_id": "123456789",
"documents": [
{
"type": "TAX_ID",
"number": "AB123456",
"country": "UA"
}
]
},
"notification_url": "https://example.com/notification",
"origin_transaction_id": "123456789",
"lang": "en",
"source": "WEB",
"gtm": "GTM-ABCDEF",
"variable1": "variable1",
"variable2": "variable2",
"variable3": "variable3"
}'

Success response (status 200) example:

{
"redirect_url": "https://example.com/brand/index.htmljwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X3V1aWQiOiJkOWFjNjA4ZC04Y2VhLTQ0MzAtODFlOS05MDFhYzE4OTcwZTEiLCJjdXN0b21lcklkIjoiMSIsImJyYW5kIjoic29tZWJyYW5kIiwiZXhwIjoxNzQzMDg2MDUxfQ.GG6hY6tAXSvEDrBknGDsJHK-Kfmp-_zhy9KFNiqOudU&lang=en&source=WEB&gtm=GTM-ABCDEF&variable1=variable1&variable2=variable2&variable3=variable3"
}

Validation error response (status 422) example:

[
{
"code": "VALIDATION_ERROR",
"message": "This value should not be blank.",
"context": {
"propertyPath": "customer.id"
}
}
]

Internal error response (status 500) example:

[
{
"code": "INTERNAL_ERROR",
"message": "Internal error"
}
]

Refund endpoint

Initiates a refund process for a completed transaction.

URL: {api_url}/business-api/v1/batch-refunds/

HTTP Method: GET

Headers:

  • Content-type: application/json
  • Authorization: API JWT bearer token.

Request fields:

NameTypeSize/FormatMandatoryDescription
refundsArray of JSON objectsArray of Refund request objectstrueList of transaction refund request

Refund request object

NameTypeSize/FormatMandatoryDescription
transaction_idstringtrueCashier360 PSP/APM Transaction UUID
origin_transaction_idstringfalseMerchant`s refund transaction ID
moneyMoneyMoney objecttrueMoney object in the customer's account original currency
converted_moneyMoneyMoney objectfalseMoney object in the payment provider's currency

Money object

NameTypeSize/FormatMandatoryDescription
amountintIn minor units: wikitrueMoney amount
currencystringISO currency code: wikitrueMoney currency

Request example:

curl -X 'POST' \
'https://{api_url}/api/gateway/business-api/v1/batch-refunds/' \
-H 'accept: application/json' \
-H 'Authorization: Bearer {jwt_token}\
-H 'Content-Type: application/json' \
-d '{
"refunds": [
{
"transaction_id": "14f80a6f-7ad3-42f4-b036-6e535b2943db",
"origin_transaction_id": "123456",
"money": {
"amount": 110,
"currency": "USD"
},
"converted_money": {
"amount": 110,
"currency": "USD"
}
}
]
}'

Success response (status 200) example:

{
"status": "ACCEPTED"
}

Validation error response (status 422) example:

[
{
"code": "VALIDATION_ERROR",
"message": "This value should not be blank.",
"context": {
"propertyPath": "transaction_id"
}
}
]

Internal error response (status 500) example:

[
{
"code": "INTERNAL_ERROR",
"message": "Internal error"
}
]