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

# Update order buyer

> Update buyer fields for an order and update its Shopify shipping address.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/checkout-intents/openapi.documented.yml put /api/v1/orders/{id}/buyer
openapi: 3.0.0
info:
  title: Universal Checkout API
  version: 1.0.5
  description: >-
    Turn any product URL into a completed checkout. Instantly retrieve price,
    tax, and shipping for any product, and let users buy without ever leaving
    your native AI experience.


    View the [Rye API docs](https://docs.rye.com).
  termsOfService: https://rye.com/terms-of-service
  license:
    name: UNLICENSED
  contact:
    name: Rye
    email: dev@rye.com
    url: https://docs.rye.com
servers:
  - url: https://staging.api.rye.com
security: []
paths:
  /api/v1/orders/{id}/buyer:
    put:
      tags:
        - Orders
      summary: Update order buyer
      description: >-
        Update buyer fields for an order and update its Shopify shipping
        address.
      operationId: UpdateOrderBuyer
      parameters:
        - description: The order or checkout intent id
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        description: Buyer fields to merge over the order's current buyer
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderBuyerUpdateParams'
              description: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateError'
      security:
        - bearerAuth:
            - checkout_intents:write
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import CheckoutIntents from 'checkout-intents';

            const client = new CheckoutIntents({
              apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
            });

            const order = await client.orders.updateBuyer('id', { buyer: {} });

            console.log(order.id);
        - lang: Python
          source: |-
            import os
            from checkout_intents import CheckoutIntents

            client = CheckoutIntents(
                api_key=os.environ.get("CHECKOUT_INTENTS_API_KEY"),  # This is the default and can be omitted
            )
            order = client.orders.update_buyer(
                id="id",
                buyer={},
            )
            print(order.id)
        - lang: Java
          source: |-
            package com.rye.example;

            import com.rye.client.CheckoutIntentsClient;
            import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
            import com.rye.models.orders.Order;
            import com.rye.models.orders.OrderUpdateBuyerParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();

                    OrderUpdateBuyerParams params = OrderUpdateBuyerParams.builder()
                        .id("id")
                        .buyer(OrderUpdateBuyerParams.Buyer.builder().build())
                        .build();
                    Order order = client.orders().updateBuyer(params);
                }
            }
        - lang: cURL
          source: |-
            curl https://staging.api.rye.com/api/v1/orders/$ID/buyer \
                -X PUT \
                -H 'Content-Type: application/json' \
                -H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY" \
                -d '{
                      "buyer": {}
                    }'
components:
  schemas:
    OrderBuyerUpdateParams:
      description: Body for `PUT /orders/{id}/buyer`.
      properties:
        buyer:
          $ref: '#/components/schemas/Partial_Buyer_'
          description: Buyer fields to merge over the order's current buyer.
      required:
        - buyer
      type: object
      additionalProperties: false
    OrderResponse:
      description: >-
        Represents a completed order. Orders are created after a checkout intent
        reaches

        the `completed` state.
      properties:
        id:
          type: string
        checkoutIntentId:
          type: string
          description: >-
            ID of the checkout intent that was responsible for creating this
            order.
          example: ci_aaa8af5c5aae4c0e8ef0172c26c65c13
        buyer:
          $ref: '#/components/schemas/Buyer'
          description: Buyer and shipping-address details captured for this order.
        createdAt:
          type: string
          description: Timestamp the order was persisted to Rye.
          example: '2026-03-25T00:00:00Z'
        updatedAt:
          type: string
          description: Timestamp the order was last updated at
          example: '2026-03-27T00:00:00Z'
        referenceId:
          type: string
          description: >-
            The `referenceId` you supplied on the checkout intent, echoed back
            so you

            can reconcile this order against your own records. Absent when none
            was

            supplied.
          example: order-1234
        cancellation:
          allOf:
            - $ref: '#/components/schemas/Cancellation'
          nullable: true
          description: >-
            The cancellation for this order, or `null` if none has been
            requested.

            Populated by joining the separate cancellations collection on the
            order's

            marketplace order id.
      required:
        - id
        - checkoutIntentId
        - buyer
        - createdAt
        - updatedAt
        - cancellation
      type: object
      additionalProperties: false
    BadRequestError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    AuthenticationError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    NotFoundError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    ConflictError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    ValidateError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
        status:
          type: number
          format: double
        fields:
          $ref: '#/components/schemas/FieldErrors'
      required:
        - name
        - message
        - status
        - fields
      type: object
      additionalProperties: false
    Partial_Buyer_:
      properties:
        firstName:
          type: string
          example: John
          maxLength: 255
        lastName:
          type: string
          example: Doe
          maxLength: 255
        email:
          type: string
          example: john.doe@example.com
        phone:
          type: string
          example: '1234567890'
        address1:
          type: string
          example: 123 Main St
          maxLength: 255
        address2:
          type: string
          example: Apt 1
          maxLength: 255
        city:
          type: string
          example: New York
          maxLength: 255
        province:
          type: string
          example: NY
          maxLength: 255
        country:
          type: string
          example: US
        postalCode:
          type: string
          example: '10001'
          maxLength: 255
      type: object
      description: Make all properties in T optional
    Buyer:
      properties:
        postalCode:
          type: string
          example: '10001'
          maxLength: 255
        country:
          type: string
          example: US
        province:
          type: string
          example: NY
          maxLength: 255
        city:
          type: string
          example: New York
          maxLength: 255
        address2:
          type: string
          example: Apt 1
          maxLength: 255
        address1:
          type: string
          example: 123 Main St
          maxLength: 255
        phone:
          type: string
          example: '1234567890'
        email:
          type: string
          example: john.doe@example.com
        lastName:
          type: string
          example: Doe
          maxLength: 255
        firstName:
          type: string
          example: John
          maxLength: 255
      required:
        - postalCode
        - country
        - province
        - city
        - address1
        - phone
        - email
        - lastName
        - firstName
      type: object
    Cancellation:
      anyOf:
        - $ref: '#/components/schemas/RequestedCancellation'
        - $ref: '#/components/schemas/CompletedCancellation'
        - $ref: '#/components/schemas/DeniedCancellation'
    FieldErrors:
      properties: {}
      type: object
      additionalProperties:
        properties:
          value: {}
          message:
            type: string
        required:
          - message
        type: object
    RequestedCancellation:
      allOf:
        - $ref: '#/components/schemas/BaseCancellation'
        - properties:
            state:
              type: string
              enum:
                - requested
              nullable: false
          required:
            - state
          type: object
    CompletedCancellation:
      allOf:
        - $ref: '#/components/schemas/BaseCancellation'
        - properties:
            state:
              type: string
              enum:
                - completed
              nullable: false
          required:
            - state
          type: object
    DeniedCancellation:
      allOf:
        - $ref: '#/components/schemas/BaseCancellation'
        - properties:
            denialReason:
              $ref: '#/components/schemas/CancellationDenialReason'
            state:
              type: string
              enum:
                - denied
              nullable: false
          required:
            - denialReason
            - state
          type: object
    BaseCancellation:
      properties:
        reason:
          $ref: '#/components/schemas/CancellationReason'
        marketplaceOrderId:
          type: string
        checkoutIntentId:
          type: string
        createdAt:
          type: string
          format: date-time
        id:
          type: string
      required:
        - reason
        - marketplaceOrderId
        - checkoutIntentId
        - createdAt
        - id
      type: object
    CancellationDenialReason:
      properties:
        code:
          $ref: '#/components/schemas/CancellationDenialReasonCode'
        message:
          type: string
      required:
        - code
        - message
      type: object
    CancellationReason:
      properties:
        message:
          type: string
          description: >-
            Optional free-text note explaining the cancellation, forwarded to
            the

            merchant when possible.
          maxLength: 256
        code:
          $ref: '#/components/schemas/CancellationReasonCode'
      required:
        - code
      type: object
    CancellationDenialReasonCode:
      type: string
      enum:
        - other
        - already_shipped
        - non_cancellable_item
        - cancellation_window_expired
    CancellationReasonCode:
      type: string
      enum:
        - requested_by_customer
        - fraud
        - inventory
        - payment_issue
        - staff_error
        - other
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Rye API key

````