# Update of order status 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 to , the order status will be carried out and the value set to . 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 parameter. Similarly, sending information SMS messages when the order is changed (if set) can be suppressed with the 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 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 field you can find the order details and in the array eventually details about the failed documents generation. The error code is . Example of an error message: Endpoint: PATCH /api/orders/{code}/status Version: 1.0.0 Security: shoptetAccessToken, shoptetPrivateApiToken ## Path parameters: - `code` (string, required) Example: "2018000012" ## Query parameters: - `suppressDocumentGeneration` (boolean) suppress the generation of linked documents. Example: true - `suppressEmailSending` (boolean) suppress sending the linked information e-mails. Example: true - `suppressSmsSending` (boolean) suppress sending the linked information SMS messages. Example: true ## Header parameters: - `Content-Type` (string, required) ## Request fields (application/json): - `data` (object, required) - `data.statusId` (number) New order status. The order statuses are specific for each e-shopand it is possible to gain these from the endpoint [Eshop info](#tag/eshop/geteshopinfo) with the parameter - `data.paid` (boolean,null) paid flag - `data.billingMethodId` (number) billing method identifier - see also [Invoice billing methods](#section/code-lists/invoice-billing-methods) code list ## Response 200 fields (application/json): - `data` (object, required) - `data.order` (object, required) - `data.order.code` (string, required) order number. Caution! This does not have to be just a number, it can also contain letters, a dash, etc. - `data.order.guid` (string, required) global unique permanent order identifier (can be for old orders) - `data.order.externalCode` (string,null, required) Identification of the order in external system (or ). - `data.order.creationTime` (string,null, required) date and time, when the order was created. ISO 8601 format. - `data.order.changeTime` (string,null, required) date and time of the order's last change. ISO 8601 format. - `data.order.email` (string,null, required) purchaser e-mail (can be ) - `data.order.phone` (string,null, required) purchaser phone number (can be ) - `data.order.birthDate` (string,null) customer's date of birth stated in the order - `data.order.clientIPAddress` (string,null, required) IP address of the client who made the order - `data.order.customerGuid` (any, required) customer identifier, if the customer is registered in the e-shop (can be ) - `data.order.cashDeskOrder` (boolean, required) flag, whether the order is from the cash desk (as opposed to the e-shop) - `data.order.stockId` (number, required) identifier of the stock, from which the order was taken - `data.order.addressesEqual` (boolean, required) flag, whether the delivery address is the same as the invoicing address - `data.order.vatPayer` (boolean, required) Is the tradesman a VAT payer, when purchasing? (can be , if this is unknown) - `data.order.vatMode` (string,null) VAT mode, for possible values see [VAT modes](#section/code-lists/vat-modes) code list - `data.order.billingMethod` (any, required) - `data.order.paymentMethod` (any, required) - `data.order.shipping` (object,null, required) - `data.order.shipping.guid` (string, required) transport type identifier - `data.order.shipping.name` (string, required) description of transport method (Czech post, PPL, in person..) - `data.order.shippingDetails` (object,null) - `data.order.shippingDetails.branchId` (string,null, required) branch identifier - `data.order.shippingDetails.shippingCompanyCode` (string,null, required) identification of the carrier - `data.order.shippingDetails.shippingServiceCode` (string,null) identification of the carrier's service - `data.order.shippingDetails.name` (string,null, required) name of the branch - `data.order.shippingDetails.note` (string,null, required) branch location note, can contain HTML - `data.order.shippingDetails.place` (string,null, required) location (specify location within address). - `data.order.shippingDetails.street` (string,null, required) street - `data.order.shippingDetails.city` (string,null, required) city/town - `data.order.shippingDetails.zipCode` (string,null, required) ZIP or postal code - `data.order.shippingDetails.countryCode` (string,null, required) country code - `data.order.shippingDetails.link` (string,null, required) link to the branch's website - `data.order.shippingDetails.latitude` (string,null, required) GPS coordinates - north latitude - `data.order.shippingDetails.longitude` (string,null, required) GPS coordinates - east longitude - `data.order.shippingDetails.carrierId` (integer,null, required) identification of the carrier - now it's used for Zasilkovna only. The value is for Czech Zasilkovna or carrier ID for Zasilkovna in the other countries. - `data.order.adminUrl` (string, required) URL to administration leading to order detail. URL keeps the administration language settings. - `data.order.status` (object,null, required) - `data.order.status.name` (string,null, required) status name - `data.order.status.id` (number, required) status identifier - `data.order.source` (object,null) source of the order - `data.order.source.name` (string,null, required) source name - `data.order.source.id` (number, required) source identifier - `data.order.price` (object, required) price of the order - `data.order.price.vat` (string,null, required) VAT value, two decimal places - `data.order.price.toPay` (string,null, required) total price to pay - `data.order.price.currencyCode` (string, required) currency code. List of available currencies within the e-shop can be found in endpoint . - `data.order.price.withoutVat` (string,null, required) price excluding tax - `data.order.price.withVat` (string,null, required) price including tax - `data.order.price.exchangeRate` (string, required) currency rate of the receipt for the default currency of the shop. This value is saved together with the price and reflects the historical value valid in the instant of the order creation. If the shop changes the default currency, the value still refers to the original currency! - `data.order.price.invoicingExchangeRate` (string) currency rate of the receipt for the default currency of the shop. This value is saved together with the price and reflects the historical value valid in the instant of the order creation. If the shop changes the default currency, the value still refers to the original currency! - `data.order.price.partialPaymentAmount` (string,null) can be value expressed in percents or as exact money value expression (with up to two decimal places) - depends on partialPaymentType value - `data.order.price.partialPaymentType` (string) 'percents' = partial payment as percentage from total price | 'absolute' = exact expression of partial payment in money - `data.order.paid` (boolean,null, required) flag, whether the order was paid. In addition to a , can also be , if the payment status is unknown. - `data.order.billingAddress` (object, required) - `data.order.billingAddress.company` (string,null, required) name of purchaser''s company (or ) - `data.order.billingAddress.fullName` (string,null, required) name of purchaser (or ) - `data.order.billingAddress.street` (string,null, required) street of purchaser (or ) - `data.order.billingAddress.houseNumber` (string,null, required) street number (or ) - `data.order.billingAddress.city` (string,null, required) city/town (village) (or ) - `data.order.billingAddress.district` (string,null, required) county (or ) - `data.order.billingAddress.additional` (string,null, required) additional address information (or ) - `data.order.billingAddress.zip` (string,null, required) ZIP or postal code (or ) - `data.order.billingAddress.countryCode` (string,null, required) tree-character ISO country code (ISO 4217) - `data.order.billingAddress.regionName` (string,null, required) region name (or ) - `data.order.billingAddress.regionShortcut` (string,null, required) region abbreviation (or ) - `data.order.billingAddress.companyId` (string,null, required) Company registration number. (can be ) - `data.order.billingAddress.vatId` (string,null, required) VAT identification number. (can be ) - `data.order.billingAddress.vatIdValidationStatus` (any) Info, whether VAT ID has been verified, enum [, , ] Enum: "unverified", "verified", "waiting", null - `data.order.billingAddress.taxId` (string,null, required) TAX identification number. For Czech address, taxId is same as vatId. (can be ) - `data.order.deliveryAddress` (object,null, required) - `data.order.onlinePaymentLink` (string,null) URL to online payment - `data.order.language` (string) language code of the order - `data.order.referer` (string,null) which page (url) has the user come from - `data.order.paymentMethods` (array) all order payment methods - `data.order.paymentMethods.itemId` (number, required) payment method identifier within order - `data.order.shippings` (array) all order shippings - `data.order.shippings.shipping` (object, required) transport method - `data.order.shippings.shipping.guid` (string,null, required) transport method identifier - `data.order.shippings.shipping.name` (string, required) description of transport method - `data.order.shippings.itemId` (number, required) transport method identifier within order - `data.order.items` (array, required) all order items - `data.order.items.productGuid` (any, required) product identifier of the item. At the time the order is created, it will be entered in this field, but when the product is deleted, the link will be lost (can be ) - `data.order.items.code` (string,null, required) identifier of the item code (product or variant). At the time the order is created, it will be entered in this field, but when the product is deleted, the link will be lost. - `data.order.items.ean` (string,null, required) EAN of the product variant (can be ) - `data.order.items.itemType` (string, required) Order item type (product, service...). See also [Types of order items](#section/code-lists/types-of-order-items) code list. - `data.order.items.productType` (string,null) Product type at the time of the order (product, product-set..). See also [Product types](#section/code-lists/product-types) code list (can be ). - `data.order.items.name` (string, required) Product name, with possible addition () - `data.order.items.variantName` (string,null, required) variant name (can be ) - `data.order.items.brand` (string,null, required) product brand (or manufacturer, possibly) - `data.order.items.remark` (string,null, required) remark - `data.order.items.weight` (string, required) weight in kg, unpacked (can be ). 3 decimal places. Maximum value 999999. - `data.order.items.additionalField` (string,null, required) additional field for remarks - `data.order.items.amount` (string,null, required) product quantity - `data.order.items.amountUnit` (string,null, required) product unit of quantity - `data.order.items.priceRatio` (string, required) price coefficient. This also represents a discount (discount means ) - `data.order.items.itemPrice` (object, required) the price of the item including the discount () and quantity (). - `data.order.items.itemPrice.vatRate` (string, required) VAT rate - `data.order.items.displayPrices` (array) - `data.order.items.purchasePrice` (any, required) purchase price of item, can be . - `data.order.items.recyclingFee` (object,null, required) recycling fee including category and price (or possibly ). - `data.order.items.recyclingFee.category` (string, required) Recycling fee category name. - `data.order.items.recyclingFee.fee` (string,null, required) Recycling fee. - `data.order.items.recyclingFee.unit` (any) Recycling fee unit. Enum: "pcs", "kg" - `data.order.items.mainImage` (object,null) - `data.order.items.mainImage.name` (string, required) image file name, also serves as an identifier for the image of the product. To assemble complete URL, it is added to the obtained from the endpoint e-shop info . - `data.order.items.mainImage.seoName` (string, required) file name modified for SEO - a short label is attached. - `data.order.items.mainImage.cdnName` (string, required) same as with attached hashed last image change time. , and can be entered in the URL - redirect will deliver the same image. - `data.order.items.mainImage.priority` (number, required) the key for the sequence of images matching the sequence in administration - it's not necessarily from the first, and the series may contain gaps. (can be ). - `data.order.items.mainImage.description` (string,null, required) description of the image (can be ). - `data.order.items.mainImage.changeTime` (string,null, required) last image change time If you are saving images together, you can use this timestamp to indicate if you need to reload the image. (can be ). - `data.order.items.stockLocation` (string,null) position in stock (can be ) - `data.order.items.supplierName` (string,null) product supplier (can be ) - `data.order.items.itemId` (number, required) order item identifier - `data.order.items.warrantyDescription` (string,null, required) textual description of warranty length (can be ) - `data.order.items.surchargeParameters` (array) items surcharge parameters, filled in order creation. Cannot be edited. - `data.order.items.surchargeParameters.parameterName` (object) surcharge parameter name's information - `data.order.items.surchargeParameters.parameterName.code` (string,null) parameters name code, can be null if already deleted - `data.order.items.surchargeParameters.parameterName.name` (string) parameters name - `data.order.items.surchargeParameters.parameterValue` (object) surcharge parameter value's information - `data.order.items.surchargeParameters.parameterValue.valueIndex` (string,null) parameters value code, can be null if already deleted - `data.order.items.surchargeParameters.parameterValue.description` (string) parameters value name - `data.order.items.surchargeParameters.parameterValue.price` (string,null) parameters value additional price - `data.order.items.specificSurchargeParameters` (array) list of specific surcharge parameters for order item detail, created from , but editable in order item detail in eshop administration or via order item detail surcharge-parameters endpoint. - `data.order.items.specificSurchargeParameters.relationId` (string, required) id which identifies relation between item and surcharge. Can be used to delete surcharge parameter related to item. - `data.order.items.specificSurchargeParameters.name` (string, required) full name of surcharge parameter. - `data.order.items.specificSurchargeParameters.price` (string,null, required) price of surcharge parameter - `data.order.items.productFlags` (array) list of product flags - `data.order.items.productFlags.code` (string, required) flag identifier - `data.order.items.productFlags.title` (string, required) flag title - `data.order.items.productFlags.system` (boolean, required) is it a system flag common for all e-shops? - `data.order.items.consumptionTax` (object,null) consumption tax of order item - `data.order.items.consumptionTax.currency` (string, required) currency code. List of available currencies within the e-shop can be found in endpoint . - `data.order.items.consumptionTax.price` (string,null, required) consumption tax value - `data.order.items.buyPrice` (any) purchase price of the item including the discount () and quantity (). (or possibly ) - `data.order.items.amountCompleted` (string,null, required) quantity of completed product. Deprecated - use section instead. - `data.order.items.surchargeParametersTexts` (array) List of custom surcharge parameters names - `data.order.notes` (object) order notes (only filled in on request if is listed) - `data.order.notes.customerRemark` (string,null, required) customer note - `data.order.notes.eshopRemark` (string,null, required) e-shop order remark. - `data.order.notes.trackingNumber` (string,null, required) shipment number - `data.order.notes.trackingUrl` (string,null, required) package trace link (can be ) - `data.order.notes.additionalFields` (array, required) can contain up to six additional fields, which can be freely used by e-shop for its individual needs. - `data.order.notes.additionalFields.index` (integer, required) sequence number - `data.order.notes.additionalFields.label` (string, required) item name. The name of the field can be edited in the e-shop administration. - `data.order.notes.additionalFields.text` (string,null, required) item value (can be ) - `data.order.preAuthorization` (object) - `data.order.preAuthorization.hasPendingPreAuthorization` (boolean, required) - `data.order.preAuthorization.preAuthorizationAmount` (string, required) pre-authorization amount of the order. If null, the order is not pre-authorized. If not present, pre-authorization is not supported. - `data.order.completion` (array) All order items completion status. Contains completion info even for product set items. - `data.order.completion.productGuid` (any, required) - `data.order.completion.name` (string, required) Product name - `data.order.completion.itemId` (number,null, required) Order item identifier. This field is null for product set items. - `data.order.completion.amountCompleted` (string,null, required) quantity of completed product - `data.order.completion.parentProductSetItemId` (number) identifier of the parent product set item, if the item is a product set item. If the item is not a product set item, this field is not present. - `errors` (array,null, required) - `errors.errorCode` (string, required) Short text error identification - `errors.message` (string, required) Descriptive error message - `errors.instance` (string, required) Identification of the entity referenced ## Response 404 fields (application/json): - `data` (object,null) - `errors` (array,null) - `errors.errorCode` (string, required) Short text error identification - `errors.message` (string, required) Descriptive error message - `errors.instance` (string, required) Identification of the entity referenced