Receiving offline deals
Parameters
HTTP method | Access rights | URL | Parameters | Note |
---|---|---|---|---|
GET | offline_sales | https://api.admitad.com/ |
List of request parameters | Returns the list of deals*. |
GET | offline_sales | https://api.admitad.com/ |
Returns the deal*, where id is the deal identifier. |
- * Returns the result in the JSON format.
List of request parameters
Name | Type | Allowed values |
---|---|---|
campaign | integer | List of affiliate programs |
disabled | string |
|
datetime_start_from | datetime | %d.%m.%Y %H:%M |
datetime_start_to | datetime | %d.%m.%Y %H:%M |
datetime_end_from | datetime | %d.%m.%Y %H:%M |
datetime_end_to | datetime | %d.%m.%Y %H:%M |
datetime_created_from | datetime | %d.%m.%Y %H:%M |
datetime_created_to | datetime | %d.%m.%Y %H:%M |
limit | integer | limit, offset parameters |
offset | integer | limit, offset parameters |
is_activation_required | string |
|
Example of use
Example of a request with utility ``curl``:
curl -L -H 'Authorization: Bearer access_token' -X GET
https://api.admitad.com/offline_sales/?limit=1&disabled=false
curl -L -H 'Authorization: Bearer access_token' -X GET
https://api.admitad.com/offline_sales/3/
Example of the response from the API server in the JSON format:
{
"results": [
{
"campaign_id": 748,
"campaign_name": "foo campaign name",
"currency": "USD",
"description": "foo description",
"disabled": false,
"id": 3,
"image": "https://www.admitad.com/public/ceVbXte.jpg",
"name": "foo name",
"rate": "100.00",
"rate_type": "fixed",
"is_activation_required": true,
"datetime_start": "2018-10-11T15:53:54",
"datetime_end": "2018-11-09T15:53:54"
}
],
"_meta": {
"count": 3,
"limit": 1,
"offset": 0
}
}
Description of API server response fields
Name | Description |
---|---|
id | Deal identifier |
campaign_id | Affiliate program ID |
campaign_name | Name of affiliate program |
currency | Currency code (ISO 4217) |
name | Deal name |
rate | Rate |
datetime_start | Starting date and time of a deal |
datetime_end | End date and time of a deal |
rate_type | Rate type
|
description | Deal terms |
image | Image link |
disabled | Disabled deal
|
is_activation_required | Requires activation (user's consent to participate)
|
Receiving receipt information
Parameters
HTTP method | Access rights | URL | Parameters | Note |
---|---|---|---|---|
GET | offline_receipts | https://api.admitad.com/ |
List of request parameters | Returns information about a receipt |
- * Returns the result in the JSON format.
List of request parameters
Name | Type | Allowed values |
---|---|---|
website_id | integer | The list of publisher's ad spaces |
id | string |
List of receipt identifiers |
datetime_created_from | datetime | Receipt date and time (%d.%m.%Y %H:%M) |
datetime_created_to | datetime | Receipt date and time (%d.%m.%Y %H:%M) |
datetime_updated_from | datetime | Date and time of the last receipt update (%d.%m.%Y %H:%M) |
datetime_updated_to | datetime |
Date and time of the last receipt update (%d.%m.%Y %H:%M) |
limit | integer | limit, offset parameters |
offset | integer | limit, offset parameters |
purchaser_id | string | Customer unique identifier in the publisher's system |
Example of use
Example of a request with utility ``curl``:
curl -L -H 'Authorization: Bearer access_token' -X GET
'https://api.admitad.com/offline_receipts/?website_id=1&id=5b509f0c47b41317d0829ade&id=4a509f0c47b48362d0829ada''
Example of the response from the API server in the JSON format:
{
"results": [
{
"id": "5b509f0c47b41317d0829ade",
"website_id": 1,
"purchaser_id": 2341,
"status": "receipt_info_found",
"payment_ids": [
125342,
2345254
],
"retail_place_address": "",
"user": "",
"total_sum": "2915.00",
"datetime_created": "2018-12-12T00:00:00",
"datetime_updated": "2018-12-12T13:12:00",
"offline_sales_ids": [
31233,
21233
],
"not_activated_offline_sales_ids": [42],
"items": [
{
"sum": "1915.00",
"quantity": "1.00",
"offline_sales_ids": [
31233
],
"price": "1915.00",
"name": "",
},
{
"sum": "1915.00",
"quantity": "1.00",
"offline_sales_ids": [
21233
],
"price": "1915.00",
"name": "",
}
]
"FNS_data": "{\"items\":[{\"paymentType\":4,\"name\":\"qqqq\",\"productType\":1,\"sum\":100,\"price\":100,\"ndsSum\":0,\"nds\":6,\"quantity\":1}],\"userInn\":\"507303885648\",\"operationType\":1,\"dateTime\":\"2018-07-02T21:39:00\"}",
},
{
"id": "4a509f0c47b48362d0829ada",
"website_id": 1,
"purchaser_id": 2342,
"status": "receipt_info_found",
"payment_ids": [
4345254,
]
"retail_place_address": ""
"user": "",
"total_sum": "351918.00",
"datetime_created": "2018-11-12T00:00:00",
"datetime_updated": "2018-12-12T12:15:00",
"offline_sales_ids": [
11233,
],
"not_activated_offline_sales_ids": [],
"items": [
{
"sum": "1915.00",
"quantity": "1.00",
"offline_sales_ids": [
11233
],
"price": "1915.00",
"name": "",
}
]
"FNS_data": "{\"items\":[{\"paymentType\":4,\"name\":\"qqqq\",\"productType\":1,\"sum\":100,\"price\":100,\"ndsSum\":0,\"nds\":6,\"quantity\":1}],\"userInn\":\"507303885648\",\"operationType\":1,\"dateTime\":\"2018-07-02T21:29:00\"}",
},
],
"_meta": {
"count": 2,
"limit": 20,
"offset": 0
}
}
Description of API server response fields
Description of the receipt fields
Name | Description |
---|---|
id | Receipt identifier |
website_id | Ad space ID |
purchaser_id | Customer unique identifier in the publisher's system |
status | Offline receipt status
|
payment_ids | Action (payment order) identifiers generated during matching of the receipt items to existing deals (Reports by actions) |
retail_place_address | Store address |
user | Name of a company that issued the receipt |
total_sum | Grand total |
datetime_created | Receipt date and time |
datetime_updated | Date and time of the last change of receipt information |
offline_sales_ids | List of deal IDs activated on the receipt |
items | List of products on the receipt |
FNS_data | FTS data (unstable scheme) |
not_activated_offline_sales_ids | List of deactivated deal IDs |
Description of the receipt fields
Name | Description |
---|---|
sum | Cost |
quantity | Quantity |
offline_sales_ids | Deal IDs activated on the product |
price | Unit price |
name | Name of goods |
FNS_data fields description (scheme unstable)
Name | Description |
---|---|
dateTime | Receipt date and time |
fiscalDocumentNumber | Fiscal document No. |
fiscalDriveNumber | Fiscal drive number |
fiscalSign | Fiscal sign number |
operationType | Operation type 1 — income, 2 — income return, 3 — expense, 4 — expense return |
totalSum | Grand total |
cashTotalSum | Cash total |
ecashTotalSum | Non-cash total |
nds18 | 18% VAT total |
nds10 | 10% VAT total |
ndsNo | 0% VAT total |
operator | Cashier |
shiftNumber | Shift number |
requestNumber | Receipt number |
retailPlaceAddress | Store address |
user | Name of a company that issued the receipt |
userInn | Taxpayer ID of the receipt issuer |
ofdId | Fiscal Data Operator ID |
items | List of products |
Creating a receipt
Parameters
HTTP method | Access rights | URL | Parameters | Note |
---|---|---|---|---|
POST | manage_offline_receipts | https://api.admitad.com/ |
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 |
Offline deal activation for a user
Parameters
HTTP method | Access rights | URL | Parameters | Note |
---|---|---|---|---|
POST | offline_sales | https://api.admitad.com/ |
List of request parameters | Activates a deal for a user |
- * Returns the result in the JSON format.
List of request parameters
Name | Type | Allowed values |
---|---|---|
purchaser_id | string | User ID in the publisher's system |
website_id | integer | Website/ad space ID |
sale_id | integer | Deal ID |
activated_at | datetime | %d.%m.%Y %H:%M:%S |
Example of use
Example of a request with utility ``curl``:
curl -L -H 'Authorization: Bearer access_token' -X POST https://api.admitad.com/offline_sale_activations/ \
-F 'purchaser_id=123abc' \
-F 'website_id=13' \
-F 'sale_id=14' \
-F 'activated_at=02.23.2019 00:00:00'
Example of the response from the API server in the JSON format:
{
"purchaser_id": "123abc",
"website_id": 13,
"sale_id": 14,
"activated_at": "2019-02-23 00:00:00"
}
Description of API server response fields
Name | Description |
---|---|
purchaser_id | User ID in the publisher's system |
website_id | Website/ad space ID |
sale_id | Deal ID |
activated_at | Activation date and time |