Создание онлайн заказа по API: различия между версиями
Перейти к навигации
Перейти к поиску
Merkulov (обсуждение | вклад) |
Merkulov (обсуждение | вклад) |
||
Строка 20: | Строка 20: | ||
{{Note|'''''Примечание'''''<br> | {{Note|'''''Примечание'''''<br> | ||
В '''HEADERS''' укажите значение '''access_token''' согласно:'''authorization''': Bearer <значение '''acces_token'''> .|800}} | В '''HEADERS''' укажите значение '''access_token''' согласно:'''authorization''': Bearer <значение '''acces_token'''> .|800}} | ||
{{ProductTable-2 | |||
|title-left= Request Body | |||
|title-right= type: raw (JSON) | |||
|content-left= | |||
base URL: https://kassa.bifit.com/cashdesk-api/v1/protected/online_orders | |||
|content-right= | |||
<syntaxhighlight lang="JSON"> | |||
{ | |||
"onlineOrder": { | |||
"visible": true, | |||
"created": 1644828163053, | |||
"changed": 1644828163053, | |||
"organizationId": "<''organization_id''>", | |||
"tradeObjectId": "<''trade_object_id''>", | |||
"taxSystem": "COMMON", | |||
"externalId": "BFt-002", | |||
"deliveryType": "COURIER", | |||
"deliveryAmount": null, | |||
"deliveryTime": null, | |||
"paid": false, | |||
"orderTime": 1644828134297, | |||
"clientId": 124329, | |||
"address": "Адрес", | |||
"responsiblePersonLogin": "7xxxxxxxxxx", | |||
"discount": 0.00, | |||
"discountType": 0, | |||
"location": null, | |||
"totalAmount": 14500.00, | |||
"comment": null, | |||
"currentStatusType": "NEW", | |||
"currentStatusTime": 1644828159791, | |||
"substatusId": null, | |||
"shopId": null, | |||
"endLockTime": null, | |||
"routeSheetDocumentId": null, | |||
"routeSheetDocumentPosition": null, | |||
"routeSheetDocumentNumber": null, | |||
"size": null, | |||
"actualDeliveryTime": null, | |||
"cashierName": null, | |||
"clientName": null | |||
}, | |||
"onlineOrderItems": [ | |||
{ | |||
"nomenclatureId": 22090265, | |||
"description": "Букет белых роз", | |||
"price": 3000, | |||
"vatValue": 20, | |||
"quantity": 1, | |||
"discount": 0, | |||
"calculationMethod": null, | |||
"paymentSubject": "PRODUCT", | |||
"contractorAddress": null, | |||
"contractorInn": null, | |||
"contractorName": null, | |||
"contractorPhone": null, | |||
"organizationPhone": null, | |||
"contractorActivityType": null, | |||
"markType": "UNKNOWN", | |||
"codeForOfd": null, | |||
"barcode": null, | |||
"vendorCode": null, | |||
"unitCode": 796, | |||
"editable": true, | |||
"total": null | |||
}, | |||
{ | |||
"nomenclatureId": 22090204, | |||
"description": "Букет роз, 40 шт", | |||
"price": 7000, | |||
"vatValue": 20, | |||
"quantity": 1, | |||
"discount": 0, | |||
"calculationMethod": null, | |||
"paymentSubject": "PRODUCT", | |||
"contractorAddress": null, | |||
"contractorInn": null, | |||
"contractorName": null, | |||
"contractorPhone": null, | |||
"organizationPhone": null, | |||
"contractorActivityType": null, | |||
"markType": "UNKNOWN", | |||
"codeForOfd": null, | |||
"barcode": null, | |||
"vendorCode": null, | |||
"unitCode": 796, | |||
"editable": true, | |||
"total": null | |||
}, | |||
{ | |||
"nomenclatureId": 22090243, | |||
"description": "Букет розовых и белых роз, 15 штук", | |||
"price": 4500, | |||
"vatValue": 20, | |||
"quantity": 1, | |||
"discount": 0, | |||
"calculationMethod": null, | |||
"paymentSubject": "PRODUCT", | |||
"contractorAddress": null, | |||
"contractorInn": null, | |||
"contractorName": null, | |||
"contractorPhone": null, | |||
"organizationPhone": null, | |||
"contractorActivityType": null, | |||
"markType": "UNKNOWN", | |||
"codeForOfd": null, | |||
"barcode": null, | |||
"vendorCode": null, | |||
"unitCode": 796, | |||
"editable": true, | |||
"total": null | |||
} | |||
], | |||
"properties": { | |||
"fullSettlement": true, | |||
"prepayment": false, | |||
"credit": false | |||
}, | |||
"client": { | |||
"organizationId": "<''organization_id''>", | |||
"address": "Адрес", | |||
"phone": "79999999999", | |||
"lastName": "Иванов", | |||
"firstName": "Иван", | |||
"patronymic": "Иванович", | |||
"email": "", | |||
"comment": null, | |||
}, | |||
"organizationId": null, | |||
"cashierInfos": null | |||
} | |||
</syntaxhighlight> | |||
|}}<br> |
Версия 12:17, 26 апреля 2022
CASHDESK API
API (Application Programming Interface или интерфейс программирования приложений) — это совокупность инструментов и функций в виде интерфейса для создания новых приложений, благодаря которому одна программа будет взаимодействовать с другой.
Для работы с API сервиса БИФИТ Касса, пользователю необходимо получить токен доступа. Генерация токена происходит по правилам авторизации OAuth2. С инструкцией авторизации по API можно ознакомиться здесь.
Создание заказа
Запрос | POST |
base URL: https://kassa.bifit.com/cashdesk-api/v1/protected/online_orders | https://kassa.bifit.com/cashdesk-api/v1/protected/online_orders
|
Примечание
В HEADERS укажите значение access_token согласно:authorization: Bearer <значение acces_token> .
Request Body | type: raw (JSON) |
base URL: https://kassa.bifit.com/cashdesk-api/v1/protected/online_orders | {
"onlineOrder": {
"visible": true,
"created": 1644828163053,
"changed": 1644828163053,
"organizationId": "<''organization_id''>",
"tradeObjectId": "<''trade_object_id''>",
"taxSystem": "COMMON",
"externalId": "BFt-002",
"deliveryType": "COURIER",
"deliveryAmount": null,
"deliveryTime": null,
"paid": false,
"orderTime": 1644828134297,
"clientId": 124329,
"address": "Адрес",
"responsiblePersonLogin": "7xxxxxxxxxx",
"discount": 0.00,
"discountType": 0,
"location": null,
"totalAmount": 14500.00,
"comment": null,
"currentStatusType": "NEW",
"currentStatusTime": 1644828159791,
"substatusId": null,
"shopId": null,
"endLockTime": null,
"routeSheetDocumentId": null,
"routeSheetDocumentPosition": null,
"routeSheetDocumentNumber": null,
"size": null,
"actualDeliveryTime": null,
"cashierName": null,
"clientName": null
},
"onlineOrderItems": [
{
"nomenclatureId": 22090265,
"description": "Букет белых роз",
"price": 3000,
"vatValue": 20,
"quantity": 1,
"discount": 0,
"calculationMethod": null,
"paymentSubject": "PRODUCT",
"contractorAddress": null,
"contractorInn": null,
"contractorName": null,
"contractorPhone": null,
"organizationPhone": null,
"contractorActivityType": null,
"markType": "UNKNOWN",
"codeForOfd": null,
"barcode": null,
"vendorCode": null,
"unitCode": 796,
"editable": true,
"total": null
},
{
"nomenclatureId": 22090204,
"description": "Букет роз, 40 шт",
"price": 7000,
"vatValue": 20,
"quantity": 1,
"discount": 0,
"calculationMethod": null,
"paymentSubject": "PRODUCT",
"contractorAddress": null,
"contractorInn": null,
"contractorName": null,
"contractorPhone": null,
"organizationPhone": null,
"contractorActivityType": null,
"markType": "UNKNOWN",
"codeForOfd": null,
"barcode": null,
"vendorCode": null,
"unitCode": 796,
"editable": true,
"total": null
},
{
"nomenclatureId": 22090243,
"description": "Букет розовых и белых роз, 15 штук",
"price": 4500,
"vatValue": 20,
"quantity": 1,
"discount": 0,
"calculationMethod": null,
"paymentSubject": "PRODUCT",
"contractorAddress": null,
"contractorInn": null,
"contractorName": null,
"contractorPhone": null,
"organizationPhone": null,
"contractorActivityType": null,
"markType": "UNKNOWN",
"codeForOfd": null,
"barcode": null,
"vendorCode": null,
"unitCode": 796,
"editable": true,
"total": null
}
],
"properties": {
"fullSettlement": true,
"prepayment": false,
"credit": false
},
"client": {
"organizationId": "<''organization_id''>",
"address": "Адрес",
"phone": "79999999999",
"lastName": "Иванов",
"firstName": "Иван",
"patronymic": "Иванович",
"email": "",
"comment": null,
},
"organizationId": null,
"cashierInfos": null
}
|