Praxis Wiki logo

Webhooks Customer Sync


Customer Sync is a mechanism that allows agents to manage customers, their deposits, and payouts within Virtual Terminal.

When an agent attempts to access the Virtual Terminal for a customer, the Backoffice will initiate a request to retrieve the customer’s details from the CRM.

To enable this retrieval, the CRM must implement an API callback endpoint that will be available to receive the request from and respond with the appropriate customer information.

{danger.fa-exclamation-triangle} IMPORTANT:
Ensure that you have provided the callback URL to your technical support representative before attempting to use the Virtual Terminal.

REQUEST PARAMETERS

Variable Type Description
merchant_id varchar(50) Merchant API client account identifier
application_key varchar(50) Cashier Application key, normally it is a common name of the website. Linked to a specific base currency.
cid varchar(50) Unique customer id in your system
timestamp int(11) Request time. URL will be active during 1 min after this time
version varchar(3) API version

RESPONSE PARAMETERS

Variable Type Description
status int API communication 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.
customer_data <Object> ? Customer object. Appears as null in case of authentication/validation error.
manual_validation_url varchar(256) ? URL to which the manual deposit validation request will be sent. Please refer to Validation for more details.
manual_notification_url varchar(256) ? URL to which the manual deposit status notification will be sent. Please refer to Notification for more details.
balance int(20) Customer's current available balance.
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.
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. cid

Response signature parameters

  1. status
  2. timestamp
  3. manual_validation_url
  4. manual_notification_url
  5. balance

EXAMPLE

Request

curl -X POST \ https://api.merchant.com/v1/sync/ \
-H 'Content-Type: application/json' \
-d '{
    "application_key":"Praxis TEST USD",
    "merchant_id":"Test-Integration-Merchant",
    "cid":"123",
    "timestamp":1561206408,
    "version":"1.3"
}'

Response (OK)

{
    "status":0,
    "description":"OK",
    "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",
        "profile": 1
    },
    "manual_notification_url":"https://api.merchant.com/v1/deposits/fxodWAQVvc9SRxhDaWSJJC21f",
    "manual_validation_url":"https://api.merchant.com/v1/validate_deposits/fxodWAQVvc9SRxhDaWSJJC21f",
    "balance": 0,
    "version":"1.3",
    "timestamp":1561279426
}

Response (ERR)

{
    "status":1,
    "description":"Customer not found",
    "customer_data":null,
    "version":"1.3",
    "timestamp":1561207146
}