---
sidebar_position: 11
description: Get 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';

# Get barcode
 Gets the barcode CP for the order



`Function GetBarcode(Val Token, Val UUID, Val GetFile = False, Val TestAPI = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Auth token |
  | UUID | --uuid | String | &#x2714; | The UID of the barcode received when the barcode was created |
  | GetFile | --getfile | Boolean | &#x2716; | True > PDF file data will be received, False > receives CDEK server response |
  | TestAPI | --testapi | Boolean | &#x2716; | Flag to use test API for requests |

  
  Returns:  Map Of KeyAndValue, BinaryData - serialized JSON response from CDEK or a PDF file

:::tip
The barcode must be previously created. See CreateBarcode

The link to the file with the barcode CP is available within 1 hour

Method at API documentation: [Receiving barcode CP for the order](https://api-docs.cdek.ru/36969722.html)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9. ...";
    UUID  = "6e00366c-d89e-4f38-b036-b6bb11a4cc0f";

    Result = OPI_CDEK.GetBarcode(Token, UUID, , True); // Server response with a URL
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint cdek GetBarcode \
             --token "***" \
             --uuid "a86e5d1e-3f4a-421f-8108-691bfa43b039" \
             --getfile true \
             --testapi "***" \
             --out "C:\Users\bayse\AppData\Local\Temp\m3wy4uxzmho.pdf"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint cdek GetBarcode ^
             --token "***" ^
             --uuid "a86e5d1e-3f4a-421f-8108-691bfa43b039" ^
             --getfile true ^
             --testapi "***" ^
             --out "C:\Users\bayse\AppData\Local\Temp\m3wy4uxzmho.pdf"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "entity": {
  "uuid": "ffa243b5-a031-4393-b07a-28f5f7cb3e58",
  "orders": [
   {
    "order_uuid": "9e15fe3c-2071-4ed8-9ded-70df723825d3"
   }
  ],
  "copy_count": 1,
  "format": "A5",
  "lang": "RUS",
  "statuses": [
   {
    "code": "ACCEPTED",
    "name": "Принят",
    "date_time": "2025-12-10T20:09:25+00:00"
   },
   {
    "code": "INVALID",
    "name": "Некорректный запрос",
    "date_time": "2025-12-10T20:09:26+00:00"
   }
  ]
 },
 "requests": [
  {
   "request_uuid": "f181961f-7fe0-4991-a8b9-d51ba75f9a43",
   "type": "CREATE",
   "date_time": "2025-12-10T20:09:25+00:00",
   "state": "INVALID",
   "errors": [
    {
     "code": "v2_orders_number_is_empty",
     "message": "Entity is empty. All orders are incorrect"
    }
   ],
   "warnings": [
    {
     "code": "v2_order_invalid",
     "message": "Order is invalid 9e15fe3c-2071-4ed8-9ded-70df723825d3"
    }
   ]
  }
 ],
 "related_entities": []
}
```
