Making your first API order in asynchronous mode
https://playground.runa.io/v2
, we will be making a call to the POST /order
endpoint. The full path therefore is https://playground.runa.io/v2/order
.
2024-02-05
async
as we are using the synchronous
execution mode for this guide. If omitted, the default value is async
but we
still recommend you set it for explicitness.payment_method
object:
ACCOUNT_BALANCE
USD
items
array:
EMAIL
and PAYOUT_LINK
. Read on to see how to
set these fields.SINGLE
and MULTIPLE
and TEMPLATE
. Read on to see how to set these fields.EMAIL
and PAYOUT_LINK
.
EMAIL
: This will send the payout link directly to the end user’s email inbox.PAYOUT_LINK
: This will return the payout link in the response body.RECIPIENT
: This is used for payment type products, we won’t be using this in this guide.EMAIL
EMAIL
X-Send-Email: true
header.Ensure you refer to the playground reference for more details.PAYOUT_LINK
PAYOUT_LINK
SINGLE
, MULTIPLE
and TEMPLATE
.
SINGLE
: This will create a payout link for the selected product, the end user will receive a link for the chosen value exactly.MULTIPLE
: This will create payout link where the end user can choose to split the value between multiple products.TEMPLATE
: This will create a payout link as defined by a pre-built template.TEMPLATE
for this example. In the playground environment we have a pre-defined template we can use for USD that will give us a payout link with 10 randomized products.
On the products
object we will set the type
to TEMPLATE
and the template_id
to PT-01HQ12PV4B8XMBRTK281JM54KK
. The template_id
is the ID of the template we want to use.
TEMPLATE
PT-01HQ12PV4B8XMBRTK281JM54KK
, a pre-defined
playground
template
for USD.PROCESSING
for a short period of time after it is
accepted. On the playground environment this is simulated by a 1 second delay.200 OK
with the order details in the body. You can retrieve the payout links from the payout.url
fields from the items
array.
url
field into your browser to see the payout link. Congratulations, you’ve just made your first order with Runa.