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

# Update order

> Updates an order that has not been invoiced.



## OpenAPI

````yaml /api-reference/openapi.yaml put /orders/{id}
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, and deposit links programmatically through this API,
    and receive webhooks when deposit links change. All requests must be
    authenticated with an API key.
  version: 1.6.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: List transactions and look one up.
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
paths:
  /orders/{id}:
    put:
      tags:
        - Orders
      summary: Update order
      description: Updates an order that has not been invoiced.
      operationId: updateOrder
      parameters:
        - name: id
          in: path
          description: The UUID of the order to update
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: object
                  properties:
                    identifier:
                      type: string
                      description: The order identifier
                    recipient_id:
                      type: integer
                      description: The ID of the recipient customer
                    customer_uuid:
                      type: string
                      format: uuid
                      description: The UUID of the customer (alternative to recipient_id)
                    currency:
                      type: string
                      description: The currency code (e.g., USD)
                    description:
                      type: string
                      description: Description of the order
                    po_number:
                      type: string
                      description: Purchase order number
                    due_date:
                      type: string
                      format: date-time
                      description: Due date for the order
                    total_amount:
                      type: integer
                      description: Total amount in cents
                    tax_amount:
                      type: integer
                      description: Tax amount in cents
                    discount_amount:
                      type: integer
                      description: Discount amount in cents
                    shipping_amount:
                      type: integer
                      description: Shipping amount in cents
                    line_items_attributes:
                      type: array
                      description: Line items for the order
                      items:
                        type: object
                        properties:
                          uuid:
                            type: string
                            format: uuid
                            description: UUID of the line item (required for updating)
                          description:
                            type: string
                            description: Description of the line item
                          quantity:
                            type: number
                            format: float
                            description: Quantity of the item
                          net_amount:
                            type: integer
                            description: Net amount in cents
                          discount_bps:
                            type: integer
                            description: Discount in basis points
                          unit:
                            type: string
                            description: Unit of measure for the line item
                            enum:
                              - each
                              - hour
                              - day
                              - week
                              - month
                              - lb
                              - kg
                              - ft
                              - m
                              - sqft
                              - sqm
                            default: each
                          product_id:
                            type: integer
                            description: ID of the product to link this line item to
                          _destroy:
                            type: boolean
                            description: Set to true to remove this line item
      responses:
        '200':
          description: Order updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDetail'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Order not found
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                example:
                  errors:
                    - Cannot update an invoiced order
components:
  schemas:
    OrderDetail:
      type: object
      properties:
        order:
          type: object
          properties:
            uuid:
              type: string
              format: uuid
            identifier:
              type: string
            total_amount:
              type: integer
            tax_amount:
              type: integer
            discount_amount:
              type: integer
            shipping_amount:
              type: integer
            currency:
              type: string
              enum:
                - USD
                - CAD
                - GBP
                - EUR
                - AUD
                - JPY
                - INR
              description: Currency code
            description:
              type: string
            po_number:
              type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            due_date:
              type: string
              format: date
            scheduled:
              type: boolean
            issued_at:
              type: string
              format: date-time
            invoiced:
              type: boolean
            recipient:
              $ref: '#/components/schemas/OrderRecipient'
            line_items:
              type: array
              items:
                $ref: '#/components/schemas/OrderLineItem'
            invoice:
              type: object
              properties:
                uuid:
                  type: string
                  format: uuid
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    OrderRecipient:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        company_name:
          type: string
        display_name:
          type: string
    OrderLineItem:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        description:
          type: string
        quantity:
          type: string
          description: >-
            Decimal up to 4 places. Serialized as a string to preserve precision
            (e.g. '2.0', '1.2500').
          example: '2.0'
        net_amount:
          type: integer
          description: In cents.
        discount_bps:
          type: integer
        unit:
          $ref: '#/components/schemas/LineItemUnit'
    LineItemUnit:
      type: string
      description: Unit of measure for a line item.
      enum:
        - each
        - hour
        - day
        - week
        - month
        - lb
        - kg
        - ft
        - m
        - sqft
        - sqm
      default: each
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

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