Orders
Create order line
Adds a new order line to an existing order with quantity, pricing, and tax information. Validates that the product and variant exist. Publishes an order updated event.
POST
/
api
/
v1
/
{team_slug}
/
{app_slug}
/
orders
/
{order_id}
/
lines
Create order line
curl --request POST \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_price_amount": 1,
"currency_code": "<string>",
"product_id": "<string>",
"quantity": 2,
"total_price_amount": 1,
"variant_id": "<string>",
"tax_group_id": "<string>",
"total_discount_amount": 1,
"total_tax_amount": 1
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines"
payload = {
"base_price_amount": 1,
"currency_code": "<string>",
"product_id": "<string>",
"quantity": 2,
"total_price_amount": 1,
"variant_id": "<string>",
"tax_group_id": "<string>",
"total_discount_amount": 1,
"total_tax_amount": 1
}
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({
base_price_amount: 1,
currency_code: '<string>',
product_id: '<string>',
quantity: 2,
total_price_amount: 1,
variant_id: '<string>',
tax_group_id: '<string>',
total_discount_amount: 1,
total_tax_amount: 1
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines', 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.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines",
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([
'base_price_amount' => 1,
'currency_code' => '<string>',
'product_id' => '<string>',
'quantity' => 2,
'total_price_amount' => 1,
'variant_id' => '<string>',
'tax_group_id' => '<string>',
'total_discount_amount' => 1,
'total_tax_amount' => 1
]),
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.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines"
payload := strings.NewReader("{\n \"base_price_amount\": 1,\n \"currency_code\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"total_price_amount\": 1,\n \"variant_id\": \"<string>\",\n \"tax_group_id\": \"<string>\",\n \"total_discount_amount\": 1,\n \"total_tax_amount\": 1\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.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_price_amount\": 1,\n \"currency_code\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"total_price_amount\": 1,\n \"variant_id\": \"<string>\",\n \"tax_group_id\": \"<string>\",\n \"total_discount_amount\": 1,\n \"total_tax_amount\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines")
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 \"base_price_amount\": 1,\n \"currency_code\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"total_price_amount\": 1,\n \"variant_id\": \"<string>\",\n \"tax_group_id\": \"<string>\",\n \"total_discount_amount\": 1,\n \"total_tax_amount\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"base_price_amount": 123,
"created_at": "<string>",
"currency_code": "<string>",
"first_image_path": "<string>",
"id": "<string>",
"order_id": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"product_number": "<string>",
"quantity": 123,
"short_description": "<string>",
"tax_group_id": "<string>",
"total_discount_amount": 123,
"total_price_amount": 123,
"total_sale_price": 123,
"total_tax_amount": 123,
"updated_at": "<string>",
"variant_id": "<string>",
"variant_name": "<string>",
"variant_number": "<string>"
},
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}Authorizations
Management API token, sent as Authorization: Bearer <token>.
Path Parameters
App slug
Team slug
Order ID (UUID)
Body
application/json
Order line data
Required range:
x >= 0Required range:
x >= 1Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0⌘I
Create order line
curl --request POST \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_price_amount": 1,
"currency_code": "<string>",
"product_id": "<string>",
"quantity": 2,
"total_price_amount": 1,
"variant_id": "<string>",
"tax_group_id": "<string>",
"total_discount_amount": 1,
"total_tax_amount": 1
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines"
payload = {
"base_price_amount": 1,
"currency_code": "<string>",
"product_id": "<string>",
"quantity": 2,
"total_price_amount": 1,
"variant_id": "<string>",
"tax_group_id": "<string>",
"total_discount_amount": 1,
"total_tax_amount": 1
}
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({
base_price_amount: 1,
currency_code: '<string>',
product_id: '<string>',
quantity: 2,
total_price_amount: 1,
variant_id: '<string>',
tax_group_id: '<string>',
total_discount_amount: 1,
total_tax_amount: 1
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines', 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.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines",
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([
'base_price_amount' => 1,
'currency_code' => '<string>',
'product_id' => '<string>',
'quantity' => 2,
'total_price_amount' => 1,
'variant_id' => '<string>',
'tax_group_id' => '<string>',
'total_discount_amount' => 1,
'total_tax_amount' => 1
]),
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.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines"
payload := strings.NewReader("{\n \"base_price_amount\": 1,\n \"currency_code\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"total_price_amount\": 1,\n \"variant_id\": \"<string>\",\n \"tax_group_id\": \"<string>\",\n \"total_discount_amount\": 1,\n \"total_tax_amount\": 1\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.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_price_amount\": 1,\n \"currency_code\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"total_price_amount\": 1,\n \"variant_id\": \"<string>\",\n \"tax_group_id\": \"<string>\",\n \"total_discount_amount\": 1,\n \"total_tax_amount\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/orders/{order_id}/lines")
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 \"base_price_amount\": 1,\n \"currency_code\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"total_price_amount\": 1,\n \"variant_id\": \"<string>\",\n \"tax_group_id\": \"<string>\",\n \"total_discount_amount\": 1,\n \"total_tax_amount\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"base_price_amount": 123,
"created_at": "<string>",
"currency_code": "<string>",
"first_image_path": "<string>",
"id": "<string>",
"order_id": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"product_number": "<string>",
"quantity": 123,
"short_description": "<string>",
"tax_group_id": "<string>",
"total_discount_amount": 123,
"total_price_amount": 123,
"total_sale_price": 123,
"total_tax_amount": 123,
"updated_at": "<string>",
"variant_id": "<string>",
"variant_name": "<string>",
"variant_number": "<string>"
},
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}