Creating a receipt¶
Parameters¶
HTTP method |
Access rights |
URL | Parameters |
Note |
---|---|---|---|---|
POST | manage_offline_receipts | https://api.admitad.com/offline_receipts/create/ |
List of request parameters | Returns a created receipt.* |
* Returns the result in the JSON format.
List of request parameters¶
Name |
Type |
Required |
Settings restrictions |
Note, allowed values |
---|---|---|---|---|
website_id | integer | ✔ | The list of publisher’s ad spaces | |
purchaser_id | string | ✔ | Max length 50 characters |
Customer ID in the publisher’s system |
qr_code | string | ✔ | urlencoded QR code data |
Example of use¶
Example of a request with utility ``curl``:
curl -H 'Authorization: Bearer access_token' -X POST https://api.admitad.com/offline_receipts/create/ \
-F 'website_id=1' \
-F 'purchaser_id=2341' \
-F 'qr_code=t%3D20180702T2129%26s%3D260.19%26fn%3D9287440300060728%26i%3D224%26fp%3D2737913366%26n%3D1'
Example of the response from the API server in the JSON format:
{
"id": "5b509f0c47b41317d0829ade",
"website_id": 1,
"purchaser_id": 2341,
"status": "new",
"payment_ids": [],
"FNS_data": "",
}
Example of the API server response to an error:
{
"error": "QR-code already registered.",
"status_code": 400
}
Description of API server response fields¶
Name |
Description |
---|---|
id | Receipt identifier |
website_id | Ad space ID |
purchaser_id | Customer unique identifier in the publisher’s system |
status | Receipt status |
payment_ids | IDs of payments |
FNS_data | FTS data |
List of possible errors¶
Error |
Reason |
---|---|
Invalid params | Not all required parameters transferred: website_id, purchaser_id, qr_code |
There is no connected advcampaigns with offline sales. | This space does not work with offline sales |
Invalid QR code | Invalid qr_code parameter |
QR code already registered. |
QR code resent |