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.

Request Parameters

Field NameDescriptionRequiredTypeExample
PAY_IDPay ID is provided by PAY10YESNU160234578452178
INVOICE_NOMerchant reference number. Must be unique for each requestYESANPAY10_823647263
RETURN_URLURL of merchant website to get the response back after transaction is doneNOCHhttps://www.example.com/return_url
HASHUnique value generated by SHA 256 hashing algorithmYESAN7995156CE4C40C44C41BECA3B9CE09B9
CUST_NAMECustomer nameYESCHJohn Paul
CUST_STREET_ADDRESS1Customer addressNOCHHouse no - 01
CUST_CITYCustomer cityNOCHNew Delhi
CUST_STATECustomer stateNOCHDelhi
CUST_COUNTRYCustomer countryNOCHIndia
CUST_ZIPCustomer zipYESAN110075
CUST_PHONECustomer phoneYESNU09999999999
CUST_EMAILCustomer emailYESCH[email protected]
AMOUNTTotal Sale AmountYESNU100
CURRENCY_CODE3-digit code of the currencyYESNU356
PRODUCT_NAMEName of productYESCHApple iphone
PRODUCT_DESCDescription of productNOCHPhone by apple
EXPIRES_DAYLink expiration in days. If you pass value here, then pass “0” in EXPIRES_HOURSYESNU0-30
EXPIRES_HOURLink expiration in hours. If you pass value here, then pass “0” in EXPIRES_DAYYESNU0-24
GSTGST (Goods and Services Tax) applicableNOCH5%, 12%, 18%, 24%
QUANTITYQuantity of the product, used to calculate the total amountYESNU1, 2, 3
TOTAL_AMOUNTTotal amount debited to customer. Use this if you wish to display GST to customerYESNU100

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 NameDescriptionExample
URLPay10 payment linkhttps://www.example.com/873627283
HASHUnique value generated by SHA 256 hashing algorithm7995156CE4C40C44C41BECA3B9CE09B9
RESPONSE_CODECode for transaction status000
MESSAGEDescription of the response codeHash mismatch

Response codes

Response CodeMessage
INVSIN200URL generated successfully
INVSIN101Please enter unique invoice number
1001IP address is not valid
1002If any mandatory fields value missing