> ## Documentation Index
> Fetch the complete documentation index at: https://developers.cubbo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update shipping contact and address fields

> Partially updates the recipient and shipping address of an order. Send only the fields you want
to change; a field that is absent or `null` is left untouched, an empty string clears it. The
response echoes exactly the fields you changed with their saved values.
- Allowed in every status except `shipped`, `returning`, `returned`, `return_arrived` and
  `reentered`. Unlike `PUT /orders/{id}`, this works during `processing`, `picking` and
  `packing` (for example to fix an address before the label is generated).
- An order in `pending` goes back to `initial` and is re-processed; an order in another
  editable status is re-processed without a status change. Orders in `canceled`, `interrupted`
  or in fulfillment (`processing`, `picking`, `packing`) are saved but not re-processed.
- At least one field must be provided.
- Colombia: changing `shipping_city` or `shipping_state` clears the order's `city_code`, and the
  city and province decide the destination again. To keep deciding by code, use
  `PUT /orders/{id}` with `shipping.city_code`.
- Requires an API user with the "orders update" permission and access to the store. The order
  must also be editable for your store: a Brazilian order whose NF-e was approved more than
  24 hours ago, or a store with order editing restricted by Cubbo, is answered with `401`.




## OpenAPI

````yaml /openapi.yaml patch /orders/{id}
openapi: 3.1.0
info:
  title: Cubbo Clients API
  version: '1.0'
  summary: >-
    Orders, inventory, replenishments, returns, shipping and webhooks for Cubbo
    fulfillment.
  description: >
    The Cubbo Clients API connects your store, ERP or marketplace with Cubbo's
    fulfillment network.

    All endpoints except `POST /auth/token` require a bearer token; see the
    Authentication guide.

    Request and response bodies are JSON. Errors are JSON objects with an
    `error` key.
  contact:
    name: Cubbo integrations
    email: integraciones@cubbo.com
servers:
  - url: https://api.cubbo.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange client credentials for a bearer token.
  - name: Orders
    description: Create, update, hold, cancel and read sales orders.
  - name: Shipping labels
    description: Read the shipping labels generated for an order.
  - name: Inventory
    description: Products and stock per store.
  - name: Lots
    description: Lot-level inventory for products with expiration or batch tracking.
  - name: Reports
    description: Bulk reports for reconciliation.
  - name: Replenishments
    description: Inbound shipments to the warehouse.
  - name: Returns
    description: Returns and exchanges.
  - name: Stores
    description: Store provisioning and settings.
  - name: Shipping methods
    description: Available shipping methods, coverage and quotes.
  - name: Click and collect
    description: Pickup points and in-store pickup orders.
