---
title: "Update order"
method: PUT
path: "/orders/{id}"
tags: ["Orders"]
---

# Update order

`PUT /orders/{id}`

Updates an existing order by its ID.

Orders are the central resource in the API. Updating an order may also update related order sub-resources when they are included in the request payload, according to server-side validations.

Only fields supported by the API can be modified.

## Path parameters

- `id` string, required

## Headers

- `Accept-Language` 'es' | 'en'

## Request body

- OrderUpdateRequest — Order update payload. Only supported fields can be modified.
  - `currency` string — Currency code in ISO 4217 (3-letter uppercase).
  - `customer_info` union
    - CustomerInfo
      - `customer_id` string
      - `name` string, required
      - `email` string, email, required
      - `phone` string
      - `corporate` boolean
    - CustomerInfoJustCustomerId
      - `customer_id` string, required
  - `line_items` Product[] — List of [products](https://developers.femsa.com/v2.1.0/reference/orderscreateproduct) that are sold in the order. You must have at least one product.
    - `name` string, required — The name of the item. It will be displayed in the order.
    - `unit_price` integer, required — The price of the item in cents.
    - `quantity` integer, required — The quantity of the item in the order.
    - `sku` string — The stock keeping unit for the item. It is used to identify the item in the order.
    - `brand` string — The brand of the item.
    - `description` string — Short description of the item
    - `tags` string[] — List of tags for the item. It is used to identify the item in the order.
    - `metadata` object — Arbitrary key-value data for your internal use. Keys should be strings; values can be any JSON value.
  - `charges` ChargeRequest[]
    - `amount` integer
    - `payment_method` ChargeRequestPaymentMethod, required — Payment method used in the charge.
      - `expires_at` integer — Method expiration date as unix timestamp (applies to some payment methods, e.g. cash).
      - `type` string, required
      - `payment_source_id` string — Identifier of a saved payment source to be used for this charge (if applicable).
    - `reference_id` string — Custom reference to add to the charge
  - `discount_lines` OrderDiscountLinesRequest[] — List of [discounts](https://developers.femsa.com/v2.1.0/reference/orderscreatediscountline) that are applied to the order. You must have at least one discount.
    - `amount` integer, required — The amount to be deducted from the total sum of all payments, in cents.
    - `code` string, required — Discount code.
    - `type` string, required — It can be 'loyalty', 'campaign', 'coupon' o 'sign'
  - `tax_lines` OrderTaxRequest[]
    - `amount` integer, required — The amount to be collected for tax in cents
    - `description` string, required — description or tax's name
    - `metadata` object
  - `shipping_contact_id` string, nullable — Existing shipping contact id from the customer to link to this order.
  - `shipping_contact` CustomerShippingContacts — [Shipping](https://developers.femsa.com/v2.1.0/reference/createcustomershippingcontacts) details, required in case of sending a shipping. If we do not receive a shipping_contact on the order, the default shipping_contact of the customer will be used.
    - `phone` string — Phone contact
    - `receiver` string — Name of the person who will receive the order
    - `between_streets` string — The street names between which the order will be delivered.
    - `address` CustomerShippingContactsAddress, required — Address of the person who will receive the order
      - `street1` string
      - `street2` string
      - `postal_code` string
      - `city` string
      - `state` string
      - `country` string — this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
      - `residential` boolean, nullable
    - `parent_id` string
    - `default` boolean, nullable
    - `deleted` boolean, nullable
    - `metadata` object — Metadata associated with the shipping contact
  - `shipping_lines` ShippingRequest[] — List of [shipping costs](https://developers.femsa.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products.
    - `amount` integer, required — Shipping amount in cents
    - `carrier` string — Carrier name for the shipment
    - `tracking_number` string — Tracking number can be used to track the shipment
    - `method` string — Method of shipment
    - `description` string — Shipping line description
    - `metadata` object — Hash where the user can send additional information for each 'shipping'.
  - `fiscal_entity_id` string, nullable — Existing fiscal entity id from the customer to link to this order.
  - `fiscal_entity` OrderUpdateFiscalEntityRequest — Fiscal entity of the order, Currently it is a purely informative field
    - `address` FiscalEntityAddress, required — Address of the fiscal entity
      - `street1` string, required — Street name and number
      - `street2` string, nullable — Street name and number
      - `postal_code` string, required — Postal code
      - `city` string, required — City
      - `state` string — State
      - `country` string, required — this field follows the [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
      - `external_number` string, required — External number
    - `email` string — Email of the fiscal entity
    - `name` string, nullable — Name of the fiscal entity
    - `metadata` object — Arbitrary key-value data associated with the fiscal entity for your internal use. Keys should be strings; values can be any JSON value.
    - `phone` string — Phone of the fiscal entity
    - `tax_id` string, nullable — Tax ID of the fiscal entity
  - `return_url` string — URL where the customer should be redirected after completing a payment flow (if applicable).
  - `metadata` object — Arbitrary key-value data that you can attach to the order for your internal use. It is not used for payment processing. Keys should be strings; values can be any JSON value.
  - `status` string — Order status update (only allowed transitions will be accepted).

## Response `200`

successful operation

## Other responses

- `401` — authentication error
- `404` — not found entity
- `422` — parameter validation error
- `500` — internal server error

---

[API](https://skmtc.dev/digitalfemsa/apis/femsa-api.md) · [All operations](https://skmtc.dev/digitalfemsa/apis/femsa-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/digitalfemsa/femsa-api/revisions/2e43caddf36b/schema)
