POST
/
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": "SINGLE",
        "value": "AMZ-US"
      }
    }
  ],
  "description": "Your own reference text"
}'
{
  "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@bloggs.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
    }
  }
}

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.

The body is of type object.

Response

200
application/json

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.

POST
/
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": "SINGLE",
        "value": "AMZ-US"
      }
    }
  ],
  "description": "Your own reference text"
}'
{
  "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@bloggs.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
    }
  }
}

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.

The body is of type object.

Response

200
application/json

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.