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

# Apply Discount Code To Order

> Apply Discount Code to Order



## OpenAPI

````yaml openapi/ecommerce.yaml post /public/{user_id}/orders/{publicOrder}/discount-code/{discountCode_code}
openapi: 3.0.1
info:
  title: Ecommerce API
  description: ''
  version: '1.0'
servers:
  - url: https://apigw.ipxo.com/ecommerce
security:
  - bearerAuth: []
tags:
  - name: User
    description: ''
  - name: Cart
    description: ''
  - name: Stripe
    description: ''
  - name: Address
    description: ''
  - name: Gateway
    description: ''
  - name: Invoice
    description: ''
  - name: Order
    description: ''
  - name: Payment
    description: ''
  - name: Product
    description: ''
  - name: Subscription
    description: ''
  - name: Customer
    description: ''
  - name: Projection
    description: ''
  - name: Stripe EU
    description: ''
  - name: Vat
    description: ''
  - name: Legal
    description: ''
paths:
  /public/{user_id}/orders/{publicOrder}/discount-code/{discountCode_code}:
    post:
      tags:
        - Order
      summary: Apply Discount Code To Order
      description: Apply Discount Code to Order
      operationId: applyDiscountCodeToOrder
      parameters:
        - name: user_id
          in: path
          description: The ID of the user.
          required: true
          schema:
            type: string
          example: odit
        - name: publicOrder
          in: path
          description: ''
          required: true
          schema:
            type: string
          example: temporibus
        - name: discountCode_code
          in: path
          description: ''
          required: true
          schema:
            type: string
          example: voluptate
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        example: bbc4a345-c871-3fa9-acca-9a283971c770
                      status:
                        type: string
                        example: draft
                      placed_at:
                        type: string
                        example: '2025-06-06T03:24:29+00:00'
                      expires_at:
                        type: string
                        example: '2026-03-11T14:05:31+00:00'
                      sub_total:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '6893.00'
                          amount_minor:
                            type: integer
                            example: 689300
                      discount_total:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '0.00'
                          amount_minor:
                            type: integer
                            example: 0
                      tax_total:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '0.00'
                          amount_minor:
                            type: integer
                            example: 0
                      total:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '6893.00'
                          amount_minor:
                            type: integer
                            example: 689300
                      credits_total:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '0.00'
                          amount_minor:
                            type: integer
                            example: 0
                      remaining_total:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '6893.00'
                          amount_minor:
                            type: integer
                            example: 689300
                      total_before_tax:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: string
                            example: '6893.00'
                          amount_minor:
                            type: integer
                            example: 689300
                      tax_breakdown:
                        type: array
                        items:
                          type: object
                          properties:
                            amount:
                              type: object
                              properties:
                                currency:
                                  type: string
                                  example: USD
                                amount:
                                  type: string
                                  example: '0.00'
                                amount_minor:
                                  type: integer
                                  example: 0
                            code:
                              type: string
                              example: Test Tax
                            name:
                              type: string
                              example: some-tax
                            rate:
                              type: integer
                              example: 10
                            calculator_type:
                              type: string
                              example: percent
                        example:
                          - amount:
                              currency: USD
                              amount: '0.00'
                              amount_minor: 0
                            code: Test Tax
                            name: some-tax
                            rate: 10
                            calculator_type: percent
                      discount_breakdown:
                        type: array
                        items:
                          type: object
                          properties:
                            amount:
                              type: object
                              properties:
                                currency:
                                  type: string
                                  example: USD
                                amount:
                                  type: string
                                  example: '0.00'
                                amount_minor:
                                  type: integer
                                  example: 0
                            code:
                              type: string
                              example: Test Discount
                            name:
                              type: string
                              example: some-discount
                            rate:
                              type: integer
                              example: 10
                            calculator_type:
                              type: string
                              example: percent
                        example:
                          - amount:
                              currency: USD
                              amount: '0.00'
                              amount_minor: 0
                            code: Test Discount
                            name: some-discount
                            rate: 10
                            calculator_type: percent
                      enabled_free_checkout:
                        type: boolean
                        example: false
                example:
                  data:
                    uuid: bbc4a345-c871-3fa9-acca-9a283971c770
                    status: draft
                    placed_at: '2025-06-06T03:24:29+00:00'
                    expires_at: '2026-03-11T14:05:31+00:00'
                    sub_total:
                      currency: USD
                      amount: '6893.00'
                      amount_minor: 689300
                    discount_total:
                      currency: USD
                      amount: '0.00'
                      amount_minor: 0
                    tax_total:
                      currency: USD
                      amount: '0.00'
                      amount_minor: 0
                    total:
                      currency: USD
                      amount: '6893.00'
                      amount_minor: 689300
                    credits_total:
                      currency: USD
                      amount: '0.00'
                      amount_minor: 0
                    remaining_total:
                      currency: USD
                      amount: '6893.00'
                      amount_minor: 689300
                    total_before_tax:
                      currency: USD
                      amount: '6893.00'
                      amount_minor: 689300
                    tax_breakdown:
                      - amount:
                          currency: USD
                          amount: '0.00'
                          amount_minor: 0
                        code: Test Tax
                        name: some-tax
                        rate: 10
                        calculator_type: percent
                    discount_breakdown:
                      - amount:
                          currency: USD
                          amount: '0.00'
                          amount_minor: 0
                        code: Test Discount
                        name: some-discount
                        rate: 10
                        calculator_type: percent
                    enabled_free_checkout: false
              example:
                data:
                  uuid: bbc4a345-c871-3fa9-acca-9a283971c770
                  status: draft
                  placed_at: '2025-06-06T03:24:29.0000000+00:00'
                  expires_at: '2026-03-11T14:05:31.0000000+00:00'
                  sub_total:
                    currency: USD
                    amount: '6893.00'
                    amount_minor: 689300
                  discount_total:
                    currency: USD
                    amount: '0.00'
                    amount_minor: 0
                  tax_total:
                    currency: USD
                    amount: '0.00'
                    amount_minor: 0
                  total:
                    currency: USD
                    amount: '6893.00'
                    amount_minor: 689300
                  credits_total:
                    currency: USD
                    amount: '0.00'
                    amount_minor: 0
                  remaining_total:
                    currency: USD
                    amount: '6893.00'
                    amount_minor: 689300
                  total_before_tax:
                    currency: USD
                    amount: '6893.00'
                    amount_minor: 689300
                  tax_breakdown:
                    - amount:
                        currency: USD
                        amount: '0.00'
                        amount_minor: 0
                      code: Test Tax
                      name: some-tax
                      rate: 10
                      calculator_type: percent
                  discount_breakdown:
                    - amount:
                        currency: USD
                        amount: '0.00'
                        amount_minor: 0
                      code: Test Discount
                      name: some-discount
                      rate: 10
                      calculator_type: percent
                  enabled_free_checkout: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````