API: notifications
Notifications are comments that can be added to an order. Use it if you need to track some changes on an order or anything related with the order that you don't want to forget.
Notifications can also be sent to your customers automatically.
GET /orders/{token}/notifications
This method returns the list of notifications belonging to the order.
Resource URL
GET https://app.snipcart.com/api/orders/{token}/notifications
Headers
Name | Value | Required? | Description |
---|---|---|---|
Accept | application/json |
Yes | Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make. |
Parameters
Name | Required? | Type | Description |
---|---|---|---|
limit |
No | int |
The maximum number of items returned by the request. Default value is 20. |
offset |
No | int |
The number of items that will be skipped. Default value is 0. |
Example request
curl -H "Accept: application/json" \
https://app.snipcart.com/api/orders/{token}/notifications?limit=10&offset=0 |
-u {API_KEY}:
Example response
{
"totalItems": 3,
"offset": 0,
"limit": 10,
"items": [
{
"id": "0c3ac0bb-a94a-45c5-a4d8-a7934a7f180a",
"creationDate": "2017-07-09T14:59:57.987Z",
"type": "Comment",
"deliveryMethod": "None",
"body": "",
"message": "Test"
},
{
"id": "8a52d2c5-acbe-478d-8e96-06fbd6755efe",
"creationDate": "2017-07-09T14:38:39.227Z",
"type": "Comment",
"deliveryMethod": "Email",
"body": "Email body will appear here...",
"message": "Test",
"subject": "Information regarding your order SNIP4962 on Snipcart.",
"sentOn": "2017-07-09T14:38:39.947Z"
},
{
"id": "e013a0d8-dbc2-45dc-85e5-900c0ce55da7",
"creationDate": "2017-06-07T19:09:29Z",
"type": "Invoice",
"deliveryMethod": "Email",
"body": "Invoice HTML will appear here...",
"subject": "Order SNIP4962 on Snipcart",
"sentOn": "2017-06-07T19:09:31.933Z"
}
]
}
POST /orders/{token}/notifications
This method creates a new notification on the specified order. Depending on the deliveryMethod
value this notification can be sent to the customer or kept private for internal usage.
Resource URL
POST https://app.snipcart.com/api/orders/{token}/notifications
Headers
Name | Value | Required? | Description |
---|---|---|---|
Accept | application/json |
Yes | Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make. |
Content-Type | application/json |
Yes | The request body needs to be JSON so we specify the content type. |
Parameters
Name | Required? | Type | Description |
---|---|---|---|
type |
Yes | enum |
The type of notification, can be: Comment , OrderStatusChanged , OrderShipped , TrackingNumber or Invoice . Use Comment if you want to send some information to your customer, the other types will generate automatic emails. |
deliveryMethod |
Yes | enum |
Can be Email if you want the notification to be sent by email or None to keep it private. |
message |
Depends* | string |
The message of the notification. *Optional when used with type of TrackingNumber |
Example request
curl https://app.snipcart.com/api/orders/{token}/notifications
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-u {API_KEY}: \
- d "{message: 'This is a test', type: 'Comment', deliveryMethod: 'Email'}"
Example response
{
"id": "bff8418c-1ed2-4ba1-8b40-2a8bbf7dfadc",
"creationDate": "2017-07-09T15:04:27.0970346Z",
"type": "Comment",
"deliveryMethod": "Email",
"body": "The Email body will appear here...",
"message": "This is a notification test",
"subject": "Information regarding your order SNIP4962 on Snipcart.",
"sentOn": "2017-07-09T15:04:27.4909269Z"
}