POST
/
order
Create a new order.
curl --request POST \
  --url https://playground.runa.io/v2/order \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --header 'X-Idempotency-Key: <x-idempotency-key>' \
  --data '{
  "payment_method": {
    "type": "ACCOUNT_BALANCE",
    "currency": "USD"
  },
  "items": [
    {
      "face_value": 10,
      "distribution_method": {
        "type": "EMAIL",
        "email_address": "fred@bloggs.com",
        "template_id": "DT-01HPSF51G0ZWHJ3JTNWRH0WDYK"
      },
      "products": {
        "type": "MULTIPLE",
        "values": [
          "AMZ-US",
          "AIRBNB-US"
        ]
      }
    }
  ],
  "description": "<string>"
}'
{
  "id": "O-01H5WQGHKCBB85MQFM68S9KJ5Q",
  "status": "COMPLETED",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "payment_method": {
    "type": "ACCOUNT_BALANCE"
  },
  "currency": "USD",
  "total_price": "10",
  "total_discount": 123,
  "items": [
    {
      "id": "E-NWPEKW4VL",
      "distribution_method": {
        "type": "EMAIL",
        "email_address": "fred@bloggs.com",
        "template_id": "DT-01HPSF51G0ZWHJ3JTNWRH0WDYK"
      },
      "products": {
        "type": "MULTIPLE",
        "values": [
          "AMZ-US",
          "AIRBNB-US"
        ]
      },
      "face_value": "10",
      "price": "10",
      "discount_multiplier": "0.1",
      "redemption_url": "<string>",
      "payout": {
        "status": "ACTIVE",
        "status_updated_at": "2023-11-07T05:31:56Z",
        "url": "<string>",
        "expiry_date": "2023-11-07T05:31:56Z"
      }
    }
  ]
}

Authorizations

X-Api-Key
string
header
required

Headers

X-Api-Version
string

The dated version of the API, if not specified a default is used.

X-Idempotency-Key
string
required

A unique string that prevents order duplication.

X-Execution-Mode
enum<string>
default:async

Choose sync if you want to retrieve the payout links directly from the API response. Choose async if you want to poll for your order. The default if unset is async.

Available options:
async,
sync

Body

application/json
payment_method
object
required

Payment method for the order. Select the ACCOUNT_BALANCE you want to pay for the order from Pay using your account balance.

items
NewOrderItemDetails · object[]
required

The list of items to be included in the order. Each item ordered results in a single payout link. The maximum number of items per order is 200.

Required array length: 1 - 200 elements
description
string

Free format text reference for the order. Maximum length is 128 characters.

Maximum length: 128

Response

Response that will be returned in sync execution mode. Order has successfully been completed.

Used for an order that has completed. This class is typically used when returning a single order to the client.

id
string
required

The ID of the order.

Example:

"O-01H5WQGHKCBB85MQFM68S9KJ5Q"

status
enum<string>
required

Status of the order. The status of the order.

Available options:
COMPLETED
created_at
string<date-time>
required

UTC timestamp, in ISO 8601 format, when the order was submitted.

payment_method
object
required

The payment method used for the order. Account balance payment.

currency
string
required

The currency of the order.

Example:

"USD"

total_price
number
required

The total price of the order. This includes any applicable fees.

Example:

"10"

total_discount
number
required

The total discount of the order.

items
CompletedOrderItem · object[]
required

The list of items that were included in the order. Each item represents a single payout link.

completed_at
string<date-time>

UTC timestamp, in ISO 8601 format, when the order was completed.

description
string

Free format text reference for the order.