Prices
Price lines
Price up to 100 lines in one idempotent call, each with the reason stack that produced it.
POST
/
api
/
v1
/
prices
Price up to 100 lines in one idempotent call
curl --request POST \
--url https://app.elastly.io/api/v1/prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"lines": [
{
"customerId": "<string>",
"customerExternalId": "<string>",
"productSku": "<string>",
"productExternalId": "<string>",
"quantity": 1,
"orderValueCents": 500000000000,
"orderTotalQuantity": 50000000
}
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
lines: [
{
customerId: '<string>',
customerExternalId: '<string>',
productSku: '<string>',
productExternalId: '<string>',
quantity: 1,
orderValueCents: 500000000000,
orderTotalQuantity: 50000000
}
]
})
};
fetch('https://app.elastly.io/api/v1/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.elastly.io/api/v1/prices"
payload = { "lines": [
{
"customerId": "<string>",
"customerExternalId": "<string>",
"productSku": "<string>",
"productExternalId": "<string>",
"quantity": 1,
"orderValueCents": 500000000000,
"orderTotalQuantity": 50000000
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"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://app.elastly.io/api/v1/prices",
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([
'lines' => [
[
'customerId' => '<string>',
'customerExternalId' => '<string>',
'productSku' => '<string>',
'productExternalId' => '<string>',
'quantity' => 1,
'orderValueCents' => 500000000000,
'orderTotalQuantity' => 50000000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://app.elastly.io/api/v1/prices")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lines\": [\n {\n \"customerId\": \"<string>\",\n \"customerExternalId\": \"<string>\",\n \"productSku\": \"<string>\",\n \"productExternalId\": \"<string>\",\n \"quantity\": 1,\n \"orderValueCents\": 500000000000,\n \"orderTotalQuantity\": 50000000\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.elastly.io/api/v1/prices"
payload := strings.NewReader("{\n \"lines\": [\n {\n \"customerId\": \"<string>\",\n \"customerExternalId\": \"<string>\",\n \"productSku\": \"<string>\",\n \"productExternalId\": \"<string>\",\n \"quantity\": 1,\n \"orderValueCents\": 500000000000,\n \"orderTotalQuantity\": 50000000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}{
"lines": [
{
"priceCents": 123,
"currency": "<string>",
"pricingDecisionId": "<string>",
"reason": [
{
"param": "<string>",
"marginDeltaBps": 123,
"label": "<string>",
"scope": "<string>"
}
],
"reasonSummary": "<string>",
"explanation": {
"short": "<string>",
"drivers": [
{
"param": "<string>",
"label": "<string>",
"points": 123
}
],
"marginPct": 123,
"targetMarginPct": 123
},
"guardrailsApplied": [
"<string>"
],
"confidenceScore": 123,
"ok": true
}
]
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}Authorizations
Elastly API key. Scopes: erp (price serving), connector (ingest + write-backs), storefront.
Headers
Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response.
Body
application/json
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
Per-line results.
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?
Previous
OverviewPush your catalog, customers, quotes, and orders to Elastly from a homegrown ERP or storefront, in batches you control.
Next
⌘I
Price up to 100 lines in one idempotent call
curl --request POST \
--url https://app.elastly.io/api/v1/prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"lines": [
{
"customerId": "<string>",
"customerExternalId": "<string>",
"productSku": "<string>",
"productExternalId": "<string>",
"quantity": 1,
"orderValueCents": 500000000000,
"orderTotalQuantity": 50000000
}
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
lines: [
{
customerId: '<string>',
customerExternalId: '<string>',
productSku: '<string>',
productExternalId: '<string>',
quantity: 1,
orderValueCents: 500000000000,
orderTotalQuantity: 50000000
}
]
})
};
fetch('https://app.elastly.io/api/v1/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.elastly.io/api/v1/prices"
payload = { "lines": [
{
"customerId": "<string>",
"customerExternalId": "<string>",
"productSku": "<string>",
"productExternalId": "<string>",
"quantity": 1,
"orderValueCents": 500000000000,
"orderTotalQuantity": 50000000
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"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://app.elastly.io/api/v1/prices",
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([
'lines' => [
[
'customerId' => '<string>',
'customerExternalId' => '<string>',
'productSku' => '<string>',
'productExternalId' => '<string>',
'quantity' => 1,
'orderValueCents' => 500000000000,
'orderTotalQuantity' => 50000000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://app.elastly.io/api/v1/prices")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lines\": [\n {\n \"customerId\": \"<string>\",\n \"customerExternalId\": \"<string>\",\n \"productSku\": \"<string>\",\n \"productExternalId\": \"<string>\",\n \"quantity\": 1,\n \"orderValueCents\": 500000000000,\n \"orderTotalQuantity\": 50000000\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.elastly.io/api/v1/prices"
payload := strings.NewReader("{\n \"lines\": [\n {\n \"customerId\": \"<string>\",\n \"customerExternalId\": \"<string>\",\n \"productSku\": \"<string>\",\n \"productExternalId\": \"<string>\",\n \"quantity\": 1,\n \"orderValueCents\": 500000000000,\n \"orderTotalQuantity\": 50000000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}{
"lines": [
{
"priceCents": 123,
"currency": "<string>",
"pricingDecisionId": "<string>",
"reason": [
{
"param": "<string>",
"marginDeltaBps": 123,
"label": "<string>",
"scope": "<string>"
}
],
"reasonSummary": "<string>",
"explanation": {
"short": "<string>",
"drivers": [
{
"param": "<string>",
"label": "<string>",
"points": 123
}
],
"marginPct": 123,
"targetMarginPct": 123
},
"guardrailsApplied": [
"<string>"
],
"confidenceScore": 123,
"ok": true
}
]
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"requestId": "<string>",
"param": "<string>"
}
}