Create server session

This method is used to create a server session for BridgerPay's Cashier and generate a unique cashier token.

Request example

POST /v1/cashier/session/create/{{API_KEY}}
Content-Type: application/json
Host: {{API_URL}}
Authorization: Bearer {{ACCESS_TOKEN}}
Accept-Language: en
{
"cashier_key": "{{CASHIER_KEY}}",
"order_id": "g173aa02",
"first_name": "Juan",
"last_name": "Lopez",
"email": "[email protected]",
"language": "en",
"currency": "EUR",
"country": "NL",
"state": null,
"address": "Boenluif 30",
"city": "Hoogwoud",
"zip_code": "1718 AZ",
"direct_payment_method": "credit_card",
"amount": 45.36,
"currency_lock": false,
"amount_lock": false,
"phone": "+311234445566",
"affiliate_id": null,
"tracking_id": null,
"platform_id": null,
"payload": null
}

post
Create Server Session By Merchant API Key

<URL>/v1/cashier/session/create/{{API_KEY}}
This method is used to create a server session for BridgerPay's Cashier with your cashier key (provided by BridgerPay). It generates a unique cashier token for later creating a user session, which in turn will be used to perform some operations, e.g. to make a deposit.
Request
Response
Request
Path Parameters
API_KEY
required
string
Software-level credentials that identify a merchant and ensure secure access to sensitive information; provided by BridgerPay
Headers
Content-Type
required
string
Data format to present information in the response; only "application/json" is supported
Host
optional
string
Web domain identifier
Authorization
required
string
Authorization mechanism: Bearer {{ACCESS_TOKEN}}
Accept-Language
optional
string
Parameter defining which language will be set on the UI by default. It is designated according to ISO 639-1 — Language Codes. The possible options are "en", "fr", "zn", "de", "es", "ar", "ru", and "pt"
Body Parameters
cashier_key
required
string
Software-level credentials that identify a merchant when creating a Cashier session; provided by BridgerPay
order_id
required
string
Transaction ID within the merchant's system
first_name
optional
string
First name of a shopper whom this session is being created for, for example, to later deposit with a credit card
last_name
optional
string
Shopper's last name
email
optional
string
Shopper's email address
language
optional
string
Parameter defining which language will be set for the shopper on the UI by default. It is designated according to ISO 639-1 — Language Codes. The possible options are "en", "fr", "zn", "de", "es", "ar", "ru", and "pt". If you specify both this parameter and the "Accept-Language" header parameter, the latter will be applied
currency
required
string
Currency which the shopper's following payment transaction (e.g. deposit) will be originated in; designated according to ISO 4217 — Currency Codes (e.g. "USD", "CNY", or "EUR")
country
required
string
Country where this transaction will be created; designated according to ISO 3166-1 — Country Codes (e.g. "US", "CN", or "BE")
state
optional
string
State where this transaction will be created; applicable to the USA, Canada, and Australia
address
optional
string
Shopper's address
city
optional
string
Shopper's city
zip_code
optional
string
Shopper's ZIP code
direct_payment_method
optional
string
Parameter defining which payment method should be suggested to the shopper on the UI by default, e.g. "credit_card" or "apm". The shopper can ignore this suggestion and choose another method, though
amount
required
number
Transaction amount; must be more than 0
currency_lock
optional
boolean
Parameter defining whether the shopper is unable to change the specified currency when making the payment transaction ('true') or is able ('false', used by default). We recommend that you do not allow this (i.e. type 'true') because some PSPs, once they open a session, do not recheck the currency and transfer the specified amount in a wrong currency
amount_lock
optional
boolean
Parameter defining whether the shopper is unable to change the specified amount when making the payment transaction ('true') or is able ('false', used by default). Additionally, if 'true', any amount, even if it is beyond the limits imposed by the PSP, will be applied
phone
optional
string
Shopper's phone number
affiliate_id
optional
string
Affiliate or intermediary ID
tracking_id
optional
string
Tracking ID associated with the affiliate or intermediary
platform_id
optional
string
Merchant's platform ID
payload
optional
string
Message transmitted with the other data to match the sessions when the shopper's following payment transaction (e.g. deposit) is approved. It is used for ensuring additional security
Response
200: OK
Successful response
{
"response": {
"status": "OK", //Response status
"code": 200, //Response code
"message": "OK" //Comment associated with the response
},
"result": {
"cashier_token": "{{CASHIER_TOKEN}}" //Generated unique cashier token
}
}
400: Bad Request
One or more required parameters are missing or have incorrect format
{
"response": {
"status": "BadRequest",
"code": 400,
"message": "validation_error"
},
"result": [
{
"type": "validation_error",
"field": null,
"message": "The field 'order_id' can't be empty"
},
{
"type": "validation_error",
"field": null,
"message": "The field 'currency' can't be empty"
}
]
}
401: Unauthorized
1) Attempt to access the resource without merchant authorization (empty response) 2) Invalid API_KEY provided to access the resource
{
"response": {
"status": "Unauthorized",
"code": 401,
"message": "Unauthorized"
}
"result": null
}
403: Forbidden
1) No PSP available to the merchant supports the specified currency (message: "payment_method_not_found") 2) No PSP available to the merchant works in the specified country
{
"response": {
"status": "Forbidden",
"code": 403,
"message": "country_not_supported"
},
"result": null
}
415: Unsupported Media Type
Content-Type header parameter has not been provided, or the specified value is not supported by BridgerPay (empty response)