Praxis Wiki logo

Cashier API {cashier}


The section explains how to interact with API.

In some cases the customer activity within the Cashier requires the agent's interaction: payout request approval, finalizing (capture) of the authorized deposit transaction, etc.

Often it is critical for the business flow to interact with the customer in time, whereas it is not always possible for the agent to react instantly. For that purpose the CRM can call API functions in order to follow the same steps as the agent would do, so you will know that a certain action is taken instantly upon the customer's activity, with all the regulatory considerations.

{danger.fa-exclamation-triangle} IMPORTANT: The validation callback will be triggered only if the validation_url is provided within the Cashier session request.

Cashier session allows the customer to access the Cashier UI - an interface where the customer may choose one of the payment methods, offered according to the merchant's visibility rules, limits and priorities.

Upon sending the request to Cashier API, you receive json response that contains redirect_url parameter. The redirect_url parameter is a link that will automatically perform the customer login to Cashier.

This redirect_url value should be set as src attribute of an iframe within the payment page at the merchant website.

ENDPOINTS

Name URL
Sandbox https://gateway.cashier-test.com/cashier/cashier
Live https://gateway.praxispay.com/cashier/cashier

Request Parameters

✓ - required value
? - optional, value or null
✕ - always appears as null

Variable Type Description
merchant_id varchar(50) Merchant API client account identifier
application_key varchar(32) Identifier of your application (website)
intent varchar(32) Action to be taken within the cashier. Allowed values are:
- authorization for authorization (hold) for the following capture
- payment for payment transaction
- withdrawal for withdrawal request
currency varchar(10) Intended transaction currency
amount int(20) ? Intended transaction amount in cents (send null to let the customer decide).
Please note: for certain currencies (see full list here) there is a fraction other than 100 cents per unit, this is important if you multiply by 100 to send the amount in cents
balance int(20) ? Customer's withdrawable balance in cents. Can be used for automatic amount validation during the withdrawal request submission (send null to bypass the validation).
Please note: for certain currencies (see full list here) there is a fraction other than 100 cents per unit, this is important if you multiply by 100 to send the amount in cents
cid varchar(50) Unique customer id in your system
locale varchar(5) User locale. See locales reference for the full list of supported locales
customer_token varchar(32) ? HASH value of customer's identity
customer_data <Object> ? Customer data object
payment_method varchar(50) ? Payment method. The gateway will override this value if provided.
gateway varchar(32) ? Credit card gateway doing the processing
validation_url varchar(256) ? URL to which the pre-deposit validation will be sent
notification_url varchar(256) URL to which the deposit status notification will be sent
return_url varchar(256) User will be redirected to a specified URL (relevant for cashier login, virtual terminal, 3D Secure and E-Wallet login redirect)
order_id varchar(50) Transaction identifier in your system
variable1 varchar(256) ? Your custom field to tag the transaction with some necessary information
variable2 varchar(256) ? Your custom field to tag the transaction with some necessary information
variable3 varchar(256) ? Your custom field to tag the transaction with some necessary information
version varchar(3) API version
timestamp int(11) Request time (unix timestamp, seconds)

Response Parameters

Variable Type Description
status int API communication status - for transaction processing status please refer to transaction.transaction.status
- 0 if the request was successful
- Negative integer if internal server/network error occurs
- Positive integer if application/logical error occurs
description varchar(256) Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production
redirect_url varchar(256) ? Cashier login URL. Appears as null for authentication/validation errors and expired session.
customer <Object> Customer object
session <Object> Session object
version varchar(3) API version
timestamp int(11) Response time (unix timestamp, seconds)

Signature

The full signature generation algorithm can be found in the Authentication section.

Request signature parameters

  1. merchant_id
  2. application_key
  3. timestamp
  4. intent
  5. cid
  6. order_id

Response signature parameters

  1. status
  2. timestamp
  3. redirect_url
  4. customer.customer_token

Example

Request

{
    "merchant_id": "Test-Integration-Merchant",
    "application_key": "Sandbox",
    "intent": "sale",
    "currency": "USD",
    "amount": 100,
    "cid": "1",
    "locale": "en-GB",
    "customer_token": null,
    "customer_data": {
        "country": "GB",
        "first_name": "John",
        "last_name": "Johnson",
        "dob": "12\/31\/1980",
        "email": "[email protected]",
        "phone": "44201112222",
        "zip": "WC2N 5DU",
        "state": "JS",
        "city": "London",
        "address": "Random st., 12\/3"
    },
    "payment_method": null,
    "gateway": null,
    "validation_url": null,
    "notification_url": "https:\/\/api.merchant.com\/v1\/deposits\/tx-1560610955",
    "return_url": "https:\/\/merchant.com\/payment_result\/tx-1560610955",
    "order_id": "test-1560610955",
    "variable1": "your variable",
    "variable2": "if that is not enough, you can pass even one more variable",
    "variable3": null,
    "version": "1.3",
    "timestamp": 1590611635
}

Response

{
    "status": 0,
    "description": "Ok",
    "redirect_url": "https:\/\/compute.praxispay.com\/login\/8a7sd87a8sd778ac961062c6bedddb8",
    "customer": {
        "customer_token": "87cfb23a8f1e68e162c276b754d9c061",
        "country": "GB",
        "first_name": "John",
        "last_name": "Johnson",
        "avs_alert": 0,
        "verification_alert": 0
    },
    "session": {
        "auth_token": "8a7sd87a8sd778ac961062c6bedddb8",
        "intent": "payment",
        "session_status": "created",
        "order_id": "test-1560610955",
        "currency": "EUR",
        "amount": 100,
        "conversion_rate": 1.000000,
        "processed_currency": "EUR",
        "processed_amount": 100,
        "payment_method": "WireOnline",
        "gateway": null,
        "cid": "1",
        "variable1": "your variable",
        "variable2": "if that is not enough, you can pass even one more variable",
        "variable3": null
    },
    "version": "1.3",
    "timestamp": 1590611635
}