# 2.General API specification Common interface between merchant server and AllPay gateway, each channel has functions including: Purchase, Refund, Inqiury interface. ## 2.1. Signature String and Calculated the Signature 1.For a POST request message sent to the ALLPAY system, in which all incoming parameters (except signature parameters) according to the field name of ASCII smallest sequence (dictionary), using the format of the URL key/value pair (key1 = value1 & key2 = value2... ) spliced into a string String1. 2.At the end of String1, the signature key K1(assigned at ALLPAY upon access) agreed by both parties is spliced directly (no need to connect with "&"), resulting in a stringSignTemp string, and an md5 operation on stringSignTemp to get the value of signature. 3.Sample signature string ```js acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 ``` ## 2.2. General API access address Transaction Type |Test URL |Production URL ------- |-----------|------- Purchase | | Inquiry | | Refund | |