curl --request POST \
--url https://api.tilta.io/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"buyer_external_id": "<string>",
"ordered_at": 123,
"payment_method": "TRANSFER",
"payment_term": "DEFER_30D",
"amount": {
"net": 2,
"gross": 2,
"tax": 1
},
"merchant_external_id": "<string>",
"comment": "For Daniel without tomatoes",
"delivery_address": {
"postcode": "12345",
"city": "Berlin",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
},
"custom_data": {},
"line_items": [
{
"name": "<string>",
"category": "<string>",
"price": 123,
"quantity": 1,
"description": "<string>"
}
],
"contact_external_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
buyer_external_id: '<string>',
ordered_at: 123,
payment_method: 'TRANSFER',
payment_term: 'DEFER_30D',
amount: {net: 2, gross: 2, tax: 1},
merchant_external_id: '<string>',
comment: 'For Daniel without tomatoes',
delivery_address: {
postcode: '12345',
city: 'Berlin',
street: 'Example Street',
house: '42b',
additional: 'c/o Testimonial'
},
custom_data: {},
line_items: [
{
name: '<string>',
category: '<string>',
price: 123,
quantity: 1,
description: '<string>'
}
],
contact_external_id: '<string>'
})
};
fetch('https://api.tilta.io/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tilta.io/v1/orders"
payload = {
"external_id": "<string>",
"buyer_external_id": "<string>",
"ordered_at": 123,
"payment_method": "TRANSFER",
"payment_term": "DEFER_30D",
"amount": {
"net": 2,
"gross": 2,
"tax": 1
},
"merchant_external_id": "<string>",
"comment": "For Daniel without tomatoes",
"delivery_address": {
"postcode": "12345",
"city": "Berlin",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
},
"custom_data": {},
"line_items": [
{
"name": "<string>",
"category": "<string>",
"price": 123,
"quantity": 1,
"description": "<string>"
}
],
"contact_external_id": "<string>"
}
headers = {
"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://api.tilta.io/v1/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([
'external_id' => '<string>',
'buyer_external_id' => '<string>',
'ordered_at' => 123,
'payment_method' => 'TRANSFER',
'payment_term' => 'DEFER_30D',
'amount' => [
'net' => 2,
'gross' => 2,
'tax' => 1
],
'merchant_external_id' => '<string>',
'comment' => 'For Daniel without tomatoes',
'delivery_address' => [
'postcode' => '12345',
'city' => 'Berlin',
'street' => 'Example Street',
'house' => '42b',
'additional' => 'c/o Testimonial'
],
'custom_data' => [
],
'line_items' => [
[
'name' => '<string>',
'category' => '<string>',
'price' => 123,
'quantity' => 1,
'description' => '<string>'
]
],
'contact_external_id' => '<string>'
]),
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;
}{
"external_id": "<string>",
"status": "OPEN",
"buyer_external_id": "<string>",
"created_at": 1582896122,
"updated_at": 1582896122,
"contact": {
"external_id": "<string>",
"buyer_external_id": "<string>",
"assign_to_all_invoices": true,
"created_at": 1582896122,
"updated_at": 1582896122,
"salutation": "MR",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "+491711010101",
"address": {
"postcode": "12345",
"city": "Berlin",
"country": "AF",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
}
},
"merchant_external_id": "<string>",
"ordered_at": 123,
"payment_method": "TRANSFER",
"payment_term": "DEFER_30D",
"amount": {
"net": 2,
"gross": 2,
"currency": "EUR",
"tax": 1
},
"buyer": {
"legal_name": "<string>"
},
"comment": "For Daniel without tomatoes",
"delivery_address": {
"postcode": "12345",
"city": "Berlin",
"country": "AF",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
},
"custom_data": {},
"line_items": [
{
"name": "<string>",
"category": "<string>",
"price": 123,
"currency": "EUR",
"quantity": 1,
"description": "<string>"
}
]
}{
"code": "BAD_REQUEST",
"error": "Request validation failed. 1 issue found.",
"issues": [
{
"code": "INVALID_TYPE",
"path": "body.registered_at",
"message": "Invalid type"
}
]
}{
"error": "Unauthorized",
"code": "UNAUTHORIZED"
}{
"error": "No Entity found",
"code": "NOT_FOUND"
}{
"error": "Order with id ORDER-1042 is already created.",
"code": "CONFLICT"
}Create an order
Submit a new order to declare a purchase intent. The order is OPEN until the buyer authorizes it at checkout or you confirm it.
curl --request POST \
--url https://api.tilta.io/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"buyer_external_id": "<string>",
"ordered_at": 123,
"payment_method": "TRANSFER",
"payment_term": "DEFER_30D",
"amount": {
"net": 2,
"gross": 2,
"tax": 1
},
"merchant_external_id": "<string>",
"comment": "For Daniel without tomatoes",
"delivery_address": {
"postcode": "12345",
"city": "Berlin",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
},
"custom_data": {},
"line_items": [
{
"name": "<string>",
"category": "<string>",
"price": 123,
"quantity": 1,
"description": "<string>"
}
],
"contact_external_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
buyer_external_id: '<string>',
ordered_at: 123,
payment_method: 'TRANSFER',
payment_term: 'DEFER_30D',
amount: {net: 2, gross: 2, tax: 1},
merchant_external_id: '<string>',
comment: 'For Daniel without tomatoes',
delivery_address: {
postcode: '12345',
city: 'Berlin',
street: 'Example Street',
house: '42b',
additional: 'c/o Testimonial'
},
custom_data: {},
line_items: [
{
name: '<string>',
category: '<string>',
price: 123,
quantity: 1,
description: '<string>'
}
],
contact_external_id: '<string>'
})
};
fetch('https://api.tilta.io/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tilta.io/v1/orders"
payload = {
"external_id": "<string>",
"buyer_external_id": "<string>",
"ordered_at": 123,
"payment_method": "TRANSFER",
"payment_term": "DEFER_30D",
"amount": {
"net": 2,
"gross": 2,
"tax": 1
},
"merchant_external_id": "<string>",
"comment": "For Daniel without tomatoes",
"delivery_address": {
"postcode": "12345",
"city": "Berlin",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
},
"custom_data": {},
"line_items": [
{
"name": "<string>",
"category": "<string>",
"price": 123,
"quantity": 1,
"description": "<string>"
}
],
"contact_external_id": "<string>"
}
headers = {
"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://api.tilta.io/v1/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([
'external_id' => '<string>',
'buyer_external_id' => '<string>',
'ordered_at' => 123,
'payment_method' => 'TRANSFER',
'payment_term' => 'DEFER_30D',
'amount' => [
'net' => 2,
'gross' => 2,
'tax' => 1
],
'merchant_external_id' => '<string>',
'comment' => 'For Daniel without tomatoes',
'delivery_address' => [
'postcode' => '12345',
'city' => 'Berlin',
'street' => 'Example Street',
'house' => '42b',
'additional' => 'c/o Testimonial'
],
'custom_data' => [
],
'line_items' => [
[
'name' => '<string>',
'category' => '<string>',
'price' => 123,
'quantity' => 1,
'description' => '<string>'
]
],
'contact_external_id' => '<string>'
]),
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;
}{
"external_id": "<string>",
"status": "OPEN",
"buyer_external_id": "<string>",
"created_at": 1582896122,
"updated_at": 1582896122,
"contact": {
"external_id": "<string>",
"buyer_external_id": "<string>",
"assign_to_all_invoices": true,
"created_at": 1582896122,
"updated_at": 1582896122,
"salutation": "MR",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "+491711010101",
"address": {
"postcode": "12345",
"city": "Berlin",
"country": "AF",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
}
},
"merchant_external_id": "<string>",
"ordered_at": 123,
"payment_method": "TRANSFER",
"payment_term": "DEFER_30D",
"amount": {
"net": 2,
"gross": 2,
"currency": "EUR",
"tax": 1
},
"buyer": {
"legal_name": "<string>"
},
"comment": "For Daniel without tomatoes",
"delivery_address": {
"postcode": "12345",
"city": "Berlin",
"country": "AF",
"street": "Example Street",
"house": "42b",
"additional": "c/o Testimonial"
},
"custom_data": {},
"line_items": [
{
"name": "<string>",
"category": "<string>",
"price": 123,
"currency": "EUR",
"quantity": 1,
"description": "<string>"
}
]
}{
"code": "BAD_REQUEST",
"error": "Request validation failed. 1 issue found.",
"issues": [
{
"code": "INVALID_TYPE",
"path": "body.registered_at",
"message": "Invalid type"
}
]
}{
"error": "Unauthorized",
"code": "UNAUTHORIZED"
}{
"error": "No Entity found",
"code": "NOT_FOUND"
}{
"error": "Order with id ORDER-1042 is already created.",
"code": "CONFLICT"
}OPEN: Tilta does not check it against the buyer’s credit facility and holds no amount for it. To reserve credit, send the buyer a checkout with Create a checkout for an order, or confirm the order with Confirm an order when the buyer is not present.
To link the order to the person at the buyer who handles it, send the contact_external_id of one of the buyer’s contacts. When you create the invoice for the order without a contact of its own, the invoice takes this contact, which then receives the emails about the invoice.
Headers
Body
Order to be created.
The chosen payment method for a respective order. Available payment methods depend on a number of criteria. Check the paymentterms endpoint for available options. May be left empty if the payment method has not been chosen yet.
CASH, CARD, TRANSFER, DEBIT "TRANSFER"
The chosen payment term for a respective order. Available payment terms depend on a number of criteria. Check the payment_terms endpoint for available options
PREPAYMENT, DEFER_3D, DEFER_7D, DEFER_14D, DEFER_21D, DEFER_30D, DEFER_45D, DEFER_60D, DEFER_75D, DEFER_90D, DEFER_120D, SPLIT_3M, SPLIT_6M "DEFER_30D"
Unique identifier of an existing contact of the order's buyer. An invoice created for the order without its own contact_external_id takes this contact when all of its orders have the same contact. The contact then receives the emails about the invoice in addition to the buyer's contacts with assign_to_all_invoices. If the contact doesn't exist or belongs to another buyer, Tilta rejects the request with 400 and RELATION_NOT_FOUND.
100^[a-zA-Z0-9-_]+$Response
Order has been successfully created.
The chosen payment method for a respective order. Available payment methods depend on a number of criteria. Check the paymentterms endpoint for available options. May be left empty if the payment method has not been chosen yet.
CASH, CARD, TRANSFER, DEBIT "TRANSFER"
The chosen payment term for a respective order. Available payment terms depend on a number of criteria. Check the payment_terms endpoint for available options
PREPAYMENT, DEFER_3D, DEFER_7D, DEFER_14D, DEFER_21D, DEFER_30D, DEFER_45D, DEFER_60D, DEFER_75D, DEFER_90D, DEFER_120D, SPLIT_3M, SPLIT_6M "DEFER_30D"