Offers API
OFFERS - Offers API
Section titled “OFFERS - Offers API”This Api will be called from offers system to verify the unique id provided in offers URL for accessing coupons. On load of this URL we will initiate a api call to affiliate call back URL to verify the unique id. In response “data” parameter will return details about the transaction. Returned customer name will be visible in offers page. The amount returned in data parameter in response will decide the number of coupons to be displayed. Default count of token to display else we will show the token amount as per transaction amount. Amount > 2000 --- 8 coupons to display 2000 > Amount > 1000 --- 4 coupons to display 1000 > Amount > 500 --- 2 coupons to display If the value of “expiryday” is available, we have to consider that as expiry time period else we will consider it from standard expiry day from affiliate data. Expiry day will be considered from the day of transaction datetime. The URL will be having a specific time period of its accessibility which we will be taking at the time of affiliate onboarding.
https://offers.airpay.co.in/app/<affiliatecode>/<uniqueid>Header
Section titled “Header”| Field | Type | Description |
|---|---|---|
| Content-Type | String | application/json |
| checksum | Text | Checksum value(length 64) (required) hash(‘sha256’,<affiliateid+airpaykey+allvalues>); |
Parameter
Section titled “Parameter”| Field | Type | Description |
|---|---|---|
| affiliateid | String | affilate identification code(max length 10) (required) |
| uniqueid | String | unique id entered in url in base64 format(max length 10) (required) |
Request-Example:
Section titled “Request-Example:” curl --location --request POST '{{Affiliate Verification Url}}' \ --header 'Content-Type: application/json' \ --header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \ --data-raw '{ "affiliateid":"91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps","uniqueid":"91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps" }'Success 200
Section titled “Success 200”| Field | Type | Description |
|---|---|---|
| status | Number | Sattus Code(400- fail,200-success)(required)(length 3) |
| message | String | Status Message(success,fail)(required) |
| data | json | Response data(required) Example: { “transactiontime”:“Y:m:d H:i:s”,“customer”:“ravi dubey”,“amount”:“1000.00”,“expiryday”:“4”, } |
| checksum | String | Checksum value(required)(length 64) hash(‘sha256’,<affiliateid+airpaykey+allvalues>); |
For Success:
Section titled “For Success:”{ "status": 200, "message": "success", "data": { "transactiontime": "2021-04-18 00:00:00", "customer": "ravi dubey", "amount": "1000.00", "expiry": "72" }, "checksum": "91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps"}