You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-12-07 23:03:08 +02:00
90 lines
3.0 KiB
Plaintext
Vendored
90 lines
3.0 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 10
|
|
description: Create barcode and other functions to work with CDEK in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, CDEK]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Create barcode
|
|
Generates a PDF barcode CP for orders
|
|
|
|
|
|
|
|
`Function CreateBarcode(Val Token, Val UUIDArray, Val Copies = 1, Val Format = "A4", Val Lang = "RUS", 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 |
|
|
| Copies | --count | Number | ✖ | Number of copies |
|
|
| Format | --format | String | ✖ | Print format: A4, A5, A6, A7 |
|
|
| Lang | --lang | String | ✖ | Barcode language: RUS, ENG |
|
|
| TestAPI | --testapi | Boolean | ✖ | Flag to use test API for requests |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from CDEK
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [Creating barcode CP for the order](https://api-docs.cdek.ru/36969713.html)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJsb2NhdGlvbjphbGwiLCJvcmRlcjphbGwiLCJwYXltZW50OmFsbCJdLCJleHAiOjE3NDc3NzYzMjQsImF1dGhvcml0aWVzIjpbInNoYXJkLWlkOnJ1LTAxIiwiY2xpZW50LWNpdHk60J3QvtCy0L7RgdC40LHQuNGA0YHQuiwg0J3QvtCy0L7RgdC40LHQuNGA0YHQutCw0Y8g0L7QsdC70LDRgdGC0YwiLCJjb250cmFjdDrQmNCcLdCg0KQt0JPQm9CTLTIyIiwiYWNjb3VudC1sYW5nOnJ1cyIsImFjY291bnQtdXVpZDplOTI1YmQwZi0wNWE2LTRjNTYtYjczNy00Yjk5YzE0ZjY2OWEiLCJhcGktdmVyc2lvbjoxLjEiLCJjbGllbnQtaWQtZWM1OmVkNzVlY2Y0LTMwZWQtNDE1My1hZmU5LWViODBiYjUxMmYyMiIsImNvbnRyYWN0LWlkOmRlNDJjYjcxLTZjOGMtNGNmNS04MjIyLWNmYjY2MDQ0ZThkZiIsImNsaWVudC1pZC1lYzQ6MTQzNDgyMzEiLCJzb2xpZC1hZGRyZ...";
|
|
UUID = "db1a3e7c-adbe-4052-81d7-9180ecb1dc11";
|
|
Format = "A5";
|
|
Copies = 1;
|
|
|
|
Result = OPI_CDEK.CreateBarcode(Token, UUID, Copies, Format, , True);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint cdek CreateBarcode \
|
|
--token "***" \
|
|
--uuids "a9f88b45-cbdd-4b73-a1b4-c3bc77e35729" \
|
|
--count 1 \
|
|
--format "A5" \
|
|
--testapi "***"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint cdek CreateBarcode ^
|
|
--token "***" ^
|
|
--uuids "a9f88b45-cbdd-4b73-a1b4-c3bc77e35729" ^
|
|
--count 1 ^
|
|
--format "A5" ^
|
|
--testapi "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"entity": {
|
|
"uuid": "72753031-9cab-476e-b091-50d4c511afd2"
|
|
},
|
|
"requests": [
|
|
{
|
|
"request_uuid": "42c93f2b-bfe5-40eb-8927-04dcfb72457d",
|
|
"type": "CREATE",
|
|
"date_time": "2024-10-21T21:27:30+03:00",
|
|
"state": "ACCEPTED"
|
|
}
|
|
],
|
|
"related_entities": []
|
|
}
|
|
```
|