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: 2
|
|
description: Update order 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';
|
|
|
|
# Update order
|
|
Changes the field values of the selected order
|
|
|
|
|
|
|
|
`Function UpdateOrder(Val Token, Val UUID, Val OrderDescription, Val TestAPI = False) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Token | --token | String | ✔ | Auth token |
|
|
| UUID | --uuid | String | ✔ | Order UUID for updating |
|
|
| OrderDescription | --order | Structure Of KeyAndValue | ✔ | Set of changing order fields |
|
|
| 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: [Update an order](https://api-docs.cdek.ru/36989543.html)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJsb2NhdGlvbjphbGwiLCJvcmRlcjphbGwiLCJwYXltZW50OmFsbCJdLCJleHAiOjE3NDc3NzYzMjQsImF1dGhvcml0aWVzIjpbInNoYXJkLWlkOnJ1LTAxIiwiY2xpZW50LWNpdHk60J3QvtCy0L7RgdC40LHQuNGA0YHQuiwg0J3QvtCy0L7RgdC40LHQuNGA0YHQutCw0Y8g0L7QsdC70LDRgdGC0YwiLCJjb250cmFjdDrQmNCcLdCg0KQt0JPQm9CTLTIyIiwiYWNjb3VudC1sYW5nOnJ1cyIsImFjY291bnQtdXVpZDplOTI1YmQwZi0wNWE2LTRjNTYtYjczNy00Yjk5YzE0ZjY2OWEiLCJhcGktdmVyc2lvbjoxLjEiLCJjbGllbnQtaWQtZWM1OmVkNzVlY2Y0LTMwZWQtNDE1My1hZmU5LWViODBiYjUxMmYyMiIsImNvbnRyYWN0LWlkOmRlNDJjYjcxLTZjOGMtNGNmNS04MjIyLWNmYjY2MDQ0ZThkZiIsImNsaWVudC1pZC1lYzQ6MTQzNDgyMzEiLCJzb2xpZC1hZGRyZ...";
|
|
UUID = "db1a3e7c-adbe-4052-81d7-9180ecb1dc11";
|
|
|
|
OrderDescription = New Structure("comment", "NewComment");
|
|
|
|
Result = OPI_CDEK.UpdateOrder(Token, UUID, OrderDescription, True);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
# JSON data can also be passed as a path to a .json file
|
|
|
|
oint cdek UpdateOrder \
|
|
--token "***" \
|
|
--uuid "a9f88b45-cbdd-4b73-a1b4-c3bc77e35729" \
|
|
--order "{'comment':'NewComment'}" \
|
|
--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 UpdateOrder ^
|
|
--token "***" ^
|
|
--uuid "a9f88b45-cbdd-4b73-a1b4-c3bc77e35729" ^
|
|
--order "{'comment':'NewComment'}" ^
|
|
--testapi "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"entity": {
|
|
"uuid": "a93fd1b1-55b3-4033-a52a-d2df7bb6b469"
|
|
},
|
|
"requests": [
|
|
{
|
|
"request_uuid": "7492bd86-fb08-4d14-95fe-64d51a823d66",
|
|
"type": "UPDATE",
|
|
"date_time": "2024-10-21T21:27:52+03:00",
|
|
"state": "ACCEPTED"
|
|
}
|
|
],
|
|
"related_entities": []
|
|
}
|
|
```
|