Purchase-orders
Create purchaseOrders
Create purchase orders
POST
/
purchase-orders
Create purchaseOrders
curl --request POST \
--url https://idalia.app/api/purchase-orders \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
[
{
"poNumber": "<string>",
"status": "<string>",
"approvalStatus": "<string>",
"currency": "<string>",
"total": 123
}
]
'import requests
url = "https://idalia.app/api/purchase-orders"
payload = [
{
"poNumber": "<string>",
"status": "<string>",
"approvalStatus": "<string>",
"currency": "<string>",
"total": 123
}
]
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
poNumber: '<string>',
status: '<string>',
approvalStatus: '<string>',
currency: '<string>',
total: 123
}
])
};
fetch('https://idalia.app/api/purchase-orders', 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://idalia.app/api/purchase-orders",
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([
[
'poNumber' => '<string>',
'status' => '<string>',
'approvalStatus' => '<string>',
'currency' => '<string>',
'total' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://idalia.app/api/purchase-orders"
payload := strings.NewReader("[\n {\n \"poNumber\": \"<string>\",\n \"status\": \"<string>\",\n \"approvalStatus\": \"<string>\",\n \"currency\": \"<string>\",\n \"total\": 123\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://idalia.app/api/purchase-orders")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"poNumber\": \"<string>\",\n \"status\": \"<string>\",\n \"approvalStatus\": \"<string>\",\n \"currency\": \"<string>\",\n \"total\": 123\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://idalia.app/api/purchase-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"poNumber\": \"<string>\",\n \"status\": \"<string>\",\n \"approvalStatus\": \"<string>\",\n \"currency\": \"<string>\",\n \"total\": 123\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"createdAt": "<string>",
"workspaceId": "<string>",
"poNumber": "<string>",
"createdById": "<string>",
"updatedAt": "<string>",
"updatedById": "<string>",
"status": "<string>",
"approvalStatus": "<string>",
"currency": "<string>",
"total": 123
}
]{
"error": "Invalid request parameters",
"code": "400"
}{
"error": "Authentication required",
"code": "401"
}{
"error": "Access denied",
"code": "403"
}{
"error": "An unexpected error occurred",
"code": "500"
}Body
application/json
Array of data to create purchase orders
Response
Returns a list of the newly created purchase order objects
⌘I
Create purchaseOrders
curl --request POST \
--url https://idalia.app/api/purchase-orders \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
[
{
"poNumber": "<string>",
"status": "<string>",
"approvalStatus": "<string>",
"currency": "<string>",
"total": 123
}
]
'import requests
url = "https://idalia.app/api/purchase-orders"
payload = [
{
"poNumber": "<string>",
"status": "<string>",
"approvalStatus": "<string>",
"currency": "<string>",
"total": 123
}
]
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
poNumber: '<string>',
status: '<string>',
approvalStatus: '<string>',
currency: '<string>',
total: 123
}
])
};
fetch('https://idalia.app/api/purchase-orders', 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://idalia.app/api/purchase-orders",
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([
[
'poNumber' => '<string>',
'status' => '<string>',
'approvalStatus' => '<string>',
'currency' => '<string>',
'total' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://idalia.app/api/purchase-orders"
payload := strings.NewReader("[\n {\n \"poNumber\": \"<string>\",\n \"status\": \"<string>\",\n \"approvalStatus\": \"<string>\",\n \"currency\": \"<string>\",\n \"total\": 123\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://idalia.app/api/purchase-orders")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"poNumber\": \"<string>\",\n \"status\": \"<string>\",\n \"approvalStatus\": \"<string>\",\n \"currency\": \"<string>\",\n \"total\": 123\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://idalia.app/api/purchase-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"poNumber\": \"<string>\",\n \"status\": \"<string>\",\n \"approvalStatus\": \"<string>\",\n \"currency\": \"<string>\",\n \"total\": 123\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"createdAt": "<string>",
"workspaceId": "<string>",
"poNumber": "<string>",
"createdById": "<string>",
"updatedAt": "<string>",
"updatedById": "<string>",
"status": "<string>",
"approvalStatus": "<string>",
"currency": "<string>",
"total": 123
}
]{
"error": "Invalid request parameters",
"code": "400"
}{
"error": "Authentication required",
"code": "401"
}{
"error": "Access denied",
"code": "403"
}{
"error": "An unexpected error occurred",
"code": "500"
}
