API Reference
Create or update quotes, orders, invoices and credits
PUT
/
v1
/
documents
Create or update quotes, orders, invoices and credits
curl --request PUT \
--url https://api.elastly.ai/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"records": [
{
"externalKey": "<string>",
"fields": {
"kind": "quote",
"number": "<string>",
"customer": "<string>",
"date": "2023-12-25",
"currency": "<string>",
"lines": [
{
"lineId": "<string>",
"product": "<string>",
"quantity": "<string>",
"amount": "<string>",
"appliesToLine": "<string>",
"costEstimate": "<string>",
"location": "<string>",
"sourceDocument": "<string>",
"sourceLine": "<string>",
"priceId": "<string>",
"version": 4503599627370495
}
],
"exchangeRate": "<string>",
"total": "<string>",
"intercompany": true,
"siteKey": "<string>",
"siteName": "<string>",
"siteCountry": "<string>",
"modifiedAt": "2023-11-07T05:31:56Z"
},
"sequence": 4503599627370495,
"updatedAt": "2023-11-07T05:31:56Z",
"deleted": true
}
]
}
'const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
records: [
{
externalKey: '<string>',
fields: {
kind: 'quote',
number: '<string>',
customer: '<string>',
date: '2023-12-25',
currency: '<string>',
lines: [
{
lineId: '<string>',
product: '<string>',
quantity: '<string>',
amount: '<string>',
appliesToLine: '<string>',
costEstimate: '<string>',
location: '<string>',
sourceDocument: '<string>',
sourceLine: '<string>',
priceId: '<string>',
version: 4503599627370495
}
],
exchangeRate: '<string>',
total: '<string>',
intercompany: true,
siteKey: '<string>',
siteName: '<string>',
siteCountry: '<string>',
modifiedAt: '2023-11-07T05:31:56Z'
},
sequence: 4503599627370495,
updatedAt: '2023-11-07T05:31:56Z',
deleted: true
}
]
})
};
fetch('https://api.elastly.ai/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.elastly.ai/v1/documents"
payload = { "records": [
{
"externalKey": "<string>",
"fields": {
"kind": "quote",
"number": "<string>",
"customer": "<string>",
"date": "2023-12-25",
"currency": "<string>",
"lines": [
{
"lineId": "<string>",
"product": "<string>",
"quantity": "<string>",
"amount": "<string>",
"appliesToLine": "<string>",
"costEstimate": "<string>",
"location": "<string>",
"sourceDocument": "<string>",
"sourceLine": "<string>",
"priceId": "<string>",
"version": 4503599627370495
}
],
"exchangeRate": "<string>",
"total": "<string>",
"intercompany": True,
"siteKey": "<string>",
"siteName": "<string>",
"siteCountry": "<string>",
"modifiedAt": "2023-11-07T05:31:56Z"
},
"sequence": 4503599627370495,
"updatedAt": "2023-11-07T05:31:56Z",
"deleted": True
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.elastly.ai/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'records' => [
[
'externalKey' => '<string>',
'fields' => [
'kind' => 'quote',
'number' => '<string>',
'customer' => '<string>',
'date' => '2023-12-25',
'currency' => '<string>',
'lines' => [
[
'lineId' => '<string>',
'product' => '<string>',
'quantity' => '<string>',
'amount' => '<string>',
'appliesToLine' => '<string>',
'costEstimate' => '<string>',
'location' => '<string>',
'sourceDocument' => '<string>',
'sourceLine' => '<string>',
'priceId' => '<string>',
'version' => 4503599627370495
]
],
'exchangeRate' => '<string>',
'total' => '<string>',
'intercompany' => true,
'siteKey' => '<string>',
'siteName' => '<string>',
'siteCountry' => '<string>',
'modifiedAt' => '2023-11-07T05:31:56Z'
],
'sequence' => 4503599627370495,
'updatedAt' => '2023-11-07T05:31:56Z',
'deleted' => true
]
]
]),
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.put("https://api.elastly.ai/v1/documents")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"records\": [\n {\n \"externalKey\": \"<string>\",\n \"fields\": {\n \"kind\": \"quote\",\n \"number\": \"<string>\",\n \"customer\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"lines\": [\n {\n \"lineId\": \"<string>\",\n \"product\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"appliesToLine\": \"<string>\",\n \"costEstimate\": \"<string>\",\n \"location\": \"<string>\",\n \"sourceDocument\": \"<string>\",\n \"sourceLine\": \"<string>\",\n \"priceId\": \"<string>\",\n \"version\": 4503599627370495\n }\n ],\n \"exchangeRate\": \"<string>\",\n \"total\": \"<string>\",\n \"intercompany\": true,\n \"siteKey\": \"<string>\",\n \"siteName\": \"<string>\",\n \"siteCountry\": \"<string>\",\n \"modifiedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"sequence\": 4503599627370495,\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"deleted\": true\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.elastly.ai/v1/documents"
payload := strings.NewReader("{\n \"records\": [\n {\n \"externalKey\": \"<string>\",\n \"fields\": {\n \"kind\": \"quote\",\n \"number\": \"<string>\",\n \"customer\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"lines\": [\n {\n \"lineId\": \"<string>\",\n \"product\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"appliesToLine\": \"<string>\",\n \"costEstimate\": \"<string>\",\n \"location\": \"<string>\",\n \"sourceDocument\": \"<string>\",\n \"sourceLine\": \"<string>\",\n \"priceId\": \"<string>\",\n \"version\": 4503599627370495\n }\n ],\n \"exchangeRate\": \"<string>\",\n \"total\": \"<string>\",\n \"intercompany\": true,\n \"siteKey\": \"<string>\",\n \"siteName\": \"<string>\",\n \"siteCountry\": \"<string>\",\n \"modifiedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"sequence\": 4503599627370495,\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"deleted\": true\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"importId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"records": [
{
"index": 1,
"externalKey": "<string>",
"state": "accepted",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"notices": [
{
"field": "<string>",
"code": "<string>",
"message": "<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>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}Authorizations
Headers
Body
application/json
⌘I
Create or update quotes, orders, invoices and credits
curl --request PUT \
--url https://api.elastly.ai/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"records": [
{
"externalKey": "<string>",
"fields": {
"kind": "quote",
"number": "<string>",
"customer": "<string>",
"date": "2023-12-25",
"currency": "<string>",
"lines": [
{
"lineId": "<string>",
"product": "<string>",
"quantity": "<string>",
"amount": "<string>",
"appliesToLine": "<string>",
"costEstimate": "<string>",
"location": "<string>",
"sourceDocument": "<string>",
"sourceLine": "<string>",
"priceId": "<string>",
"version": 4503599627370495
}
],
"exchangeRate": "<string>",
"total": "<string>",
"intercompany": true,
"siteKey": "<string>",
"siteName": "<string>",
"siteCountry": "<string>",
"modifiedAt": "2023-11-07T05:31:56Z"
},
"sequence": 4503599627370495,
"updatedAt": "2023-11-07T05:31:56Z",
"deleted": true
}
]
}
'const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
records: [
{
externalKey: '<string>',
fields: {
kind: 'quote',
number: '<string>',
customer: '<string>',
date: '2023-12-25',
currency: '<string>',
lines: [
{
lineId: '<string>',
product: '<string>',
quantity: '<string>',
amount: '<string>',
appliesToLine: '<string>',
costEstimate: '<string>',
location: '<string>',
sourceDocument: '<string>',
sourceLine: '<string>',
priceId: '<string>',
version: 4503599627370495
}
],
exchangeRate: '<string>',
total: '<string>',
intercompany: true,
siteKey: '<string>',
siteName: '<string>',
siteCountry: '<string>',
modifiedAt: '2023-11-07T05:31:56Z'
},
sequence: 4503599627370495,
updatedAt: '2023-11-07T05:31:56Z',
deleted: true
}
]
})
};
fetch('https://api.elastly.ai/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.elastly.ai/v1/documents"
payload = { "records": [
{
"externalKey": "<string>",
"fields": {
"kind": "quote",
"number": "<string>",
"customer": "<string>",
"date": "2023-12-25",
"currency": "<string>",
"lines": [
{
"lineId": "<string>",
"product": "<string>",
"quantity": "<string>",
"amount": "<string>",
"appliesToLine": "<string>",
"costEstimate": "<string>",
"location": "<string>",
"sourceDocument": "<string>",
"sourceLine": "<string>",
"priceId": "<string>",
"version": 4503599627370495
}
],
"exchangeRate": "<string>",
"total": "<string>",
"intercompany": True,
"siteKey": "<string>",
"siteName": "<string>",
"siteCountry": "<string>",
"modifiedAt": "2023-11-07T05:31:56Z"
},
"sequence": 4503599627370495,
"updatedAt": "2023-11-07T05:31:56Z",
"deleted": True
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.elastly.ai/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'records' => [
[
'externalKey' => '<string>',
'fields' => [
'kind' => 'quote',
'number' => '<string>',
'customer' => '<string>',
'date' => '2023-12-25',
'currency' => '<string>',
'lines' => [
[
'lineId' => '<string>',
'product' => '<string>',
'quantity' => '<string>',
'amount' => '<string>',
'appliesToLine' => '<string>',
'costEstimate' => '<string>',
'location' => '<string>',
'sourceDocument' => '<string>',
'sourceLine' => '<string>',
'priceId' => '<string>',
'version' => 4503599627370495
]
],
'exchangeRate' => '<string>',
'total' => '<string>',
'intercompany' => true,
'siteKey' => '<string>',
'siteName' => '<string>',
'siteCountry' => '<string>',
'modifiedAt' => '2023-11-07T05:31:56Z'
],
'sequence' => 4503599627370495,
'updatedAt' => '2023-11-07T05:31:56Z',
'deleted' => true
]
]
]),
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.put("https://api.elastly.ai/v1/documents")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"records\": [\n {\n \"externalKey\": \"<string>\",\n \"fields\": {\n \"kind\": \"quote\",\n \"number\": \"<string>\",\n \"customer\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"lines\": [\n {\n \"lineId\": \"<string>\",\n \"product\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"appliesToLine\": \"<string>\",\n \"costEstimate\": \"<string>\",\n \"location\": \"<string>\",\n \"sourceDocument\": \"<string>\",\n \"sourceLine\": \"<string>\",\n \"priceId\": \"<string>\",\n \"version\": 4503599627370495\n }\n ],\n \"exchangeRate\": \"<string>\",\n \"total\": \"<string>\",\n \"intercompany\": true,\n \"siteKey\": \"<string>\",\n \"siteName\": \"<string>\",\n \"siteCountry\": \"<string>\",\n \"modifiedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"sequence\": 4503599627370495,\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"deleted\": true\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.elastly.ai/v1/documents"
payload := strings.NewReader("{\n \"records\": [\n {\n \"externalKey\": \"<string>\",\n \"fields\": {\n \"kind\": \"quote\",\n \"number\": \"<string>\",\n \"customer\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"currency\": \"<string>\",\n \"lines\": [\n {\n \"lineId\": \"<string>\",\n \"product\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"appliesToLine\": \"<string>\",\n \"costEstimate\": \"<string>\",\n \"location\": \"<string>\",\n \"sourceDocument\": \"<string>\",\n \"sourceLine\": \"<string>\",\n \"priceId\": \"<string>\",\n \"version\": 4503599627370495\n }\n ],\n \"exchangeRate\": \"<string>\",\n \"total\": \"<string>\",\n \"intercompany\": true,\n \"siteKey\": \"<string>\",\n \"siteName\": \"<string>\",\n \"siteCountry\": \"<string>\",\n \"modifiedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"sequence\": 4503599627370495,\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"deleted\": true\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"importId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"records": [
{
"index": 1,
"externalKey": "<string>",
"state": "accepted",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"notices": [
{
"field": "<string>",
"code": "<string>",
"message": "<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>"
}{
"error": "invalid_request",
"requestId": "<string>"
}{
"error": "invalid_request",
"requestId": "<string>"
}