This document provides the necessary steps and information for integrating with the Pay10 API to generate payment links. When you make a successful API request, you will receive a payment link in the response. This payment link can be sent to your customers, who can then click on the link to make their payment. The document includes details on the request and response formats, as well as the logic for calculating hash for authentication of request and response payloads.
Request
This endpoint initiates the request from the merchant.
HTTP Method | POST |
---|---|
URL (Production) | https://secure.pay10.com/crmws/invoice/createInvoice |
Request Parameters
Field Name | Description | Required | Type | Example |
---|---|---|---|---|
PAY_ID | Pay ID is provided by PAY10 | YES | NU | 160234578452178 |
INVOICE_NO | Merchant reference number. Must be unique for each request | YES | AN | PAY10_823647263 |
RETURN_URL | URL of merchant website to get the response back after transaction is done | NO | CH | https://www.example.com/return_url |
HASH | Unique value generated by SHA 256 hashing algorithm | YES | AN | 7995156CE4C40C44C41BECA3B9CE09B9 |
CUST_NAME | Customer name | YES | CH | John Paul |
CUST_STREET_ADDRESS1 | Customer address | NO | CH | House no - 01 |
CUST_CITY | Customer city | NO | CH | New Delhi |
CUST_STATE | Customer state | NO | CH | Delhi |
CUST_COUNTRY | Customer country | NO | CH | India |
CUST_ZIP | Customer zip | YES | AN | 110075 |
CUST_PHONE | Customer phone | YES | NU | 09999999999 |
CUST_EMAIL | Customer email | YES | CH | [email protected] |
AMOUNT | Total Sale Amount | YES | NU | 100 |
CURRENCY_CODE | 3-digit code of the currency | YES | NU | 356 |
PRODUCT_NAME | Name of product | YES | CH | Apple iphone |
PRODUCT_DESC | Description of product | NO | CH | Phone by apple |
EXPIRES_DAY | Link expiration in days. If you pass value here, then pass “0” in EXPIRES_HOURS | YES | NU | 0-30 |
EXPIRES_HOUR | Link expiration in hours. If you pass value here, then pass “0” in EXPIRES_DAY | YES | NU | 0-24 |
GST | GST (Goods and Services Tax) applicable | NO | CH | 5%, 12%, 18%, 24% |
QUANTITY | Quantity of the product, used to calculate the total amount | YES | NU | 1, 2, 3 |
TOTAL_AMOUNT | Total amount debited to customer. Use this if you wish to display GST to customer | YES | NU | 100 |
Amount format
Rules for handling the decimal point for the amount value is expressed below:
For INR
Currency | Handling | Example |
---|---|---|
INR | Expressed in paisa | INR 1250 to represent INR 12.50 INR 100 to represent INR 1.00 |
Generating the Hash Value
SHA-256
PAY10 requires a SHA-256 HMAC digital signature be included in each payment request to ensure the data integrity and authenticity of the request.
The instructions below demonstrate how PAY10 expects the data to be encrypted:
Rank order of the payload’s mandatory key-value pairs in ascending alphabetical order of the keys.
Concatenate the mandatory key-value pairs into a single-line string and, instead of using an ampersand (&), delimit the key-value pairs with a tilde (~).
Append the secret key at the end of the string.
Generate a hash value of the string using the PAY10 secret and SHA-256 algorithm.
Convert all characters of the hash value into uppercase.
This is an example string of a payment request before it is hashed:
AMOUNT=100~CURRENCY_CODE=356~CUST_EMAIL=[email protected]~CUST_NAME=test~CUST_PHONE=9958100407~CUST_ZIP=110001~EXPIRES_DAY=1~EXPIRES_HOUR=0~INVOICE_NO=8n1233~PAY_ID=123123~PRODUCT_NAME=test~QUANTITY=1~TOTAL_AMOUNT=1004fd380a9ad894b5e
This is the expected result of the hash value:
Hash value =6797F1842DEB4F3EBAEAD53E1BAFD5A535D322B9FA3893F201FDB03933EEAE09
The purpose of the SHA256 signature field is to ensure the integrity of the data posted back to your server. You should always compare the SHA256 signature field's value posted by PAY10 with the one you calculated.
Sending request and Getting Response
Request
{
"PAY_ID": "1007940517120254",
"INVOICE_NO": "invoiceNo6",
"NAME": "test",
"PHONE": "9999999999",
"ADDRESS": "",
"EMAIL": "",
"CITY": "",
"STATE": "",
"COUNTRY": "",
"ZIP": "110096",
"PRODUCT_NAME": "Sweety",
"PRODUCT_DESC": "",
"EXPIRES_DAY": "1",
"EXPIRES_HOUR": "0",
"CURRENCY_CODE": "356",
"GST": "0",
"QUANTITY": "1",
"AMOUNT": "1",
"TOTAL_AMOUNT": "1.00",
"HASH": "string"
}
Response
Successful response
{
"RESPONSE_CODE": "INVSIN200",
"URL": "https://uat.pay10.com/pgui/jsp/reviewInvoice?svalue=100428130009 ",
"HASH": "AE8FF57ABBCF3022CFF905024FC102980AA93C86C08EE18DD57702AB424AF8E1"
}
Failed response
{
"MESSAGE": "PayId can not be empty",
"RESPONSE_CODE": "1002"
}
Below Table shows the parameters sent to merchant.
Field Name | Description | Example |
---|---|---|
URL | Pay10 payment link | https://www.example.com/873627283 |
HASH | Unique value generated by SHA 256 hashing algorithm | 7995156CE4C40C44C41BECA3B9CE09B9 |
RESPONSE_CODE | Code for transaction status | 000 |
MESSAGE | Description of the response code | Hash mismatch |
Response codes
Response Code | Message |
---|---|
INVSIN200 | URL generated successfully |
INVSIN101 | Please enter unique invoice number |
1001 | IP address is not valid |
1002 | If any mandatory fields value missing |