Add custom event to order
curl --request POST \
--url https://api.sandbox.usenash.com/v1/order/{id}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"timestamp": "<string>",
"payload": {}
}
'import requests
url = "https://api.sandbox.usenash.com/v1/order/{id}/events"
payload = {
"name": "<string>",
"timestamp": "<string>",
"payload": {}
}
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({name: '<string>', timestamp: '<string>', payload: {}})
};
fetch('https://api.sandbox.usenash.com/v1/order/{id}/events', 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.sandbox.usenash.com/v1/order/{id}/events",
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([
'name' => '<string>',
'timestamp' => '<string>',
'payload' => [
]
]),
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.sandbox.usenash.com/v1/order/{id}/events"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"payload\": {}\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.sandbox.usenash.com/v1/order/{id}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/order/{id}/events")
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 \"name\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"event": {
"id": "<string>",
"eventName": "<string>",
"orderId": "<string>",
"eventCreatedAt": "<string>",
"payload": {}
}
}[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Add Custom Event to Order
Adds a customizable event to an existing Nash order. Custom order events will be shown in the order events page alongside other Nash-generated events.
POST
/
v1
/
order
/
{id}
/
events
Add custom event to order
curl --request POST \
--url https://api.sandbox.usenash.com/v1/order/{id}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"timestamp": "<string>",
"payload": {}
}
'import requests
url = "https://api.sandbox.usenash.com/v1/order/{id}/events"
payload = {
"name": "<string>",
"timestamp": "<string>",
"payload": {}
}
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({name: '<string>', timestamp: '<string>', payload: {}})
};
fetch('https://api.sandbox.usenash.com/v1/order/{id}/events', 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.sandbox.usenash.com/v1/order/{id}/events",
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([
'name' => '<string>',
'timestamp' => '<string>',
'payload' => [
]
]),
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.sandbox.usenash.com/v1/order/{id}/events"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"payload\": {}\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.sandbox.usenash.com/v1/order/{id}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/order/{id}/events")
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 \"name\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"event": {
"id": "<string>",
"eventName": "<string>",
"orderId": "<string>",
"eventCreatedAt": "<string>",
"payload": {}
}
}[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Limits
- Rate limits: Max 3 requests/second
- Size limit: Request body must not exceed 1kb
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique reference number for the order: either order.id (starts with "ord_") or order.externalId
Example:
"ord_1234567890"
Body
application/json
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I