Create a new order
curl --request POST \
--url http://localhost/api/orders \
--header 'Content-Type: application/json' \
--data '
{
"identification": {
"seller": {
"pink_id": "<string>",
"gln": "<string>"
},
"buyer": {
"pink_id": "<string>",
"gln": "<string>"
},
"pink_id": "<string>",
"buyer_order_id": "<string>",
"seller_order_id": "<string>"
},
"order_date": "2023-11-07T05:31:56Z",
"buyer": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"delivery_address": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"seller": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"lines": [
{
"line_number": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"quantity": 123,
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
],
"total_amount": {
"amount": 123
},
"net_amount": {
"amount": 123
},
"tax_details": [
{
"rate": 123,
"amount": {
"amount": 123
},
"type": "<string>"
}
],
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost/api/orders"
payload = {
"identification": {
"seller": {
"pink_id": "<string>",
"gln": "<string>"
},
"buyer": {
"pink_id": "<string>",
"gln": "<string>"
},
"pink_id": "<string>",
"buyer_order_id": "<string>",
"seller_order_id": "<string>"
},
"order_date": "2023-11-07T05:31:56Z",
"buyer": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"delivery_address": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"seller": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"lines": [
{
"line_number": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"quantity": 123,
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
],
"total_amount": { "amount": 123 },
"net_amount": { "amount": 123 },
"tax_details": [
{
"rate": 123,
"amount": { "amount": 123 },
"type": "<string>"
}
],
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
identification: {
seller: {pink_id: '<string>', gln: '<string>'},
buyer: {pink_id: '<string>', gln: '<string>'},
pink_id: '<string>',
buyer_order_id: '<string>',
seller_order_id: '<string>'
},
order_date: '2023-11-07T05:31:56Z',
buyer: {
name: '<string>',
address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
line2: '<string>'
},
identification: {gln: '<string>', tax_id: '<string>'},
contact_person: '<string>',
email: 'jsmith@example.com',
phone: '<string>'
},
delivery_address: {
name: '<string>',
address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
line2: '<string>'
},
identification: {gln: '<string>', tax_id: '<string>'},
contact_person: '<string>',
email: 'jsmith@example.com',
phone: '<string>'
},
seller: {
name: '<string>',
address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
line2: '<string>'
},
identification: {gln: '<string>', tax_id: '<string>'},
contact_person: '<string>',
email: 'jsmith@example.com',
phone: '<string>'
},
lines: [
{
line_number: '<string>',
product_id: '<string>',
product_name: '<string>',
quantity: 123,
expected_delivery_date: '2023-11-07T05:31:56Z'
}
],
total_amount: {amount: 123},
net_amount: {amount: 123},
tax_details: [{rate: 123, amount: {amount: 123}, type: '<string>'}],
expected_delivery_date: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost/api/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 => "http://localhost/api/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([
'identification' => [
'seller' => [
'pink_id' => '<string>',
'gln' => '<string>'
],
'buyer' => [
'pink_id' => '<string>',
'gln' => '<string>'
],
'pink_id' => '<string>',
'buyer_order_id' => '<string>',
'seller_order_id' => '<string>'
],
'order_date' => '2023-11-07T05:31:56Z',
'buyer' => [
'name' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>'
],
'identification' => [
'gln' => '<string>',
'tax_id' => '<string>'
],
'contact_person' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>'
],
'delivery_address' => [
'name' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>'
],
'identification' => [
'gln' => '<string>',
'tax_id' => '<string>'
],
'contact_person' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>'
],
'seller' => [
'name' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>'
],
'identification' => [
'gln' => '<string>',
'tax_id' => '<string>'
],
'contact_person' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>'
],
'lines' => [
[
'line_number' => '<string>',
'product_id' => '<string>',
'product_name' => '<string>',
'quantity' => 123,
'expected_delivery_date' => '2023-11-07T05:31:56Z'
]
],
'total_amount' => [
'amount' => 123
],
'net_amount' => [
'amount' => 123
],
'tax_details' => [
[
'rate' => 123,
'amount' => [
'amount' => 123
],
'type' => '<string>'
]
],
'expected_delivery_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost/api/orders"
payload := strings.NewReader("{\n \"identification\": {\n \"seller\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"buyer\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"pink_id\": \"<string>\",\n \"buyer_order_id\": \"<string>\",\n \"seller_order_id\": \"<string>\"\n },\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"delivery_address\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"seller\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"lines\": [\n {\n \"line_number\": \"<string>\",\n \"product_id\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 123,\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"total_amount\": {\n \"amount\": 123\n },\n \"net_amount\": {\n \"amount\": 123\n },\n \"tax_details\": [\n {\n \"rate\": 123,\n \"amount\": {\n \"amount\": 123\n },\n \"type\": \"<string>\"\n }\n ],\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost/api/orders")
.header("Content-Type", "application/json")
.body("{\n \"identification\": {\n \"seller\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"buyer\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"pink_id\": \"<string>\",\n \"buyer_order_id\": \"<string>\",\n \"seller_order_id\": \"<string>\"\n },\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"delivery_address\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"seller\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"lines\": [\n {\n \"line_number\": \"<string>\",\n \"product_id\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 123,\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"total_amount\": {\n \"amount\": 123\n },\n \"net_amount\": {\n \"amount\": 123\n },\n \"tax_details\": [\n {\n \"rate\": 123,\n \"amount\": {\n \"amount\": 123\n },\n \"type\": \"<string>\"\n }\n ],\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/orders")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"identification\": {\n \"seller\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"buyer\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"pink_id\": \"<string>\",\n \"buyer_order_id\": \"<string>\",\n \"seller_order_id\": \"<string>\"\n },\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"delivery_address\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"seller\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"lines\": [\n {\n \"line_number\": \"<string>\",\n \"product_id\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 123,\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"total_amount\": {\n \"amount\": 123\n },\n \"net_amount\": {\n \"amount\": 123\n },\n \"tax_details\": [\n {\n \"rate\": 123,\n \"amount\": {\n \"amount\": 123\n },\n \"type\": \"<string>\"\n }\n ],\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Order created successfully",
"transmission_id": "<string>",
"": "<string>"
}{
"error": "<string>"
}{
"message": "<string>"
}{
"error": "Invalid request data",
"errors": "<string>"
}Order
Create a new order
POST
/
orders
Create a new order
curl --request POST \
--url http://localhost/api/orders \
--header 'Content-Type: application/json' \
--data '
{
"identification": {
"seller": {
"pink_id": "<string>",
"gln": "<string>"
},
"buyer": {
"pink_id": "<string>",
"gln": "<string>"
},
"pink_id": "<string>",
"buyer_order_id": "<string>",
"seller_order_id": "<string>"
},
"order_date": "2023-11-07T05:31:56Z",
"buyer": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"delivery_address": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"seller": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"lines": [
{
"line_number": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"quantity": 123,
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
],
"total_amount": {
"amount": 123
},
"net_amount": {
"amount": 123
},
"tax_details": [
{
"rate": 123,
"amount": {
"amount": 123
},
"type": "<string>"
}
],
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost/api/orders"
payload = {
"identification": {
"seller": {
"pink_id": "<string>",
"gln": "<string>"
},
"buyer": {
"pink_id": "<string>",
"gln": "<string>"
},
"pink_id": "<string>",
"buyer_order_id": "<string>",
"seller_order_id": "<string>"
},
"order_date": "2023-11-07T05:31:56Z",
"buyer": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"delivery_address": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"seller": {
"name": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"line2": "<string>"
},
"identification": {
"gln": "<string>",
"tax_id": "<string>"
},
"contact_person": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"lines": [
{
"line_number": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"quantity": 123,
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
],
"total_amount": { "amount": 123 },
"net_amount": { "amount": 123 },
"tax_details": [
{
"rate": 123,
"amount": { "amount": 123 },
"type": "<string>"
}
],
"expected_delivery_date": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
identification: {
seller: {pink_id: '<string>', gln: '<string>'},
buyer: {pink_id: '<string>', gln: '<string>'},
pink_id: '<string>',
buyer_order_id: '<string>',
seller_order_id: '<string>'
},
order_date: '2023-11-07T05:31:56Z',
buyer: {
name: '<string>',
address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
line2: '<string>'
},
identification: {gln: '<string>', tax_id: '<string>'},
contact_person: '<string>',
email: 'jsmith@example.com',
phone: '<string>'
},
delivery_address: {
name: '<string>',
address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
line2: '<string>'
},
identification: {gln: '<string>', tax_id: '<string>'},
contact_person: '<string>',
email: 'jsmith@example.com',
phone: '<string>'
},
seller: {
name: '<string>',
address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
line2: '<string>'
},
identification: {gln: '<string>', tax_id: '<string>'},
contact_person: '<string>',
email: 'jsmith@example.com',
phone: '<string>'
},
lines: [
{
line_number: '<string>',
product_id: '<string>',
product_name: '<string>',
quantity: 123,
expected_delivery_date: '2023-11-07T05:31:56Z'
}
],
total_amount: {amount: 123},
net_amount: {amount: 123},
tax_details: [{rate: 123, amount: {amount: 123}, type: '<string>'}],
expected_delivery_date: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost/api/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 => "http://localhost/api/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([
'identification' => [
'seller' => [
'pink_id' => '<string>',
'gln' => '<string>'
],
'buyer' => [
'pink_id' => '<string>',
'gln' => '<string>'
],
'pink_id' => '<string>',
'buyer_order_id' => '<string>',
'seller_order_id' => '<string>'
],
'order_date' => '2023-11-07T05:31:56Z',
'buyer' => [
'name' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>'
],
'identification' => [
'gln' => '<string>',
'tax_id' => '<string>'
],
'contact_person' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>'
],
'delivery_address' => [
'name' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>'
],
'identification' => [
'gln' => '<string>',
'tax_id' => '<string>'
],
'contact_person' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>'
],
'seller' => [
'name' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'line2' => '<string>'
],
'identification' => [
'gln' => '<string>',
'tax_id' => '<string>'
],
'contact_person' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>'
],
'lines' => [
[
'line_number' => '<string>',
'product_id' => '<string>',
'product_name' => '<string>',
'quantity' => 123,
'expected_delivery_date' => '2023-11-07T05:31:56Z'
]
],
'total_amount' => [
'amount' => 123
],
'net_amount' => [
'amount' => 123
],
'tax_details' => [
[
'rate' => 123,
'amount' => [
'amount' => 123
],
'type' => '<string>'
]
],
'expected_delivery_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost/api/orders"
payload := strings.NewReader("{\n \"identification\": {\n \"seller\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"buyer\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"pink_id\": \"<string>\",\n \"buyer_order_id\": \"<string>\",\n \"seller_order_id\": \"<string>\"\n },\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"delivery_address\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"seller\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"lines\": [\n {\n \"line_number\": \"<string>\",\n \"product_id\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 123,\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"total_amount\": {\n \"amount\": 123\n },\n \"net_amount\": {\n \"amount\": 123\n },\n \"tax_details\": [\n {\n \"rate\": 123,\n \"amount\": {\n \"amount\": 123\n },\n \"type\": \"<string>\"\n }\n ],\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost/api/orders")
.header("Content-Type", "application/json")
.body("{\n \"identification\": {\n \"seller\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"buyer\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"pink_id\": \"<string>\",\n \"buyer_order_id\": \"<string>\",\n \"seller_order_id\": \"<string>\"\n },\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"delivery_address\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"seller\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"lines\": [\n {\n \"line_number\": \"<string>\",\n \"product_id\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 123,\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"total_amount\": {\n \"amount\": 123\n },\n \"net_amount\": {\n \"amount\": 123\n },\n \"tax_details\": [\n {\n \"rate\": 123,\n \"amount\": {\n \"amount\": 123\n },\n \"type\": \"<string>\"\n }\n ],\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/orders")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"identification\": {\n \"seller\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"buyer\": {\n \"pink_id\": \"<string>\",\n \"gln\": \"<string>\"\n },\n \"pink_id\": \"<string>\",\n \"buyer_order_id\": \"<string>\",\n \"seller_order_id\": \"<string>\"\n },\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"buyer\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"delivery_address\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"seller\": {\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"identification\": {\n \"gln\": \"<string>\",\n \"tax_id\": \"<string>\"\n },\n \"contact_person\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\"\n },\n \"lines\": [\n {\n \"line_number\": \"<string>\",\n \"product_id\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 123,\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"total_amount\": {\n \"amount\": 123\n },\n \"net_amount\": {\n \"amount\": 123\n },\n \"tax_details\": [\n {\n \"rate\": 123,\n \"amount\": {\n \"amount\": 123\n },\n \"type\": \"<string>\"\n }\n ],\n \"expected_delivery_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Order created successfully",
"transmission_id": "<string>",
"": "<string>"
}{
"error": "<string>"
}{
"message": "<string>"
}{
"error": "Invalid request data",
"errors": "<string>"
}Body
application/json
Order
Show child attributes
Show child attributes
Available options:
purchase_order, sales_order Available options:
EUR, USD, GBP Buyer information
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Total order amount (gross)
Show child attributes
Show child attributes
Net amount (excluding tax)
Show child attributes
Show child attributes
Tax details
Show child attributes
Show child attributes
⌘I