---
sidebar_position: 2
description: Create courier invitation 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 courier invitation
 Creates a new request to call a courier to pick up a shipment



`Function CreateCourierInvitation(Val Token, Val InvitationDescription, Val TestAPI = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Auth token |
  | InvitationDescription | --intake | Structure Of KeyAndValue | &#x2714; | Invitations description. See GetCourierInvitationsDescription |
  | TestAPI | --testapi | Boolean | &#x2716; | Flag to use test API for requests |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from CDEK

:::tip
Method at API documentation: [Registration of refusal](https://api-docs.cdek.ru/55327686.html)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token       = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9. ...";
    CurrentDate = OPI_Tools.GetCurrentDate();

    InvitationDescription = New Structure;
    InvitationDescription.Insert("intake_date"     , Format(CurrentDate + 60 * 60 * 24, "DF=yyyy-MM-dd"));
    InvitationDescription.Insert("intake_time_from", "10:00");
    InvitationDescription.Insert("intake_time_to"  , "17:00");
    InvitationDescription.Insert("name"            , "Consolidated cargo");
    InvitationDescription.Insert("weight"          , 1000);
    InvitationDescription.Insert("length"          , 10);
    InvitationDescription.Insert("width"           , 10);
    InvitationDescription.Insert("height"          , 10);
    InvitationDescription.Insert("comment"         , "Comment to courier");
    InvitationDescription.Insert("need_call"       , False);

    Sender = New Structure;
    Sender.Insert("company", "Company");
    Sender.Insert("name"   , "Ivaniv Ivan");

    Phones = New Array;
    Phone  = New Structure("number", "+79589441654");
    Phones.Add(Phone);

    Sender.Insert("phones", Phones);

    InvitationDescription.Insert("sender", Sender);

    ShippingPoint = New Structure;
    ShippingPoint.Insert("code"        , "44");
    ShippingPoint.Insert("fias_guid"   , "0c5b2444-70a0-4932-980c-b4dc0d3f02b5");
    ShippingPoint.Insert("postal_code" , "109004");
    ShippingPoint.Insert("longitude"   , 37.6204);
    ShippingPoint.Insert("latitude"    , 55.754);
    ShippingPoint.Insert("country_code", "RU");
    ShippingPoint.Insert("region"      , "Moscow");
    ShippingPoint.Insert("sub_region"  , "Moscow");
    ShippingPoint.Insert("city"        , "Moscow");
    ShippingPoint.Insert("kladr_code"  , "7700000000000");
    ShippingPoint.Insert("address"     , "st. Bluchera, 32");

    InvitationDescription.Insert("from_location", ShippingPoint);

    Result = OPI_CDEK.CreateCourierInvitation(Token, InvitationDescription, True);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint cdek CreateCourierInvitation \
             --token "***" \
             --intake "{'intake_date':'2025-12-11','intake_time_from':'10:00','intake_time_to':'17:00','name':'Consolidated cargo','weight':'1000','length':'10','width':'10','height':'10','comment':'Comment to courier','need_call':false,'sender':{'company':'Company','name':'Ivaniv Ivan','phones':[{'number':'+79589441654'}]},'from_location':{'code':'44','fias_guid':'0c5b2444-70a0-4932-980c-b4dc0d3f02b5','postal_code':'109004','longitude':'37.6204','latitude':'55.754','country_code':'RU','region':'Moscow','sub_region':'Moscow','city':'Moscow','kladr_code':'7700000000000','address':'st. Bluchera, 32'}}" \
             --testapi "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint cdek CreateCourierInvitation ^
             --token "***" ^
             --intake "{'intake_date':'2025-12-11','intake_time_from':'10:00','intake_time_to':'17:00','name':'Consolidated cargo','weight':'1000','length':'10','width':'10','height':'10','comment':'Comment to courier','need_call':false,'sender':{'company':'Company','name':'Ivaniv Ivan','phones':[{'number':'+79589441654'}]},'from_location':{'code':'44','fias_guid':'0c5b2444-70a0-4932-980c-b4dc0d3f02b5','postal_code':'109004','longitude':'37.6204','latitude':'55.754','country_code':'RU','region':'Moscow','sub_region':'Moscow','city':'Moscow','kladr_code':'7700000000000','address':'st. Bluchera, 32'}}" ^
             --testapi "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "entity": {
  "uuid": "2a75c7f0-9f49-4667-802c-eeed87903e84"
 },
 "requests": [
  {
   "request_uuid": "dc6b1e76-a459-4b07-9035-50a0c2c50b5f",
   "type": "CREATE",
   "date_time": "2025-12-10T20:10:25+00:00",
   "state": "ACCEPTED"
  }
 ],
 "related_entities": []
}
```
