Webhook for new orders (v2)
curl --request POST \
--url https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId} \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"id": "<string>",
"created_at": "<string>",
"status": "<string>",
"total": 123,
"payment_methods": [
{}
],
"line_items": [
{
"title": "<string>",
"quantity": 123,
"price": 123,
"sku": "<string>",
"variant_title": "<string>",
"product_id": "<string>"
}
],
"customer": {
"email": "<string>",
"phone": "<string>",
"country_code": "<string>",
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"locale": "<string>"
},
"currency": "<string>",
"order_number": "<string>",
"fulfillment_status": "<string>",
"tracking_url": "<string>",
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"discount_codes": [
{
"code": "<string>",
"amount": 123,
"type": "<string>"
}
],
"cart_id": "<string>",
"subtotal": 123,
"total_tax": 123,
"total_discount": 123,
"total_shipping": 123
}
'import requests
url = "https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}"
payload = {
"id": "<string>",
"created_at": "<string>",
"status": "<string>",
"total": 123,
"payment_methods": [{}],
"line_items": [
{
"title": "<string>",
"quantity": 123,
"price": 123,
"sku": "<string>",
"variant_title": "<string>",
"product_id": "<string>"
}
],
"customer": {
"email": "<string>",
"phone": "<string>",
"country_code": "<string>",
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"locale": "<string>"
},
"currency": "<string>",
"order_number": "<string>",
"fulfillment_status": "<string>",
"tracking_url": "<string>",
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"discount_codes": [
{
"code": "<string>",
"amount": 123,
"type": "<string>"
}
],
"cart_id": "<string>",
"subtotal": 123,
"total_tax": 123,
"total_discount": 123,
"total_shipping": 123
}
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
created_at: '<string>',
status: '<string>',
total: 123,
payment_methods: [{}],
line_items: [
{
title: '<string>',
quantity: 123,
price: 123,
sku: '<string>',
variant_title: '<string>',
product_id: '<string>'
}
],
customer: {
email: '<string>',
phone: '<string>',
country_code: '<string>',
id: '<string>',
first_name: '<string>',
last_name: '<string>',
locale: '<string>'
},
currency: '<string>',
order_number: '<string>',
fulfillment_status: '<string>',
tracking_url: '<string>',
shipping_address: {
first_name: '<string>',
last_name: '<string>',
company: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
phone: '<string>'
},
billing_address: {},
discount_codes: [{code: '<string>', amount: 123, type: '<string>'}],
cart_id: '<string>',
subtotal: 123,
total_tax: 123,
total_discount: 123,
total_shipping: 123
})
};
fetch('https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}', 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-ai.textyess.com/webhooks/v2/new-order/{organizationId}",
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([
'id' => '<string>',
'created_at' => '<string>',
'status' => '<string>',
'total' => 123,
'payment_methods' => [
[
]
],
'line_items' => [
[
'title' => '<string>',
'quantity' => 123,
'price' => 123,
'sku' => '<string>',
'variant_title' => '<string>',
'product_id' => '<string>'
]
],
'customer' => [
'email' => '<string>',
'phone' => '<string>',
'country_code' => '<string>',
'id' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'locale' => '<string>'
],
'currency' => '<string>',
'order_number' => '<string>',
'fulfillment_status' => '<string>',
'tracking_url' => '<string>',
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'phone' => '<string>'
],
'billing_address' => [
],
'discount_codes' => [
[
'code' => '<string>',
'amount' => 123,
'type' => '<string>'
]
],
'cart_id' => '<string>',
'subtotal' => 123,
'total_tax' => 123,
'total_discount' => 123,
'total_shipping' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <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://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"status\": \"<string>\",\n \"total\": 123,\n \"payment_methods\": [\n {}\n ],\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"sku\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"country_code\": \"<string>\",\n \"id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"locale\": \"<string>\"\n },\n \"currency\": \"<string>\",\n \"order_number\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"tracking_url\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"discount_codes\": [\n {\n \"code\": \"<string>\",\n \"amount\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"cart_id\": \"<string>\",\n \"subtotal\": 123,\n \"total_tax\": 123,\n \"total_discount\": 123,\n \"total_shipping\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<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://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"status\": \"<string>\",\n \"total\": 123,\n \"payment_methods\": [\n {}\n ],\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"sku\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"country_code\": \"<string>\",\n \"id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"locale\": \"<string>\"\n },\n \"currency\": \"<string>\",\n \"order_number\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"tracking_url\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"discount_codes\": [\n {\n \"code\": \"<string>\",\n \"amount\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"cart_id\": \"<string>\",\n \"subtotal\": 123,\n \"total_tax\": 123,\n \"total_discount\": 123,\n \"total_shipping\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"status\": \"<string>\",\n \"total\": 123,\n \"payment_methods\": [\n {}\n ],\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"sku\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"country_code\": \"<string>\",\n \"id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"locale\": \"<string>\"\n },\n \"currency\": \"<string>\",\n \"order_number\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"tracking_url\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"discount_codes\": [\n {\n \"code\": \"<string>\",\n \"amount\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"cart_id\": \"<string>\",\n \"subtotal\": 123,\n \"total_tax\": 123,\n \"total_discount\": 123,\n \"total_shipping\": 123\n}"
response = http.request(request)
puts response.read_body{ "success": true }
{
"code": 400,
"message": "Validation failed"
}
{
"code": 401,
"message": "Unauthorized"
}
Orders API
Create Order
Send new order data to TextYess to unlock analytics and automations
POST
/
webhooks
/
v2
/
new-order
/
{organizationId}
Webhook for new orders (v2)
curl --request POST \
--url https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId} \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--data '
{
"id": "<string>",
"created_at": "<string>",
"status": "<string>",
"total": 123,
"payment_methods": [
{}
],
"line_items": [
{
"title": "<string>",
"quantity": 123,
"price": 123,
"sku": "<string>",
"variant_title": "<string>",
"product_id": "<string>"
}
],
"customer": {
"email": "<string>",
"phone": "<string>",
"country_code": "<string>",
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"locale": "<string>"
},
"currency": "<string>",
"order_number": "<string>",
"fulfillment_status": "<string>",
"tracking_url": "<string>",
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"discount_codes": [
{
"code": "<string>",
"amount": 123,
"type": "<string>"
}
],
"cart_id": "<string>",
"subtotal": 123,
"total_tax": 123,
"total_discount": 123,
"total_shipping": 123
}
'import requests
url = "https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}"
payload = {
"id": "<string>",
"created_at": "<string>",
"status": "<string>",
"total": 123,
"payment_methods": [{}],
"line_items": [
{
"title": "<string>",
"quantity": 123,
"price": 123,
"sku": "<string>",
"variant_title": "<string>",
"product_id": "<string>"
}
],
"customer": {
"email": "<string>",
"phone": "<string>",
"country_code": "<string>",
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"locale": "<string>"
},
"currency": "<string>",
"order_number": "<string>",
"fulfillment_status": "<string>",
"tracking_url": "<string>",
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>"
},
"billing_address": {},
"discount_codes": [
{
"code": "<string>",
"amount": 123,
"type": "<string>"
}
],
"cart_id": "<string>",
"subtotal": 123,
"total_tax": 123,
"total_discount": 123,
"total_shipping": 123
}
headers = {
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
created_at: '<string>',
status: '<string>',
total: 123,
payment_methods: [{}],
line_items: [
{
title: '<string>',
quantity: 123,
price: 123,
sku: '<string>',
variant_title: '<string>',
product_id: '<string>'
}
],
customer: {
email: '<string>',
phone: '<string>',
country_code: '<string>',
id: '<string>',
first_name: '<string>',
last_name: '<string>',
locale: '<string>'
},
currency: '<string>',
order_number: '<string>',
fulfillment_status: '<string>',
tracking_url: '<string>',
shipping_address: {
first_name: '<string>',
last_name: '<string>',
company: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
phone: '<string>'
},
billing_address: {},
discount_codes: [{code: '<string>', amount: 123, type: '<string>'}],
cart_id: '<string>',
subtotal: 123,
total_tax: 123,
total_discount: 123,
total_shipping: 123
})
};
fetch('https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}', 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-ai.textyess.com/webhooks/v2/new-order/{organizationId}",
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([
'id' => '<string>',
'created_at' => '<string>',
'status' => '<string>',
'total' => 123,
'payment_methods' => [
[
]
],
'line_items' => [
[
'title' => '<string>',
'quantity' => 123,
'price' => 123,
'sku' => '<string>',
'variant_title' => '<string>',
'product_id' => '<string>'
]
],
'customer' => [
'email' => '<string>',
'phone' => '<string>',
'country_code' => '<string>',
'id' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'locale' => '<string>'
],
'currency' => '<string>',
'order_number' => '<string>',
'fulfillment_status' => '<string>',
'tracking_url' => '<string>',
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'phone' => '<string>'
],
'billing_address' => [
],
'discount_codes' => [
[
'code' => '<string>',
'amount' => 123,
'type' => '<string>'
]
],
'cart_id' => '<string>',
'subtotal' => 123,
'total_tax' => 123,
'total_discount' => 123,
'total_shipping' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <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://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"status\": \"<string>\",\n \"total\": 123,\n \"payment_methods\": [\n {}\n ],\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"sku\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"country_code\": \"<string>\",\n \"id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"locale\": \"<string>\"\n },\n \"currency\": \"<string>\",\n \"order_number\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"tracking_url\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"discount_codes\": [\n {\n \"code\": \"<string>\",\n \"amount\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"cart_id\": \"<string>\",\n \"subtotal\": 123,\n \"total_tax\": 123,\n \"total_discount\": 123,\n \"total_shipping\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-auth-token", "<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://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"status\": \"<string>\",\n \"total\": 123,\n \"payment_methods\": [\n {}\n ],\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"sku\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"country_code\": \"<string>\",\n \"id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"locale\": \"<string>\"\n },\n \"currency\": \"<string>\",\n \"order_number\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"tracking_url\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"discount_codes\": [\n {\n \"code\": \"<string>\",\n \"amount\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"cart_id\": \"<string>\",\n \"subtotal\": 123,\n \"total_tax\": 123,\n \"total_discount\": 123,\n \"total_shipping\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.textyess.com/webhooks/v2/new-order/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"status\": \"<string>\",\n \"total\": 123,\n \"payment_methods\": [\n {}\n ],\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"sku\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"product_id\": \"<string>\"\n }\n ],\n \"customer\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"country_code\": \"<string>\",\n \"id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"locale\": \"<string>\"\n },\n \"currency\": \"<string>\",\n \"order_number\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"tracking_url\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {},\n \"discount_codes\": [\n {\n \"code\": \"<string>\",\n \"amount\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"cart_id\": \"<string>\",\n \"subtotal\": 123,\n \"total_tax\": 123,\n \"total_discount\": 123,\n \"total_shipping\": 123\n}"
response = http.request(request)
puts response.read_body{ "success": true }
{
"code": 400,
"message": "Validation failed"
}
{
"code": 401,
"message": "Unauthorized"
}
Overview
The v2 new-order webhook lets TextYess receive your orders so it can attribute them to the WhatsApp conversations, campaigns, and automations that drove them, and power analytics. It is CMS-agnostic: map your store’s order to the contract below once, whatever platform you use.Automations only fire for recent orders. Flows with a new-order trigger run only when the
order’s
created_at is within the last 24 hours. Older orders are still ingested for analytics
and attribution, so backfilling historical orders is safe — it will never message your customers.Authentication
Send your organization token in thex-auth-token header. You can find both your token and your
organization id in the Developers section:
x-auth-token: your_token
Path Parameters
string
required
Your organization id, from https://ai.textyess.com/developers
Body Parameters
string
required
Your source order id. Used for idempotency — re-sending the same id for an organization is a no-op, so retries are safe.
string
required
The order timestamp (ISO 8601). A value without a timezone is treated as UTC. Send the real order date so historical orders attribute correctly — it also gates automations: flows run only when
created_at is within the last 24 hours.string
required
Free-text payment/order status.
Show Recognized values
Show Recognized values
paid / complete / completed / processing / captured / success count as paid; refunded / partially_refunded / closed as refunded; canceled / voided / failed as voided; any other value counts as pending.number
required
The grand total in currency units. A numeric string (“99.90”) is also accepted.
array
required
The payment methods used for the order.
array
required
object
required
Customer identity. For anonymous orders, supply placeholder values you control.
string
ISO currency code. Defaults to EUR when omitted.
string
Human-facing order number / increment id.
string
Free-text fulfillment status.
string
Tracking URL for the shipment.
object
object
Billing address — same shape as
shipping_address (all fields optional).array
string
Cart identifier (enables onsite-chat attribution).
number
Subtotal.
number
Total tax.
number
Total discount.
number
Total shipping.
Response
boolean
Whether the webhook was processed.
{ "success": true }
{
"code": 400,
"message": "Validation failed"
}
{
"code": 401,
"message": "Unauthorized"
}
⌘I