Estimate order
curl --request POST \
--url https://playground.runa.io/v2/order/estimate \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"payment_method": {
"type": "ACCOUNT_BALANCE",
"currency": "USD"
},
"items": [
{
"products": {
"type": "MULTIPLE",
"values": [
"AMZ-US",
"AIRBNB-US"
]
},
"face_value": "10.00"
}
]
}
'import requests
url = "https://playground.runa.io/v2/order/estimate"
payload = {
"payment_method": {
"type": "ACCOUNT_BALANCE",
"currency": "USD"
},
"items": [
{
"products": {
"type": "MULTIPLE",
"values": ["AMZ-US", "AIRBNB-US"]
},
"face_value": "10.00"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method: {type: 'ACCOUNT_BALANCE', currency: 'USD'},
items: [
{
products: {type: 'MULTIPLE', values: ['AMZ-US', 'AIRBNB-US']},
face_value: '10.00'
}
]
})
};
fetch('https://playground.runa.io/v2/order/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://playground.runa.io/v2/order/estimate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_method' => [
'type' => 'ACCOUNT_BALANCE',
'currency' => 'USD'
],
'items' => [
[
'products' => [
'type' => 'MULTIPLE',
'values' => [
'AMZ-US',
'AIRBNB-US'
]
],
'face_value' => '10.00'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://playground.runa.io/v2/order/estimate"
payload := strings.NewReader("{\n \"payment_method\": {\n \"type\": \"ACCOUNT_BALANCE\",\n \"currency\": \"USD\"\n },\n \"items\": [\n {\n \"products\": {\n \"type\": \"MULTIPLE\",\n \"values\": [\n \"AMZ-US\",\n \"AIRBNB-US\"\n ]\n },\n \"face_value\": \"10.00\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://playground.runa.io/v2/order/estimate")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_method\": {\n \"type\": \"ACCOUNT_BALANCE\",\n \"currency\": \"USD\"\n },\n \"items\": [\n {\n \"products\": {\n \"type\": \"MULTIPLE\",\n \"values\": [\n \"AMZ-US\",\n \"AIRBNB-US\"\n ]\n },\n \"face_value\": \"10.00\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://playground.runa.io/v2/order/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method\": {\n \"type\": \"ACCOUNT_BALANCE\",\n \"currency\": \"USD\"\n },\n \"items\": [\n {\n \"products\": {\n \"type\": \"MULTIPLE\",\n \"values\": [\n \"AMZ-US\",\n \"AIRBNB-US\"\n ]\n },\n \"face_value\": \"10.00\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"payment_method": {
"type": "ACCOUNT_BALANCE",
"currency": "USD"
},
"items": [
{
"products": {
"type": "MULTIPLE",
"values": [
"AMZ-US",
"AIRBNB-US"
]
},
"face_value": "10.00",
"price": "10.00",
"discount_multiplier": "0.05",
"currency": "USD"
}
],
"currency": "USD",
"total_discount": "0.50",
"total_price": "9.50",
"transaction_detail": {
"USD": {
"value": "10.00",
"fx": null
}
}
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}{
"type": "validation_error",
"message": "There were one or more problems processing your request, see details key.",
"details": [
{
"type": "value_error.number.not_ge",
"message": "ensure this value is greater than or equal to 1",
"location": [
"items",
"0",
"face_value"
]
}
],
"help": null
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}Estimate order
Estimate the price for the order
POST
/
order
/
estimate
Estimate order
curl --request POST \
--url https://playground.runa.io/v2/order/estimate \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"payment_method": {
"type": "ACCOUNT_BALANCE",
"currency": "USD"
},
"items": [
{
"products": {
"type": "MULTIPLE",
"values": [
"AMZ-US",
"AIRBNB-US"
]
},
"face_value": "10.00"
}
]
}
'import requests
url = "https://playground.runa.io/v2/order/estimate"
payload = {
"payment_method": {
"type": "ACCOUNT_BALANCE",
"currency": "USD"
},
"items": [
{
"products": {
"type": "MULTIPLE",
"values": ["AMZ-US", "AIRBNB-US"]
},
"face_value": "10.00"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_method: {type: 'ACCOUNT_BALANCE', currency: 'USD'},
items: [
{
products: {type: 'MULTIPLE', values: ['AMZ-US', 'AIRBNB-US']},
face_value: '10.00'
}
]
})
};
fetch('https://playground.runa.io/v2/order/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://playground.runa.io/v2/order/estimate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_method' => [
'type' => 'ACCOUNT_BALANCE',
'currency' => 'USD'
],
'items' => [
[
'products' => [
'type' => 'MULTIPLE',
'values' => [
'AMZ-US',
'AIRBNB-US'
]
],
'face_value' => '10.00'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://playground.runa.io/v2/order/estimate"
payload := strings.NewReader("{\n \"payment_method\": {\n \"type\": \"ACCOUNT_BALANCE\",\n \"currency\": \"USD\"\n },\n \"items\": [\n {\n \"products\": {\n \"type\": \"MULTIPLE\",\n \"values\": [\n \"AMZ-US\",\n \"AIRBNB-US\"\n ]\n },\n \"face_value\": \"10.00\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://playground.runa.io/v2/order/estimate")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_method\": {\n \"type\": \"ACCOUNT_BALANCE\",\n \"currency\": \"USD\"\n },\n \"items\": [\n {\n \"products\": {\n \"type\": \"MULTIPLE\",\n \"values\": [\n \"AMZ-US\",\n \"AIRBNB-US\"\n ]\n },\n \"face_value\": \"10.00\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://playground.runa.io/v2/order/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method\": {\n \"type\": \"ACCOUNT_BALANCE\",\n \"currency\": \"USD\"\n },\n \"items\": [\n {\n \"products\": {\n \"type\": \"MULTIPLE\",\n \"values\": [\n \"AMZ-US\",\n \"AIRBNB-US\"\n ]\n },\n \"face_value\": \"10.00\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"payment_method": {
"type": "ACCOUNT_BALANCE",
"currency": "USD"
},
"items": [
{
"products": {
"type": "MULTIPLE",
"values": [
"AMZ-US",
"AIRBNB-US"
]
},
"face_value": "10.00",
"price": "10.00",
"discount_multiplier": "0.05",
"currency": "USD"
}
],
"currency": "USD",
"total_discount": "0.50",
"total_price": "9.50",
"transaction_detail": {
"USD": {
"value": "10.00",
"fx": null
}
}
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}{
"type": "validation_error",
"message": "There were one or more problems processing your request, see details key.",
"details": [
{
"type": "value_error.number.not_ge",
"message": "ensure this value is greater than or equal to 1",
"location": [
"items",
"0",
"face_value"
]
}
],
"help": null
}{
"type": "not_found",
"message": "The requested resource was not found",
"help": "Please check the resource ID and try again."
}The estimate endpoint is currently unsupported in the playground
environment.
Authorizations
Your API key. See the API key page on details of how to generate and store your keys.
Headers
The dated version of the API, if not specified a default is used. See API versioning for more information. The dated version of the Runa API. Send it on every request: a client that omits it silently follows whatever the server default happens to be.
Available options:
2024-02-05 Body
application/json
The details of the order to estimate.
Request for a price estimate for an order.
Response
OK
Response object for a order price estimate.
Was this page helpful?