Skip to content

Update of order status

Request

The endpoint enables the order status, “paid” flag and payment method to be updated. This data must be set during a call.

All the fields to be updated are optional, but at least one has to be specified.

If the key value is "text" for NULL additional field, the originally saved text in this field will be deleted.

If a non-existing key is entered, or the call is erroneous in another way, no item is updated.

If you call the status setting within your request, which has "set the order as paid" in the definition, and at the same time you required

a change of paid to false, the order status will be carried out and the paid value set to false.

If the status definition includes sending an e-mail, such an e-mail will be sent. If not required, sending an e-mail can be suppressed with the

?suppressEmailSending=true parameter. Similarly, sending information SMS messages when the order is changed (if set) can be suppressed with the ?suppressSmsSending=true parameter. In analogy, if the status includes document generation (for example a proforma invoice), the document will be generated (if not existent). The generation can be suppressed with the ?suppressDocumentGeneration=true parameter.

This endpoint tries not to unnecessarily change the order status. If you try to set the status that the order already has, no change is done and no document is generated.

When calling the same requests in parallel, there is the risk that there may be concurrence and related actions may be executed twice. Therefore we recommend calling this request from one source only, in a serial manner.

Order status change might imply automatic documents (e. g. invoice) generation. In exceptional cases the generation might fail,

although the order status itself gets actually changed. In such case the API return status code 200 (OK), but in the data field

you can find the order details and in the errors array eventually details about the failed documents generation. The error

code is document-not-generated. Example of an error message:


"errors": [
    {
        "errorCode": "document-not-generated",
        "message": "Delivery note belonging to order \"2020000149\" was not created. Generating document code failed.",
        "instance": "2020000149"
    }
]
Security
shoptetAccessToken or shoptetPrivateApiToken
Path
codestringrequired
Example:2018000012
Query
suppressDocumentGenerationboolean

suppress the generation of linked documents.

Default:false
Example:suppressDocumentGeneration=true
suppressEmailSendingboolean

suppress sending the linked information e-mails.

Default:false
Example:suppressEmailSending=true
suppressSmsSendingboolean

suppress sending the linked information SMS messages.

Default:false
Example:suppressSmsSending=true
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
dataobject, non-emptyrequired
curl -i -X PATCH \
  'https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/orders/2018000012/status?suppressDocumentGeneration=true&suppressEmailSending=true&suppressSmsSending=true' \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "data": {
      "statusId": -1,
      "paid": true,
      "billingMethodId": 1
    }
  }'

Responses

OK

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "order": {} }, "errors": [ {} ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }