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

# Replace order affiliate attribution

> Alias for `PATCH /dev/v1/orders/:id`.



## OpenAPI

````yaml /openapi.json put /dev/v1/orders/{id}
openapi: 3.0.3
info:
  title: Shoppex Developer API
  description: Mintlify-compatible Developer API reference for Shoppex.
  version: 1.0.0
  contact:
    name: Shoppex Support
    email: support@shoppex.io
    url: https://shoppex.io
servers:
  - url: https://api.shoppex.io
security:
  - bearerAuth: []
paths:
  /dev/v1/orders/{id}:
    put:
      tags:
        - Orders
      summary: Replace order affiliate attribution
      description: Alias for `PATCH /dev/v1/orders/:id`.
      operationId: putDevV1OrdersById
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                affiliate_code:
                  type: string
                  nullable: true
                affiliateCode:
                  type: string
                  nullable: true
                referral_code:
                  type: string
                  nullable: true
                referralCode:
                  type: string
                  nullable: true
                affiliate_id:
                  type: string
                  nullable: true
                affiliateId:
                  type: string
                  nullable: true
              example:
                referral_code: creator123
          multipart/form-data:
            schema:
              type: object
              properties:
                affiliate_code:
                  type: string
                  nullable: true
                affiliateCode:
                  type: string
                  nullable: true
                referral_code:
                  type: string
                  nullable: true
                referralCode:
                  type: string
                  nullable: true
                affiliate_id:
                  type: string
                  nullable: true
                affiliateId:
                  type: string
                  nullable: true
              example:
                referral_code: creator123
          text/plain:
            schema:
              type: object
              properties:
                affiliate_code:
                  type: string
                  nullable: true
                affiliateCode:
                  type: string
                  nullable: true
                referral_code:
                  type: string
                  nullable: true
                referralCode:
                  type: string
                  nullable: true
                affiliate_id:
                  type: string
                  nullable: true
                affiliateId:
                  type: string
                  nullable: true
              example:
                referral_code: creator123
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - uniqid
                      - shop_id
                      - customer_id
                      - affiliate_link_id
                      - affiliate_customer_id
                      - affiliate_code
                      - affiliate_discount_amount
                      - customer_email
                      - currency
                      - status
                      - status_details
                      - payment_status
                      - gateway
                      - blockchain
                      - apm_method
                      - flow_type
                      - provider_reference
                      - provider_reference_type
                      - subtotal
                      - discount
                      - discount_display
                      - tax
                      - tax_percentage
                      - total
                      - total_display
                      - exchange_rate
                      - crypto_exchange_rate
                      - balance_paid_amount
                      - coupon_id
                      - subscription_id
                      - custom_fields
                      - is_developer_invoice
                      - developer_title
                      - checkout_url
                      - items
                      - created_at
                      - updated_at
                    properties:
                      id:
                        type: string
                      uniqid:
                        type: string
                      shop_id:
                        type: string
                      customer_id:
                        type: string
                        nullable: true
                      affiliate_link_id:
                        type: string
                        nullable: true
                      affiliate_customer_id:
                        type: string
                        nullable: true
                      affiliate_code:
                        type: string
                        nullable: true
                      affiliate_discount_amount:
                        type: number
                      customer_email:
                        type: string
                        nullable: true
                      currency:
                        type: string
                      status:
                        type: string
                      status_details:
                        type: string
                        nullable: true
                      payment_status:
                        type: string
                        nullable: true
                      gateway:
                        type: string
                        nullable: true
                      blockchain:
                        type: string
                        nullable: true
                      apm_method:
                        type: string
                        nullable: true
                      flow_type:
                        type: string
                        nullable: true
                      provider_reference:
                        type: string
                        nullable: true
                      provider_reference_type:
                        type: string
                        nullable: true
                      subtotal:
                        type: number
                      discount:
                        type: number
                      discount_display:
                        type: number
                      tax:
                        type: number
                      tax_percentage:
                        type: number
                      total:
                        type: number
                      total_display:
                        type: number
                      exchange_rate:
                        type: number
                      crypto_exchange_rate:
                        type: number
                      balance_paid_amount:
                        type: number
                      coupon_id:
                        type: string
                        nullable: true
                      subscription_id:
                        type: string
                        nullable: true
                      custom_fields:
                        nullable: true
                        type: object
                        additionalProperties: true
                      license_keys:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                      is_developer_invoice:
                        type: boolean
                      developer_title:
                        type: string
                        nullable: true
                      checkout_url:
                        type: string
                      items:
                        type: array
                        items:
                          type: object
                          required:
                            - product_id
                            - product_title
                            - product_type
                            - variant_title
                            - quantity
                            - unit_price
                            - total
                            - custom_fields
                            - delivery_instructions
                            - delivery_instructions_label
                          properties:
                            product_id:
                              type: string
                              nullable: true
                            product_title:
                              type: string
                            product_type:
                              type: string
                            variant_title:
                              type: string
                              nullable: true
                            quantity:
                              type: number
                            unit_price:
                              type: number
                            total:
                              type: number
                            custom_fields:
                              nullable: true
                              type: object
                              additionalProperties: true
                            delivery_instructions:
                              type: string
                              nullable: true
                            delivery_instructions_label:
                              type: string
                              nullable: true
                            license_keys:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            delivered_items:
                              type: object
                              additionalProperties: true
                      created_at:
                        type: number
                      updated_at:
                        type: number
                example:
                  data:
                    id: inv_put_1
                    uniqid: dddddddd-dddd-4ddd-8ddd-dddddddddddd
                    shop_id: shop_1
                    customer_id: null
                    customer_email: buyer@example.com
                    affiliate_link_id: link_1
                    affiliate_customer_id: cus_aff_1
                    affiliate_code: creator123
                    affiliate_discount_amount: 0
                    currency: USD
                    status: PENDING
                    payment_status: PENDING
                    gateway: MANUAL
                    flow_type: MANUAL_CONFIRMATION
                    provider_reference: ref_put_1
                    provider_reference_type: MANUAL_REFERENCE
                    subtotal: 10
                    discount: 0
                    total: 10
                    custom_fields: null
                    checkout_url: null
                    items:
                      - product_id: prod_1
                        product_title: Starter Pack
                        product_type: SERVICE
                        variant_title: null
                        quantity: 1
                        unit_price: 10
                        total: 10
                    created_at: 1711956000
                    updated_at: 1711956300
            multipart/form-data:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - uniqid
                      - shop_id
                      - customer_id
                      - affiliate_link_id
                      - affiliate_customer_id
                      - affiliate_code
                      - affiliate_discount_amount
                      - customer_email
                      - currency
                      - status
                      - status_details
                      - payment_status
                      - gateway
                      - blockchain
                      - apm_method
                      - flow_type
                      - provider_reference
                      - provider_reference_type
                      - subtotal
                      - discount
                      - discount_display
                      - tax
                      - tax_percentage
                      - total
                      - total_display
                      - exchange_rate
                      - crypto_exchange_rate
                      - balance_paid_amount
                      - coupon_id
                      - subscription_id
                      - custom_fields
                      - is_developer_invoice
                      - developer_title
                      - checkout_url
                      - items
                      - created_at
                      - updated_at
                    properties:
                      id:
                        type: string
                      uniqid:
                        type: string
                      shop_id:
                        type: string
                      customer_id:
                        type: string
                        nullable: true
                      affiliate_link_id:
                        type: string
                        nullable: true
                      affiliate_customer_id:
                        type: string
                        nullable: true
                      affiliate_code:
                        type: string
                        nullable: true
                      affiliate_discount_amount:
                        type: number
                      customer_email:
                        type: string
                        nullable: true
                      currency:
                        type: string
                      status:
                        type: string
                      status_details:
                        type: string
                        nullable: true
                      payment_status:
                        type: string
                        nullable: true
                      gateway:
                        type: string
                        nullable: true
                      blockchain:
                        type: string
                        nullable: true
                      apm_method:
                        type: string
                        nullable: true
                      flow_type:
                        type: string
                        nullable: true
                      provider_reference:
                        type: string
                        nullable: true
                      provider_reference_type:
                        type: string
                        nullable: true
                      subtotal:
                        type: number
                      discount:
                        type: number
                      discount_display:
                        type: number
                      tax:
                        type: number
                      tax_percentage:
                        type: number
                      total:
                        type: number
                      total_display:
                        type: number
                      exchange_rate:
                        type: number
                      crypto_exchange_rate:
                        type: number
                      balance_paid_amount:
                        type: number
                      coupon_id:
                        type: string
                        nullable: true
                      subscription_id:
                        type: string
                        nullable: true
                      custom_fields:
                        nullable: true
                        type: object
                        additionalProperties: true
                      license_keys:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                      is_developer_invoice:
                        type: boolean
                      developer_title:
                        type: string
                        nullable: true
                      checkout_url:
                        type: string
                      items:
                        type: array
                        items:
                          type: object
                          required:
                            - product_id
                            - product_title
                            - product_type
                            - variant_title
                            - quantity
                            - unit_price
                            - total
                            - custom_fields
                            - delivery_instructions
                            - delivery_instructions_label
                          properties:
                            product_id:
                              type: string
                              nullable: true
                            product_title:
                              type: string
                            product_type:
                              type: string
                            variant_title:
                              type: string
                              nullable: true
                            quantity:
                              type: number
                            unit_price:
                              type: number
                            total:
                              type: number
                            custom_fields:
                              nullable: true
                              type: object
                              additionalProperties: true
                            delivery_instructions:
                              type: string
                              nullable: true
                            delivery_instructions_label:
                              type: string
                              nullable: true
                            license_keys:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            delivered_items:
                              type: object
                              additionalProperties: true
                      created_at:
                        type: number
                      updated_at:
                        type: number
                example:
                  data:
                    id: inv_put_1
                    uniqid: dddddddd-dddd-4ddd-8ddd-dddddddddddd
                    shop_id: shop_1
                    customer_id: null
                    customer_email: buyer@example.com
                    affiliate_link_id: link_1
                    affiliate_customer_id: cus_aff_1
                    affiliate_code: creator123
                    affiliate_discount_amount: 0
                    currency: USD
                    status: PENDING
                    payment_status: PENDING
                    gateway: MANUAL
                    flow_type: MANUAL_CONFIRMATION
                    provider_reference: ref_put_1
                    provider_reference_type: MANUAL_REFERENCE
                    subtotal: 10
                    discount: 0
                    total: 10
                    custom_fields: null
                    checkout_url: null
                    items:
                      - product_id: prod_1
                        product_title: Starter Pack
                        product_type: SERVICE
                        variant_title: null
                        quantity: 1
                        unit_price: 10
                        total: 10
                    created_at: 1711956000
                    updated_at: 1711956300
            text/plain:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - uniqid
                      - shop_id
                      - customer_id
                      - affiliate_link_id
                      - affiliate_customer_id
                      - affiliate_code
                      - affiliate_discount_amount
                      - customer_email
                      - currency
                      - status
                      - status_details
                      - payment_status
                      - gateway
                      - blockchain
                      - apm_method
                      - flow_type
                      - provider_reference
                      - provider_reference_type
                      - subtotal
                      - discount
                      - discount_display
                      - tax
                      - tax_percentage
                      - total
                      - total_display
                      - exchange_rate
                      - crypto_exchange_rate
                      - balance_paid_amount
                      - coupon_id
                      - subscription_id
                      - custom_fields
                      - is_developer_invoice
                      - developer_title
                      - checkout_url
                      - items
                      - created_at
                      - updated_at
                    properties:
                      id:
                        type: string
                      uniqid:
                        type: string
                      shop_id:
                        type: string
                      customer_id:
                        type: string
                        nullable: true
                      affiliate_link_id:
                        type: string
                        nullable: true
                      affiliate_customer_id:
                        type: string
                        nullable: true
                      affiliate_code:
                        type: string
                        nullable: true
                      affiliate_discount_amount:
                        type: number
                      customer_email:
                        type: string
                        nullable: true
                      currency:
                        type: string
                      status:
                        type: string
                      status_details:
                        type: string
                        nullable: true
                      payment_status:
                        type: string
                        nullable: true
                      gateway:
                        type: string
                        nullable: true
                      blockchain:
                        type: string
                        nullable: true
                      apm_method:
                        type: string
                        nullable: true
                      flow_type:
                        type: string
                        nullable: true
                      provider_reference:
                        type: string
                        nullable: true
                      provider_reference_type:
                        type: string
                        nullable: true
                      subtotal:
                        type: number
                      discount:
                        type: number
                      discount_display:
                        type: number
                      tax:
                        type: number
                      tax_percentage:
                        type: number
                      total:
                        type: number
                      total_display:
                        type: number
                      exchange_rate:
                        type: number
                      crypto_exchange_rate:
                        type: number
                      balance_paid_amount:
                        type: number
                      coupon_id:
                        type: string
                        nullable: true
                      subscription_id:
                        type: string
                        nullable: true
                      custom_fields:
                        nullable: true
                        type: object
                        additionalProperties: true
                      license_keys:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                      is_developer_invoice:
                        type: boolean
                      developer_title:
                        type: string
                        nullable: true
                      checkout_url:
                        type: string
                      items:
                        type: array
                        items:
                          type: object
                          required:
                            - product_id
                            - product_title
                            - product_type
                            - variant_title
                            - quantity
                            - unit_price
                            - total
                            - custom_fields
                            - delivery_instructions
                            - delivery_instructions_label
                          properties:
                            product_id:
                              type: string
                              nullable: true
                            product_title:
                              type: string
                            product_type:
                              type: string
                            variant_title:
                              type: string
                              nullable: true
                            quantity:
                              type: number
                            unit_price:
                              type: number
                            total:
                              type: number
                            custom_fields:
                              nullable: true
                              type: object
                              additionalProperties: true
                            delivery_instructions:
                              type: string
                              nullable: true
                            delivery_instructions_label:
                              type: string
                              nullable: true
                            license_keys:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            delivered_items:
                              type: object
                              additionalProperties: true
                      created_at:
                        type: number
                      updated_at:
                        type: number
                example:
                  data:
                    id: inv_put_1
                    uniqid: dddddddd-dddd-4ddd-8ddd-dddddddddddd
                    shop_id: shop_1
                    customer_id: null
                    customer_email: buyer@example.com
                    affiliate_link_id: link_1
                    affiliate_customer_id: cus_aff_1
                    affiliate_code: creator123
                    affiliate_discount_amount: 0
                    currency: USD
                    status: PENDING
                    payment_status: PENDING
                    gateway: MANUAL
                    flow_type: MANUAL_CONFIRMATION
                    provider_reference: ref_put_1
                    provider_reference_type: MANUAL_REFERENCE
                    subtotal: 10
                    discount: 0
                    total: 10
                    custom_fields: null
                    checkout_url: null
                    items:
                      - product_id: prod_1
                        product_title: Starter Pack
                        product_type: SERVICE
                        variant_title: null
                        quantity: 1
                        unit_price: 10
                        total: 10
                    created_at: 1711956000
                    updated_at: 1711956300
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
        '403':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
        '404':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
        '422':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
        '429':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
        '500':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      doc_url:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          required:
                            - field
                            - message
                          properties:
                            field:
                              type: string
                            message:
                              type: string
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Use your Shoppex API key in the Authorization header.

````