const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/orders/search', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"matched_order_items": [
{
"order_id": 37844,
"name": "Test Name",
"address": "100 Main St",
"address2": null,
"city": "Warwick",
"province": "NY",
"postal_code": "10990",
"country": "US",
"created_at": "2021-01-06 13:08:52 UTC",
"failure": null,
"individual_price": 99,
"status": "Processing"
}
],
"orders": [
{
"id": 37844,
"order": {
"sub_account_id": null,
"type": "postcard",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"style": 4,
"size": "4x6",
"front_image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png",
"high_quality_preview": "https://s3.amazonaws.com/cdn.thanks.io/user_assets/d/c09d39aadfc-3701d4467b8/high_quality_previews/558656e0-5020-11eb-b023-51fc31846b80.pdf",
"total_estimated_recipients": 1,
"authorization_total": 99,
"total_recipients": 1,
"grand_total": 99,
"status": "Fulfilled",
"method": "API",
"created_at": "2021-01-06 13:08:17",
"updated_at": "2021-01-06 13:08:57"
},
"stats": {
"delivered": 0,
"processing": 1,
"printed": 0,
"in_transit": 0,
"in_local_area": 0,
"processed_for_delivery": 0,
"re_routed": 0,
"returned_to_sender": 0,
"failed": 0
},
"errors": [],
"returned": []
}
]
}
Return summary of stats for orders between a date range.
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/orders/search', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"matched_order_items": [
{
"order_id": 37844,
"name": "Test Name",
"address": "100 Main St",
"address2": null,
"city": "Warwick",
"province": "NY",
"postal_code": "10990",
"country": "US",
"created_at": "2021-01-06 13:08:52 UTC",
"failure": null,
"individual_price": 99,
"status": "Processing"
}
],
"orders": [
{
"id": 37844,
"order": {
"sub_account_id": null,
"type": "postcard",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"style": 4,
"size": "4x6",
"front_image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png",
"high_quality_preview": "https://s3.amazonaws.com/cdn.thanks.io/user_assets/d/c09d39aadfc-3701d4467b8/high_quality_previews/558656e0-5020-11eb-b023-51fc31846b80.pdf",
"total_estimated_recipients": 1,
"authorization_total": 99,
"total_recipients": 1,
"grand_total": 99,
"status": "Fulfilled",
"method": "API",
"created_at": "2021-01-06 13:08:17",
"updated_at": "2021-01-06 13:08:57"
},
"stats": {
"delivered": 0,
"processing": 1,
"printed": 0,
"in_transit": 0,
"in_local_area": 0,
"processed_for_delivery": 0,
"re_routed": 0,
"returned_to_sender": 0,
"failed": 0
},
"errors": [],
"returned": []
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
OK
The response is of type object
.