Skip to main content
POST
/
prices
/
evaluate
Evaluate multiple prices
curl --request POST \
  --url https://api.withorb.com/v1/prices/evaluate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "timeframe_start": "2023-11-07T05:31:56Z",
  "timeframe_end": "2023-11-07T05:31:56Z",
  "customer_id": "<string>",
  "external_customer_id": "<string>",
  "price_evaluations": []
}
'
import requests

url = "https://api.withorb.com/v1/prices/evaluate"

payload = {
"timeframe_start": "2023-11-07T05:31:56Z",
"timeframe_end": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"external_customer_id": "<string>",
"price_evaluations": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
timeframe_start: '2023-11-07T05:31:56Z',
timeframe_end: '2023-11-07T05:31:56Z',
customer_id: '<string>',
external_customer_id: '<string>',
price_evaluations: []
})
};

fetch('https://api.withorb.com/v1/prices/evaluate', 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://api.withorb.com/v1/prices/evaluate",
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([
'timeframe_start' => '2023-11-07T05:31:56Z',
'timeframe_end' => '2023-11-07T05:31:56Z',
'customer_id' => '<string>',
'external_customer_id' => '<string>',
'price_evaluations' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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://api.withorb.com/v1/prices/evaluate"

payload := strings.NewReader("{\n \"timeframe_start\": \"2023-11-07T05:31:56Z\",\n \"timeframe_end\": \"2023-11-07T05:31:56Z\",\n \"customer_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"price_evaluations\": []\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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://api.withorb.com/v1/prices/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timeframe_start\": \"2023-11-07T05:31:56Z\",\n \"timeframe_end\": \"2023-11-07T05:31:56Z\",\n \"customer_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"price_evaluations\": []\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.withorb.com/v1/prices/evaluate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeframe_start\": \"2023-11-07T05:31:56Z\",\n \"timeframe_end\": \"2023-11-07T05:31:56Z\",\n \"customer_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"price_evaluations\": []\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "price_groups": [
        {
          "grouping_values": [
            "<string>"
          ],
          "quantity": 123,
          "amount": "<string>"
        }
      ],
      "currency": "<string>",
      "price_id": "<string>",
      "external_price_id": "<string>",
      "inline_price_index": 123
    }
  ]
}
{
"type": "https://docs.withorb.com/reference/error-responses#400-constraint-violation",
"status": 400,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#404-feature-not-available",
"status": 400,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#413-request-too-large",
"status": 413,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "<string>",
"title": "<string>"
}
{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 123,
"detail": "<string>",
"title": "<string>"
}

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Body

application/json
timeframe_start
string<date-time>
required

The inclusive lower bound for event timestamps

timeframe_end
string<date-time>
required

The exclusive upper bound for event timestamps

customer_id
string | null

The ID of the customer to which this evaluation is scoped.

external_customer_id
string | null

The external customer ID of the customer to which this evaluation is scoped.

price_evaluations
PriceEvaluationRequest · object[]

List of prices to evaluate (max 100)

Required array length: 1 - 100 elements

Response

OK

data
EvaluatePriceResourceForMultiplePrice · object[]
required