mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-03-25 21:39:21 +02:00
91 lines
3.1 KiB
Plaintext
Vendored
91 lines
3.1 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 8
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Create receipt
|
|
Generates pdf receipts for orders
|
|
|
|
|
|
|
|
`Function CreateReceipt(Val Token, Val UUIDArray, Val Type = "tpl_russia", Val CopiesPerSheet = 2, Val TestAPI = False) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Token | --token | String | ✔ | Auth token |
|
|
| UUIDArray | --uuids | String, Array of String | ✔ | One or an array of order UUIDs |
|
|
| Type | --type | String | ✖ | Receipt type (language) |
|
|
| CopiesPerSheet | --count | Number | ✖ | Number of copies of one receipt per sheet |
|
|
| TestAPI | --testapi | Boolean | ✖ | Flag to use test API for requests |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from CDEK
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Available receipt types (languages): tpl_china, tpl_armenia, tpl_russia, tpl_english, tpl_italian, tpl_korean, tpl_latvian, tpl_lithuanian, tpl_german, tpl_turkish, tpl_czech, tpl_thailand, tpl_invoice
|
|
|
|
It is recommended to specify at least 2 copies per sheet (parameter CopiesPerSheet): one to be glued on the shipment, the other to be kept by the sender
|
|
|
|
Method at API documentation: [Creating order receipt](https://api-docs.cdek.ru/36969649.html)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJsb2NhdGlvbjphbGwiLCJvcmRlcjphbGwiLCJwYXltZW50OmFsbCJdLCJleHAiOjE3MzUwNjM4MzYsImF1dGhvcml0aWVzIjpbInNoYXJkLWlkOnJ1LTAxIiwiY2xpZW50LWNpdHk60J3QvtCy0L7RgdC40LHQuNGA0YHQuiwg0J3QvtCy0L7RgdC40LHQuNGA0YHQutCw0Y8g0L7QsdC70LDRgdGC0YwiLCJhY2NvdW50LWxhbmc6cnVzIiwiY29udHJhY3Q60JjQnC3QoNCkLdCT0JvQky0yMiIsImFjY291bnQtdXVpZDplOTI1YmQwZi0wNWE2LTRjNTYtYjczNy00Yjk5YzE0ZjY2OWEiLCJhcGktdmVyc2lvbjoxLjEiLCJjbGllbnQtaWQtZWM1OmVkNzVlY2Y0LTMwZWQtNDE1My1hZmU5LWViODBiYjUxMmYyMiIsImNvbnRyYWN0LWlkOmRlNDJjYjcxLTZjOGMtNGNmNS04MjIyLWNmYjY2MDQ0ZThkZiIsImNsaWVudC1pZC1lYzQ6MTQzNDgyMzEiLCJzb2xpZC1hZGRyZ...";
|
|
UUID = "C:\Users\Administrator\AppData\Local\Temp\v8_226A_67.sqlite";
|
|
Type = "tpl_russia";
|
|
Copies = 1;
|
|
|
|
Result = OPI_CDEK.CreateReceipt(Token, UUID, Type, Copies, True);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint cdek CreateReceipt \
|
|
--token "***" \
|
|
--uuids "d8ca93f8-cb36-4e93-a3a1-c28db9af4e19" \
|
|
--type "tpl_russia" \
|
|
--count 1 \
|
|
--testapi "***"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint cdek CreateReceipt ^
|
|
--token "***" ^
|
|
--uuids "d8ca93f8-cb36-4e93-a3a1-c28db9af4e19" ^
|
|
--type "tpl_russia" ^
|
|
--count 1 ^
|
|
--testapi "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"entity": {
|
|
"uuid": "72753031-318f-4249-ab65-4c7e08244c6d"
|
|
},
|
|
"requests": [
|
|
{
|
|
"request_uuid": "8f0331c9-6bbc-4ec9-9357-ecc9af47342b",
|
|
"type": "CREATE",
|
|
"date_time": "2024-10-21T21:27:30+03:00",
|
|
"state": "ACCEPTED"
|
|
}
|
|
],
|
|
"related_entities": []
|
|
}
|
|
```
|