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

# PlaceOrder

> PlaceOrder buys one or more products, settled from the reseller's prepaid
 wallet. It is asynchronous: the order is accepted and fulfilled in the
 background, so the response carries the order id and a status to poll. The
 request MUST carry an Idempotency-Key header, so a retried request never
 places a second order.



## OpenAPI

````yaml /api-reference/sodacards.yaml post /v1/orders
openapi: 3.1.0
info:
  title: SODACARDS Developer API
  description: Sell gift cards and game top-ups from your own systems.
  version: 1.0.0
servers:
  - url: https://api.sodacards.com
security:
  - ApiKeyAuth: []
tags:
  - name: PublicAPIService
    description: >-
      PublicAPIService is the public developer API a reseller calls with an API
      key.
       It is served as REST (via HTTP transcoding) so developers use GET /v1/... and
       curl, and its OpenAPI 3.1 spec is generated from this one file. Every method is
       authenticated by the API-key gateway that fronts it.
paths:
  /v1/orders:
    post:
      tags:
        - PublicAPIService
      summary: PlaceOrder
      description: >-
        PlaceOrder buys one or more products, settled from the reseller's
        prepaid
         wallet. It is asynchronous: the order is accepted and fulfilled in the
         background, so the response carries the order id and a status to poll. The
         request MUST carry an Idempotency-Key header, so a retried request never
         places a second order.
      operationId: PublicAPIService_PlaceOrder
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sodacards.devpublic.v1.PlaceOrderRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sodacards.devpublic.v1.PlaceOrderResponse'
components:
  schemas:
    sodacards.devpublic.v1.PlaceOrderRequest:
      type: object
      properties:
        lines:
          type: array
          items:
            $ref: '#/components/schemas/sodacards.devpublic.v1.OrderLine'
          title: lines
          description: >-
            lines are the products to buy and how many of each. At least one is
            required.
        reference:
          type: string
          title: reference
          description: >-
            reference is an optional identifier you attach to the order to
            correlate it
             with your own system and look it up later. Reusing an Idempotency-Key with a
             different reference is a conflict.
      title: PlaceOrderRequest
      additionalProperties: false
    sodacards.devpublic.v1.PlaceOrderResponse:
      type: object
      properties:
        order:
          $ref: '#/components/schemas/sodacards.devpublic.v1.PlacedOrder'
          title: order
          description: |-
            order is the accepted order. Its status is pending until fulfillment
             completes; poll the order to follow it.
      title: PlaceOrderResponse
      additionalProperties: false
    sodacards.devpublic.v1.OrderLine:
      type: object
      properties:
        productId:
          type: string
          title: product_id
          description: product_id is the id of the product to buy (a catalog product id).
        quantity:
          type: integer
          title: quantity
          format: int32
          description: quantity is how many units to buy on this line (at least one).
        inputFields:
          type: object
          title: input_fields
          additionalProperties:
            type: string
            title: value
          description: >-
            input_fields holds the required purchase-form values, keyed by field
            name.
      title: OrderLine
      additionalProperties: false
      description: |-
        OrderLine is one product to buy on an order. input_fields carries the
         purchase-form values a product requires (for example a game player id), keyed
         by the field name from the product definition.
    sodacards.devpublic.v1.PlacedOrder:
      type: object
      properties:
        id:
          type: string
          title: id
          description: >-
            id identifies the order; use it to poll the order and reveal its
            codes.
        status:
          type: string
          title: status
          description: |-
            status is the order's current state, e.g. "pending", "processing",
             "completed", "partially_completed", "failed" or "refunded".
        total:
          $ref: '#/components/schemas/sodacards.devpublic.v1.Money'
          title: total
          description: total is the amount charged to the reseller's wallet, in FCFA.
      title: PlacedOrder
      additionalProperties: false
      description: >-
        PlacedOrder is the accepted order: its id, the amount charged to the
        wallet in
         FCFA, and its current status.
    sodacards.devpublic.v1.Money:
      type: object
      properties:
        amount:
          type:
            - integer
            - string
          title: amount
          format: int64
          description: amount is the value in the currency's minor units.
        currency:
          type: string
          title: currency
          description: currency is the ISO-4217 code, e.g. "XOF".
      title: Money
      additionalProperties: false
      description: >-
        Money is an amount in the currency's minor units together with its
        ISO-4217
         code. XOF (the West-African CFA franc) has no minor unit, so for XOF amount is
         the whole franc value.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Your API key, prefixed sc_live_ or sc_test_.
      name: X-API-Key
      in: header

````