updateOrderByMarkerAndId
Order modification in the order storage. 🔐 This method requires authorization?.
Orders?.updateOrderByMarkerAndId( marker?, body?, langCode? );
Minimal example
const body = {
"formIdentifier": "orderForm",?"paymentAccountIdentifier": "cash",?"formData": {
?{
"marker": "order_name",?"type": "string",?"value": "Ivan"?}},"products": [?{
"productId": 2,?"quantity": 2?}]}
const value = await Orders.updateOrderByMarkerAndId("my-order", 1, body)
Schema
marker(required): string
The text identifier of the order storage object
example: "order_storage_1"
id(required): number
ID of the order object
example: 12345
body(required): IOrderData
Object for updating an order
example:
{
"formIdentifier": "bar-orders-form",
"paymentAccountIdentifier": "usd-payment",
"formData": {
"marker": "name_1",
"value": "Name",
"type": "string"
},
"products": [
{
"productId": 1,
"quantity": 2
}
],
"currency": "USD"
}
formIdentifier(required): string
Text identifier of the form object linked to the order repository.
example: "bar-orders-form"
paymentAccountIdentifier(required): string
Text identifier of the payment object linked to the order repository.
example: "payment-1"
formData(required): IOrdersFormData | IOrdersFormData[]
Form data linked to the order repository.
example:
[
{
"marker": "name_1",
"value": "Name",
"type": "string"
}
]
marker(required): string
Marker of form field.
example: "name_1"
value(required): string
Value.
example: "Name"
type(required): string
Type of value.
example: "string"
products(required): IOrderProductData[]
An array of ordered products.
langCode: string
Language code. Default: "en_US"
example: "en_US"
This method update one order storage object by marker. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument
Example response
{
"id": 55,
"formIdentifier": "orderForm",
"paymentAccountIdentifier": "cash",
"formData": [
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
],
"products": [
{
"productId": 2957,
"quantity": 2
}
],
"currency": "",
"totalSum": 300
}
Schema
id: number
Object identifier.
example: 1
formIdentifier: string
Text identifier of the form.
example: "bar-orders-form"
paymentAccountIdentifier: string
Text identifier of the order payment.
example: "payment-1"
formData: IOrdersFormData[]
Data submitted by the form linked to the order store.
example:
[
{
"marker": "name_1",
"value": "Name",
"type": "string"
}
]
products: IOrderProducts[]
Array of products added to order.
example:
[
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": null,
"price": 150,
"quantity": 2
}
]
currency: string
Currency used to pay for the order.
example: "USD"
totalSum: number
Total order amount.
example: NaN
createdDate: string
Order creation date.
example: "2023-10-01T12:00:00Z"
statusIdentifier: string
Text identifier of order status object (if not set, default status will be assigned).
example: "status-1".
/