Praxis Wiki logo

Cashier API init-invoice


init-invoice is similar to {init-checkout}, but it also allows you to specify the time when the login link expires. In addition, this is the only login method giving the redirect URL capable of reues, all other methods produce the one-time login URL - the links can't be visited twice, but invoice is only limited to due date/time and amount to be paid.

{danger.fa-exclamation} IMPORTANT: If not provided, optional customer data fields will be collected from customer upon login to Cashier using One-Time Registration form.

When executing the request, you receive json response that contains redirect_url parameter. The redirect_url parameter is a link that will automatically do the customer login to Cashier.

{danger.fa-exclamation-triangle} IMPORTANT: In case of init-invoice flow, the validation request is not sent to CRM.

ENDPOINTS

Name URL
Sandbox https://pci-gw-test.praxispay.com/api/init-invoice
Live https://gw.praxisgate.com/api/init-invoice

CHECKLIST

Please contact your account manager or technical support representative in order to confirm the following merchant acccount settings.

Item Purpose
Cashier API v1.1 Required for Cashier API to be allowed your CRM.
Dynamic Return URL Required for return_url to work properly. There is a number of dynamic variables supported for this parameter.
Merchant ID and Merchant Secret Required. The merchant credentials will be provided by the Technical Support representative.
Backoffice and VT - yes/no If you consider using Backoffice and VT for customer management, please make sure to provide the Customer Sync callback URL to Technical Support representative.

REQUEST PARAMETERS

Variable Type Description
signature varchar(96) Required. Request signature. Please refer to How to Build Signature for details on signing the request.
merchant_id varchar(50) Required. Merchant API client account identifier
frontend varchar(50) Required. Cashier FrontEnd name, normally it is a common name of the website. Linked to a specific base currency.
locale varchar(5) Optional. User locale. For ex.: en-GB
payment_method varchar(10) Optional. For ShopPing Cart. Payment method that will be used for processing
expires int(11) Required. Link lifetime. The unix timestamp (seconds) when the login URL is expired
order_id varchar(50) Required. Order id in your system
amount int(20) Required. Payment amount in cents.
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
currency varchar(10) Required. Customer currency
pin varchar(50) Required. Unique customer id in your system
requester_ip varchar(10) Optional. Customer's IP address
first_name varchar(25) Optional. Customer's first name
last_name varchar(25) Optional. Customer's last name
dob date Optional. Date of birth of the customer. MM/DD/YYYY format accepted.
email varchar(50) Optional. Customer's email
address varchar(100) Optional. Customer's address
city varchar(50) Optional. City of the customer
country varchar(2) Required. ISO 3166-1 alpha-2 (US, MT, IT, GB, DE etc)
state varchar(3) Optional Only for US, CA and AU. State/Province where the customer resides. 3 characters ISO format. Otherwise leave blank.
zip varchar(12) Optional. Postal Code of the customer. Only required for US and CA. Can provide values for other countries. Limited to 12 alphanumeric characters only.
phone int(20) Optional. Numeric only, includes country area code. Should not be a dummy sequence like 123456 or 111111, should be at least 6 digits long.
return_url varchar(256) Required. User will be redirected to a specified URL after successful deposit (except cases when there is another rule defined with higher priority)
notification_url varchar(256) Required. URL to which the deposit status notification will be sent. Please refer to Notification for more details.
timestamp int(11) Required. Request time. URL will be active during 1 min after this time
version varchar(3) Required. API version
variable1 varchar(256) Optional. Your custom field which will consist some neсessary information
variable2 varchar(256) Optional. Your custom field which will consist some neсessary information
variable3 varchar(256) Optional. Your custom field which will consist some neсessary information
profile int(2) Optional. Customer's profile level. Different profile levels may be used to configure the transaction and payment method limits
gateway varchar(32) Optional. HASH value of gateway that should processed transaction

RESPONSE PARAMETERS

Variable Type Description
status int Required.
- 0 if the request was successful
- Negative integer if internal server/network error occurs
- Positive integer if application/logical error occurs
description varchar(75) Required. Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production
version varchar(3) Required. API version
signature varchar(96) Required. sha384 HASH code of response (same algorithm as request signature)
redirect_url varchar(256) Required. Cashier Autologin URL. When redirected to this URL, the customer will be navigated further to the Cashier deposit page
auth_token varchar(75) Required. Special token that allows the customer to login during 15 min

EXAMPLE

Request

curl -X POST \ https://gw.praxisgate.com/api/init-checkout \
-H 'Content-Type: application/json' \
-d '{
    "address":"Red Street 1",
    "amount":25,
    "city":"London",
    "country":"GB",
    "currency":"USD",
    "dob":"1981-09-05",
    "email":"[email protected]",
    "expires":1567154161,
    "first_name":"Tom",
    "frontend":"Sandbox USD",
    "last_name":"Doe",
    "locale":"en-GB",
    "merchant_id":"praxis_test_user",
    "notification_url":"https://api.merchant.com/praxis/orders/999555111",
    "order_id":"999555111",
    "payment_method":"PraxisCC02",
    "phone":"6712332112",
    "pin":"123",
    "requester_ip":"216.111.222.123",
    "return_url":"https://merchant.com/payment_result/999555111",
    "timestamp":1571946494,
    "version":"1.1",
    "zip":"01234",
    "signature":"17a224b70e107d1686fe28c30ebd6fe41ec96586ffe4bcaa9760c8e687248de81b66e26e388b3157626c9ca8c81c2547"
}'

Response (OK)

{
    "auth_token":"eb2a7a96b3d5ff60c961062c6bedddb8",
    "description":"Success",
    "redirect_url":"https://compute.praxispay.com/autologin-form/eb2a7a96b3d5ff60c961062c6bedddb8",
    "status":0,
    "version":"1.1",
    "signature":"76a6fd27676ed0851f156ae97b82d70de79e8c68f72aa9eec242d52c465bd219bf7851323d8a001a38fa6df318da86a1"
}

Response (ERR)

{
    "description":"Timestamp expired",
    "status":1,
    "version":"1.1",
    "signature":"b1834f0054e439773ab7ef7b83b72f6db8d2f555189a207d86bebfc8a028c1917d197dd68191dad294c12a63ee7c991d"
}

You are currently viewing version 3.3 Latest version here