API Reference
Price every line on a quote
Targets: 100 lines within 1 s at the 95th percentile and 2 s at the 99th.
POST
/
v1
/
quotes
/
price
Price every line on a quote
curl --request POST \
--url https://api.elastly.ai/v1/quotes/price \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"buyer": {
"kind": "customer",
"customerId": "6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84"
},
"currency": "USD",
"quoteRef": "Q-1042",
"lines": [
{
"lineRef": "L1",
"sku": "6205-2RS",
"quantity": "400"
},
{
"lineRef": "L2",
"sku": "6206-ZZ",
"quantity": "120"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
buyer: {kind: 'customer', customerId: '6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84'},
currency: 'USD',
quoteRef: 'Q-1042',
lines: [
{lineRef: 'L1', sku: '6205-2RS', quantity: '400'},
{lineRef: 'L2', sku: '6206-ZZ', quantity: '120'}
]
})
};
fetch('https://api.elastly.ai/v1/quotes/price', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.elastly.ai/v1/quotes/price"
payload = {
"buyer": {
"kind": "customer",
"customerId": "6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84"
},
"currency": "USD",
"quoteRef": "Q-1042",
"lines": [
{
"lineRef": "L1",
"sku": "6205-2RS",
"quantity": "400"
},
{
"lineRef": "L2",
"sku": "6206-ZZ",
"quantity": "120"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.elastly.ai/v1/quotes/price",
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([
'buyer' => [
'kind' => 'customer',
'customerId' => '6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84'
],
'currency' => 'USD',
'quoteRef' => 'Q-1042',
'lines' => [
[
'lineRef' => 'L1',
'sku' => '6205-2RS',
'quantity' => '400'
],
[
'lineRef' => 'L2',
'sku' => '6206-ZZ',
'quantity' => '120'
]
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.elastly.ai/v1/quotes/price")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"buyer\": {\n \"kind\": \"customer\",\n \"customerId\": \"6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84\"\n },\n \"currency\": \"USD\",\n \"quoteRef\": \"Q-1042\",\n \"lines\": [\n {\n \"lineRef\": \"L1\",\n \"sku\": \"6205-2RS\",\n \"quantity\": \"400\"\n },\n {\n \"lineRef\": \"L2\",\n \"sku\": \"6206-ZZ\",\n \"quantity\": \"120\"\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.elastly.ai/v1/quotes/price"
payload := strings.NewReader("{\n \"buyer\": {\n \"kind\": \"customer\",\n \"customerId\": \"6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84\"\n },\n \"currency\": \"USD\",\n \"quoteRef\": \"Q-1042\",\n \"lines\": [\n {\n \"lineRef\": \"L1\",\n \"sku\": \"6205-2RS\",\n \"quantity\": \"400\"\n },\n {\n \"lineRef\": \"L2\",\n \"sku\": \"6206-ZZ\",\n \"quantity\": \"120\"\n }\n ]\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))
}{
"pricingVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"digest": "<string>",
"pricedAt": "2023-11-07T05:31:56Z",
"pricingDay": "2023-12-25",
"lines": [
{
"lineRef": "<string>",
"sku": "<string>",
"state": "ok",
"price": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"unitPrice": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"guard": "none",
"warnings": [
{
"code": "<string>",
"guards": [
"<string>"
],
"source": "<string>",
"channels": [
"quote"
],
"gap": {
"amount": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"points": "<string>"
}
}
],
"trace": [
{
"kind": "category",
"termKey": "<string>",
"label": "<string>",
"source": "<string>",
"valuePts": "<string>",
"shadowPts": "<string>",
"status": "applied",
"input": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"output": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"reason": "<string>",
"attributeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy": {
"name": "<string>",
"ruleKey": "<string>",
"ruleNumber": 123,
"ruleName": "<string>",
"reads": [
{
"field": "days_of_stock",
"window": 7,
"value": "<string>",
"op": "gt",
"threshold": "<string>",
"thresholds": [
"<string>"
],
"holds": true
}
],
"shape": 1,
"applyOnTop": true,
"orderMode": "policy"
},
"orderSize": {
"source": "policy",
"basis": "quantity",
"tier": {
"from": 123,
"points": 123
},
"tiers": [
{
"from": 123,
"points": 123,
"basis": "quantity"
}
]
},
"replaced": [
"<string>"
],
"evidence": {
"level": "segment",
"strength": "High",
"observed": {
"lines": 1,
"invoices": 1,
"distinctPrices": 1,
"lastInvoiceDay": "2023-12-25",
"rangeLowPts": "<string>",
"rangeHighPts": "<string>",
"customers": 1
}
},
"learnedFrom": {
"months": 123,
"lines": 1,
"strength": "High"
}
}
],
"fxRateIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"evaluationFingerprint": "<string>",
"priceId": "<string>",
"version": 4503599627370495,
"validFrom": "2023-11-07T05:31:56Z",
"validUntil": "2023-11-07T05:31:56Z",
"cost": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"floorPts": "<string>",
"targetPts": "<string>",
"ceilingPts": "<string>",
"markupPts": "<string>",
"appliedMarkupPts": "<string>",
"decisionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"totals": [
{
"currency": "<string>",
"amount": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
}
}
],
"complete": true
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}Authorizations
Headers
Body
application/json
Response
Price every line on a quote
⌘I
Price every line on a quote
curl --request POST \
--url https://api.elastly.ai/v1/quotes/price \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"buyer": {
"kind": "customer",
"customerId": "6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84"
},
"currency": "USD",
"quoteRef": "Q-1042",
"lines": [
{
"lineRef": "L1",
"sku": "6205-2RS",
"quantity": "400"
},
{
"lineRef": "L2",
"sku": "6206-ZZ",
"quantity": "120"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
buyer: {kind: 'customer', customerId: '6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84'},
currency: 'USD',
quoteRef: 'Q-1042',
lines: [
{lineRef: 'L1', sku: '6205-2RS', quantity: '400'},
{lineRef: 'L2', sku: '6206-ZZ', quantity: '120'}
]
})
};
fetch('https://api.elastly.ai/v1/quotes/price', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.elastly.ai/v1/quotes/price"
payload = {
"buyer": {
"kind": "customer",
"customerId": "6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84"
},
"currency": "USD",
"quoteRef": "Q-1042",
"lines": [
{
"lineRef": "L1",
"sku": "6205-2RS",
"quantity": "400"
},
{
"lineRef": "L2",
"sku": "6206-ZZ",
"quantity": "120"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.elastly.ai/v1/quotes/price",
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([
'buyer' => [
'kind' => 'customer',
'customerId' => '6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84'
],
'currency' => 'USD',
'quoteRef' => 'Q-1042',
'lines' => [
[
'lineRef' => 'L1',
'sku' => '6205-2RS',
'quantity' => '400'
],
[
'lineRef' => 'L2',
'sku' => '6206-ZZ',
'quantity' => '120'
]
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.elastly.ai/v1/quotes/price")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"buyer\": {\n \"kind\": \"customer\",\n \"customerId\": \"6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84\"\n },\n \"currency\": \"USD\",\n \"quoteRef\": \"Q-1042\",\n \"lines\": [\n {\n \"lineRef\": \"L1\",\n \"sku\": \"6205-2RS\",\n \"quantity\": \"400\"\n },\n {\n \"lineRef\": \"L2\",\n \"sku\": \"6206-ZZ\",\n \"quantity\": \"120\"\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.elastly.ai/v1/quotes/price"
payload := strings.NewReader("{\n \"buyer\": {\n \"kind\": \"customer\",\n \"customerId\": \"6f1c2a4e-8b7d-4c3e-9a51-2d0f7e3b9c84\"\n },\n \"currency\": \"USD\",\n \"quoteRef\": \"Q-1042\",\n \"lines\": [\n {\n \"lineRef\": \"L1\",\n \"sku\": \"6205-2RS\",\n \"quantity\": \"400\"\n },\n {\n \"lineRef\": \"L2\",\n \"sku\": \"6206-ZZ\",\n \"quantity\": \"120\"\n }\n ]\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))
}{
"pricingVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"digest": "<string>",
"pricedAt": "2023-11-07T05:31:56Z",
"pricingDay": "2023-12-25",
"lines": [
{
"lineRef": "<string>",
"sku": "<string>",
"state": "ok",
"price": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"unitPrice": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"guard": "none",
"warnings": [
{
"code": "<string>",
"guards": [
"<string>"
],
"source": "<string>",
"channels": [
"quote"
],
"gap": {
"amount": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"points": "<string>"
}
}
],
"trace": [
{
"kind": "category",
"termKey": "<string>",
"label": "<string>",
"source": "<string>",
"valuePts": "<string>",
"shadowPts": "<string>",
"status": "applied",
"input": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"output": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"reason": "<string>",
"attributeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy": {
"name": "<string>",
"ruleKey": "<string>",
"ruleNumber": 123,
"ruleName": "<string>",
"reads": [
{
"field": "days_of_stock",
"window": 7,
"value": "<string>",
"op": "gt",
"threshold": "<string>",
"thresholds": [
"<string>"
],
"holds": true
}
],
"shape": 1,
"applyOnTop": true,
"orderMode": "policy"
},
"orderSize": {
"source": "policy",
"basis": "quantity",
"tier": {
"from": 123,
"points": 123
},
"tiers": [
{
"from": 123,
"points": 123,
"basis": "quantity"
}
]
},
"replaced": [
"<string>"
],
"evidence": {
"level": "segment",
"strength": "High",
"observed": {
"lines": 1,
"invoices": 1,
"distinctPrices": 1,
"lastInvoiceDay": "2023-12-25",
"rangeLowPts": "<string>",
"rangeHighPts": "<string>",
"customers": 1
}
},
"learnedFrom": {
"months": 123,
"lines": 1,
"strength": "High"
}
}
],
"fxRateIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"evaluationFingerprint": "<string>",
"priceId": "<string>",
"version": 4503599627370495,
"validFrom": "2023-11-07T05:31:56Z",
"validUntil": "2023-11-07T05:31:56Z",
"cost": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
},
"floorPts": "<string>",
"targetPts": "<string>",
"ceilingPts": "<string>",
"markupPts": "<string>",
"appliedMarkupPts": "<string>",
"decisionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"totals": [
{
"currency": "<string>",
"amount": {
"amount": "<string>",
"currency": "<string>",
"scale": 9,
"roundingPolicyVersion": "<string>"
}
}
],
"complete": true
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}