Create an order batch
curl --request POST \
--url https://api.ongoody.com/v1/order_batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"from_name": "John",
"message": "Thank you!",
"send_method": "link_multiple_custom_list",
"payment_method_id": null,
"workspace_id": null,
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"recipients": [
{
"first_name": "Alena",
"last_name": "Kenter",
"email": "alena@ongoody.com"
},
{
"first_name": "Michael",
"last_name": "Franci",
"email": "michael@ongoody.com"
}
],
"cart": {
"items": [
{
"product_id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"quantity": 1
}
]
}
}'
{
"id": "69f05263-9290-4ed7-b592-7c8622d27e28",
"send_status": "complete",
"from_name": "John",
"message": "Thank you!",
"orders_count": 2,
"orders_preview": [
{
"id": "ef0eb4f5-a59f-4daf-92e5-27fcc77c5435",
"status": "created",
"individual_gift_link": "https://gifts.ongoody.com/gift/MmiRvO0TYZ8wZwglIeTfvf3n",
"recipient_first_name": "Alena",
"recipient_last_name": "Kenter",
"recipient_email": "alena@ongoody.com",
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"message": "Thank you!",
"thank_you_note": null,
"view_count_recipient": 0,
"is_swapped": false,
"order_batch_id": "69f05263-9290-4ed7-b592-7c8622d27e28",
"expires_at": null,
"cart": {
"id": "d8ab57d2-cffc-42a1-b7bd-3556f78d78df",
"items": [
{
"id": "b144684e-ab5b-4c43-bfc1-8a23116eba90",
"quantity": 1,
"product": {
"id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"name": "Cookies",
"brand": {
"id": "2c198d91-63f0-4235-8e88-5235b7ce676d",
"name": "Cookie Company"
}
}
}
]
},
"shipments": [],
"amounts": {
"amount_product": 1000,
"amount_shipping": 1000,
"amount_processing_fee": 100,
"amount_pre_tax_total": 2100,
"amount_tax": null,
"amount_total": null,
"amount_global_relay_cost": null
},
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15554683642@test.ongoody.com"
},
"workspace_id": "8962f21b-996c-4a7b-a183-572f10d2c8f6",
"workspace_name": "Test Team",
"original_cart": null,
"original_amounts": null,
"reference_id": "RHUA86JV0FQ0Q7N4WBNJJDDW",
"payment_link": null
},
{
"id": "c606b908-2889-4e07-b9a2-fea53884140e",
"status": "created",
"individual_gift_link": "https://gifts.ongoody.com/gift/T4TSiGf7IcHjwOMmFEunYzwu",
"recipient_first_name": "Michael",
"recipient_last_name": "Franci",
"recipient_email": "michael@ongoody.com",
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"message": "Thank you!",
"thank_you_note": null,
"view_count_recipient": 0,
"is_swapped": false,
"order_batch_id": "69f05263-9290-4ed7-b592-7c8622d27e28",
"expires_at": null,
"cart": {
"id": "d8ab57d2-cffc-42a1-b7bd-3556f78d78df",
"items": [
{
"id": "b144684e-ab5b-4c43-bfc1-8a23116eba90",
"quantity": 1,
"product": {
"id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"name": "Cookies",
"brand": {
"id": "2c198d91-63f0-4235-8e88-5235b7ce676d",
"name": "Cookie Company"
}
}
}
]
},
"shipments": [],
"amounts": {
"amount_product": 1000,
"amount_shipping": 1000,
"amount_processing_fee": 100,
"amount_pre_tax_total": 2100,
"amount_tax": null,
"amount_total": null,
"amount_global_relay_cost": null
},
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15554683642@test.ongoody.com"
},
"workspace_id": "8962f21b-996c-4a7b-a183-572f10d2c8f6",
"workspace_name": "Test Team",
"original_cart": null,
"original_amounts": null,
"reference_id": "UZAN5QHDEWBRY13DOPF8RKCS",
"payment_link": null
}
],
"recipients_count": 2,
"recipients_preview": [
{
"first_name": "Alena",
"last_name": "Kenter",
"email": "alena@ongoody.com"
},
{
"first_name": "Michael",
"last_name": "Franci",
"email": "michael@ongoody.com"
}
],
"cart": {
"id": "d8ab57d2-cffc-42a1-b7bd-3556f78d78df",
"items": [
{
"id": "b144684e-ab5b-4c43-bfc1-8a23116eba90",
"quantity": 1,
"product": {
"id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"name": "Cookies",
"brand": {
"id": "2c198d91-63f0-4235-8e88-5235b7ce676d",
"name": "Cookie Company"
}
}
}
]
},
"is_scheduled_send": false,
"scheduled_send_on": null,
"expires_at": null,
"send_method": "link_multiple_custom_list",
"batch_name": "Alena Kenter and Michael Franci",
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15554683642@test.ongoody.com"
},
"workspace_id": "8962f21b-996c-4a7b-a183-572f10d2c8f6",
"workspace_name": "Test Team",
"reference_id": "IDTHQDNV67HRPFNMV5KEDJIQ"
}
For a guide on how to create an order batch, see the Getting Started guide for the Automation API Getting Started guide or the Commerce API Getting Started guide.
Order batches with 10 or fewer recipients
Order batches with 10 or fewer recipients are created synchronously, and the returned status
field will be completed
. The orders and order links are available immediately inside the orders_preview
field (which returns the first 10 orders).
Order batches with more than 10 recipients
Order batches with more than 10 recipients are created asynchronously, and the order batch will have a status
of pending
. The orders and gift links won’t be available until the order batch is finished processing synchronously. You can check the status of the order batch by calling the /order_batches/:id
endpoint, or by receiving a webhook notification on the order_batch.completed
event.
Once an order batch is created, you can access all of the orders by calling the /order_batches/:id/orders
endpoint, where you can paginate through the list of orders. If your use case always sends 10 or fewer orders at a time, you can just use the orders_preview
field on the order batch which gives you the first 10 orders.
Authorizations
Your Goody API key.
Body
Input parameters for an order batch.
Response
An order batch is the primary resource created by the API. Order batches contain an array of orders.
curl --request POST \
--url https://api.ongoody.com/v1/order_batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"from_name": "John",
"message": "Thank you!",
"send_method": "link_multiple_custom_list",
"payment_method_id": null,
"workspace_id": null,
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"recipients": [
{
"first_name": "Alena",
"last_name": "Kenter",
"email": "alena@ongoody.com"
},
{
"first_name": "Michael",
"last_name": "Franci",
"email": "michael@ongoody.com"
}
],
"cart": {
"items": [
{
"product_id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"quantity": 1
}
]
}
}'
{
"id": "69f05263-9290-4ed7-b592-7c8622d27e28",
"send_status": "complete",
"from_name": "John",
"message": "Thank you!",
"orders_count": 2,
"orders_preview": [
{
"id": "ef0eb4f5-a59f-4daf-92e5-27fcc77c5435",
"status": "created",
"individual_gift_link": "https://gifts.ongoody.com/gift/MmiRvO0TYZ8wZwglIeTfvf3n",
"recipient_first_name": "Alena",
"recipient_last_name": "Kenter",
"recipient_email": "alena@ongoody.com",
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"message": "Thank you!",
"thank_you_note": null,
"view_count_recipient": 0,
"is_swapped": false,
"order_batch_id": "69f05263-9290-4ed7-b592-7c8622d27e28",
"expires_at": null,
"cart": {
"id": "d8ab57d2-cffc-42a1-b7bd-3556f78d78df",
"items": [
{
"id": "b144684e-ab5b-4c43-bfc1-8a23116eba90",
"quantity": 1,
"product": {
"id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"name": "Cookies",
"brand": {
"id": "2c198d91-63f0-4235-8e88-5235b7ce676d",
"name": "Cookie Company"
}
}
}
]
},
"shipments": [],
"amounts": {
"amount_product": 1000,
"amount_shipping": 1000,
"amount_processing_fee": 100,
"amount_pre_tax_total": 2100,
"amount_tax": null,
"amount_total": null,
"amount_global_relay_cost": null
},
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15554683642@test.ongoody.com"
},
"workspace_id": "8962f21b-996c-4a7b-a183-572f10d2c8f6",
"workspace_name": "Test Team",
"original_cart": null,
"original_amounts": null,
"reference_id": "RHUA86JV0FQ0Q7N4WBNJJDDW",
"payment_link": null
},
{
"id": "c606b908-2889-4e07-b9a2-fea53884140e",
"status": "created",
"individual_gift_link": "https://gifts.ongoody.com/gift/T4TSiGf7IcHjwOMmFEunYzwu",
"recipient_first_name": "Michael",
"recipient_last_name": "Franci",
"recipient_email": "michael@ongoody.com",
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"message": "Thank you!",
"thank_you_note": null,
"view_count_recipient": 0,
"is_swapped": false,
"order_batch_id": "69f05263-9290-4ed7-b592-7c8622d27e28",
"expires_at": null,
"cart": {
"id": "d8ab57d2-cffc-42a1-b7bd-3556f78d78df",
"items": [
{
"id": "b144684e-ab5b-4c43-bfc1-8a23116eba90",
"quantity": 1,
"product": {
"id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"name": "Cookies",
"brand": {
"id": "2c198d91-63f0-4235-8e88-5235b7ce676d",
"name": "Cookie Company"
}
}
}
]
},
"shipments": [],
"amounts": {
"amount_product": 1000,
"amount_shipping": 1000,
"amount_processing_fee": 100,
"amount_pre_tax_total": 2100,
"amount_tax": null,
"amount_total": null,
"amount_global_relay_cost": null
},
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15554683642@test.ongoody.com"
},
"workspace_id": "8962f21b-996c-4a7b-a183-572f10d2c8f6",
"workspace_name": "Test Team",
"original_cart": null,
"original_amounts": null,
"reference_id": "UZAN5QHDEWBRY13DOPF8RKCS",
"payment_link": null
}
],
"recipients_count": 2,
"recipients_preview": [
{
"first_name": "Alena",
"last_name": "Kenter",
"email": "alena@ongoody.com"
},
{
"first_name": "Michael",
"last_name": "Franci",
"email": "michael@ongoody.com"
}
],
"cart": {
"id": "d8ab57d2-cffc-42a1-b7bd-3556f78d78df",
"items": [
{
"id": "b144684e-ab5b-4c43-bfc1-8a23116eba90",
"quantity": 1,
"product": {
"id": "bd781841-109d-46a2-a5b0-d07001e12b04",
"name": "Cookies",
"brand": {
"id": "2c198d91-63f0-4235-8e88-5235b7ce676d",
"name": "Cookie Company"
}
}
}
]
},
"is_scheduled_send": false,
"scheduled_send_on": null,
"expires_at": null,
"send_method": "link_multiple_custom_list",
"batch_name": "Alena Kenter and Michael Franci",
"card_id": "6a058e72-e435-476b-a8e0-0281d15ec1c5",
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15554683642@test.ongoody.com"
},
"workspace_id": "8962f21b-996c-4a7b-a183-572f10d2c8f6",
"workspace_name": "Test Team",
"reference_id": "IDTHQDNV67HRPFNMV5KEDJIQ"
}