paths:
  /orders/{id}:
    patch:
      tags:
        - Orders
      summary: Update shipping contact and address fields
      description: >
        Partially updates the recipient and shipping address of an order. Send
        only the fields you want

        to change; a field that is absent or `null` is left untouched, an empty
        string clears it. The

        response echoes exactly the fields you changed with their saved values.

        - Allowed in every status except `shipped`, `returning`, `returned`,
        `return_arrived` and
          `reentered`. Unlike `PUT /orders/{id}`, this works during `processing`, `picking` and
          `packing` (for example to fix an address before the label is generated).
        - An order in `pending` goes back to `initial` and is re-processed; an
        order in another
          editable status is re-processed without a status change. Orders in `canceled`, `interrupted`
          or in fulfillment (`processing`, `picking`, `packing`) are saved but not re-processed.
        - At least one field must be provided.

        - Colombia: changing `shipping_city` or `shipping_state` clears the
        order's `city_code`, and the
          city and province decide the destination again. To keep deciding by code, use
          `PUT /orders/{id}` with `shipping.city_code`.
        - Requires an API user with the "orders update" permission and access to
        the store. The order
          must also be editable for your store: a Brazilian order whose NF-e was approved more than
          24 hours ago, or a store with order editing restricted by Cubbo, is answered with `401`.
      operationId: patchOrderShippingFields
      parameters:
        - name: id
          in: path
          required: true
          description: Cubbo order id.
          schema:
            type: integer
          example: 123456
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderPatchRequest'
            example:
              shipping_address_1: Calle Falsa 123
              shipping_number: '123'
              shipping_number_int: '4'
              shipping_neighborhood: Centro
              shipping_zip_code: '06600'
              shipping_references: Blue door, ring twice
      responses:
        '200':
          description: >-
            The fields that were updated, with the values now stored on the
            order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPatchResponse'
              example:
                shipping_address_1: Calle Falsa 123
                shipping_number: '123'
                shipping_number_int: '4'
                shipping_neighborhood: Centro
                shipping_zip_code: '06600'
                shipping_references: Blue door, ring twice
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: Another request is modifying this order right now. Retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  Order is being processed by another request. Please try again
                  in a moment.
        '422':
          description: Validation or business error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                noFields:
                  value:
                    error: No fields to update were provided.
                statusNotEditable:
                  value:
                    error: Order id 123456 has status shipped, cannot update fields.
                orderNotFound:
                  value:
                    error: Couldn't find Order with 'id'=123456
                invalidParam:
                  value:
                    error: '''123'' is not a valid String'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    OrderPatchRequest:
      type: object
      description: >-
        Partial update of the shipping contact and address. Send only the fields
        to change; at least one is required.
      minProperties: 1
      properties:
        shipping_first_name:
          type: string
          description: Recipient first name.
          example: Jane
        shipping_last_name:
          type: string
          description: Recipient last name.
          example: Buyer
        shipping_phone:
          type: string
          description: Recipient phone number.
          example: '5551234567'
        shipping_email:
          type: string
          description: Recipient email.
          example: buyer@example.com
        shipping_address_1:
          type: string
          description: Street and number (first address line).
          example: Calle Falsa 123
        shipping_address_2:
          type: string
          description: Second address line (apartment
          floor: null
          complement).: null
          example: Depto 4
        shipping_neighborhood:
          type: string
          description: Neighborhood (colonia / bairro).
          example: Centro
        shipping_references:
          type: string
          description: Delivery references for the carrier.
          example: Blue door, ring twice
        shipping_number:
          type: string
          description: Street number kept apart from the street name (Brazil).
          example: '123'
        shipping_number_int:
          type: string
          description: Interior or apartment number.
          example: '4'
        shipping_city:
          type: string
          description: City.
          example: Ciudad de Mexico
        shipping_state:
          type: string
          description: State or province.
          example: CDMX
        shipping_zip_code:
          type: string
          description: Postal code.
          example: '06600'
    OrderPatchResponse:
      type: object
      description: >-
        Only the fields that were sent in the request, with the values now
        stored on the order.
      properties:
        shipping_first_name:
          type:
            - string
            - 'null'
          description: Recipient first name.
          example: Jane
        shipping_last_name:
          type:
            - string
            - 'null'
          description: Recipient last name.
          example: Buyer
        shipping_phone:
          type:
            - string
            - 'null'
          description: Recipient phone number.
          example: '5551234567'
        shipping_email:
          type:
            - string
            - 'null'
          description: Recipient email.
          example: buyer@example.com
        shipping_address_1:
          type:
            - string
            - 'null'
          description: First address line.
          example: Calle Falsa 123
        shipping_address_2:
          type:
            - string
            - 'null'
          description: Second address line.
          example: Depto 4
        shipping_neighborhood:
          type:
            - string
            - 'null'
          description: Neighborhood.
          example: Centro
        shipping_references:
          type:
            - string
            - 'null'
          description: Delivery references.
          example: Blue door, ring twice
        shipping_number:
          type:
            - string
            - 'null'
          description: Street number.
          example: '123'
        shipping_number_int:
          type:
            - string
            - 'null'
          description: Interior number.
          example: '4'
        shipping_city:
          type:
            - string
            - 'null'
          description: City.
          example: Ciudad de Mexico
        shipping_state:
          type:
            - string
            - 'null'
          description: State or province.
          example: CDMX
        shipping_zip_code:
          type:
            - string
            - 'null'
          description: Postal code.
          example: '06600'
    Error:
      type: object
      description: Error body returned by every failed request.
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Human-readable description of the failure. For `401` responses it is
            always `Unauthorized`.
          example: Parameter store_id is required
        message:
          type: string
          description: >-
            Present on `401` responses only; the reason the request was
            rejected.
          example: invalid token
        code:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code, present on some order, return and
            replenishment errors.
          example: ORDER_ALREADY_EXISTS
        context:
          type:
            - object
            - 'null'
          description: >-
            Extra data about the failure when available, for example the id of
            the conflicting order.
          additionalProperties: true
          example:
            order_id: 987654
  responses:
    Unauthorized:
      description: >-
        Missing or invalid token, wrong credentials, or no access to the
        requested store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidToken:
              value:
                error: Unauthorized
                message: invalid token
            noHeader:
              value:
                error: Unauthorized
                message: no authorization header found
            storeNotAllowed:
              value:
                error: Unauthorized
                message: not allowed to show? this Store
    InternalServerError:
      description: >-
        Unexpected error. Retry with backoff; if it persists, send the timestamp
        to Cubbo support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'unexpected error, timestamp: 1760000000'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Token returned by `POST /auth/token`, sent as `Authorization: Bearer
        <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.