Skip to main content
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@example.com",
        "template_id": "DT-01HPSF51G0ZWHJ3JTNWRH0WDYK"
      },
      "products": {
        "type": "SINGLE",
        "value": "AMZ-US"
      }
    }
  ],
  "description": "Your own reference text",
  "metadata": {
    "internal_id": "12345",
    "department": "marketing",
    "campaign": "summer_2024"
  }
}'
{
  "id": "O-01H5WQGHKCBB85MQFM68S9KJ5Q",
  "status": "PROCESSING",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "description": "Your own reference text",
  "payment_method": {
    "type": "ACCOUNT_BALANCE",
    "currency": "USD"
  },
  "currency": "USD",
  "total_price": "10",
  "total_discount": "1",
  "items": [
    {
      "id": "E-NWPEKW4VL",
      "distribution_method": {
        "type": "EMAIL",
        "email_address": "fred@example.com",
        "template_id": "DT-01HPSF51G0ZWHJ3JTNWRH0WDYK"
      },
      "products": {
        "type": "MULTIPLE",
        "values": [
          "AMZ-US",
          "AIRBNB-US"
        ]
      },
      "face_value": "10",
      "price": "10",
      "payout": {
        "status": "ACTIVE",
        "status_updated_at": "2023-11-07T05:31:56Z",
        "url": "<string>",
        "expiry_date": "2023-11-07T05:31:56Z"
      },
      "currency": "USD"
    }
  ],
  "transaction_detail": {
    "USD": {
      "value": "10.00",
      "fx": null
    }
  },
  "metadata": {
    "internal_id": "12345",
    "department": "marketing",
    "campaign": "summer_2024"
  }
}

Need help with your first order?

We have a guide to help you get started with your first order including which execution mode to use.

Authorizations

X-Api-Key
string
header
required

Your API key. See the API key page on details of how to generate and store your keys.

Headers

X-Api-Version
string

The dated version of the API, if not specified a default is used. See API versioning for more information.

X-Idempotency-Key
string
required

A unique string that prevents order duplication. See Idempotency for more information.

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

Whether to process the order synchronously or asynchronously. If this header is omitted we default to async. See which mode to use to help you decide which execution mode is right for your use case. Sync orders are limited to a single order item.

Available options:
async,
sync

Body

application/json

The details of the order to create.

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 | null

Free format text reference for the order. The order description will not be visible to the end user. You will see this description in the Runa web portal.

This field is optional and can be omitted if not needed. If not provided, the field will be set to null in the response.

Maximum length: 128
Example:

"Your own reference text"

metadata
object | null

A flexible field for you to attach additional, customer-specific data to the order. This is for your internal use, the information stored here will not be exposed to the end user.

  • All keys and their corresponding values must be strings
  • Each order supports up to 20 key-value pairs
  • Keys have a maximum length of 40 characters
  • Values can be up to 200 characters long.

This field is optional and can be omitted if not needed. If not provided, the field will be set to null in the response.

Example:
{
"internal_id": "12345",
"department": "marketing",
"campaign": "summer_2024"
}

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. Used for orders that have completed. This class is typically used when returning a list of orders to the client.

status
enum<string>
required

Status of the order. The status of the order.

Available options:
COMPLETED
Example:

"PROCESSING"

id
string
required

The ID of the order.

Example:

"O-01H5WQGHKCBB85MQFM68S9KJ5Q"

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, represented by ISO 4217 currency codes. Please check the currency section in the guidelines for how to use this field.

Example:

"USD"

total_price
string
required

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

Example:

"10"

total_discount
string
required

The total discount of the order.

Example:

"1"

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 | null

Free format text reference for the order. The order description will not be visible to the end user. You will see this description in the Runa web portal.

This field is optional and can be omitted if not needed. If not provided, the field will be set to null in the response.

Maximum length: 128
Example:

"Your own reference text"

transaction_detail
object

A mapping of the subtotal of the order using the payout currency as a key.

Example:
{ "USD": { "value": "10.00", "fx": null } }
metadata
object | null

A flexible field for you to attach additional, customer-specific data to the order. This is for your internal use, the information stored here will not be exposed to the end user.

  • All keys and their corresponding values must be strings
  • Each order supports up to 20 key-value pairs
  • Keys have a maximum length of 40 characters
  • Values can be up to 200 characters long.

This field is optional and can be omitted if not needed. If not provided, the field will be set to null in the response.

Example:
{
"internal_id": "12345",
"department": "marketing",
"campaign": "summer_2024"
}
I