order_batch.completed event is emitted immediately after the order batch is finished processing and all orders have been created. (This is instantly after the order_batch.created webhook event for order batches with 10 or fewer recipients, and shortly after the order_batch.created event for order batches with more than 10 recipients.)
For scheduled order batches, the order_batch.completed event is emitted when the order batch scheduled time is reached, and orders are created for the order batch.
Example
{
"event_type": "gift_batch.completed",
"id": "ad097c47-bf12-45c9-8feb-0536a0012c09",
"data": {
"id": "bd1fd5b5-6339-4331-a404-66200143ff0f",
"send_status": "complete",
"from_name": "John",
"message": "Thank you!",
"gifts_count": 2,
"gifts_preview": [
{
"id": "1f6e253e-4d03-4a85-a349-0659384ac894",
"status": "created",
"recipient_first_name": "Alena",
"recipient_last_name": "Kenter",
"recipient_email": "alena@ongoody.com",
"individual_gift_link_shared": "https://gifts.ongoody.com/gift/Anc0HT0ZhyKAJguP75jt2Rar",
"card_id": "60c4a674-4f0e-4031-9eca-645d34bb6cec",
"message": "Thank you!",
"thank_you_note": null,
"view_count_recipient": 0,
"is_swapped": false,
"gift_batch_id": "bd1fd5b5-6339-4331-a404-66200143ff0f",
"cart": {
"id": "e0597695-5e19-4bbc-9a99-0fd540a9e68f",
"items": [
{
"id": "5f4e70e9-5cc7-406e-8058-c513af667511",
"quantity": 1,
"product": {
"id": "e69ea31a-320f-48f5-8fd7-0692df22328e",
"name": "Cookies",
"brand": {
"id": "393d847d-874b-4338-b834-fe3e0cf27644",
"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": "15550197216@test.ongoody.com"
},
"workspace_id": "ae6e2795-8667-4d21-a1b0-fe7f642d7893",
"workspace_name": "Test Team",
"original_cart": null,
"original_amounts": null,
"reference_id": "LLRMPDGSSD7GXISGMACUKUIS"
},
{
"id": "981c4abd-1f0c-4287-8c35-c7cea8f6f5da",
"status": "created",
"recipient_first_name": "Michael",
"recipient_last_name": "Franci",
"recipient_email": "michael@ongoody.com",
"individual_gift_link_shared": "https://gifts.ongoody.com/gift/6p5k63B9ym4ksusHG6hr6xtA",
"card_id": "60c4a674-4f0e-4031-9eca-645d34bb6cec",
"message": "Thank you!",
"thank_you_note": null,
"view_count_recipient": 0,
"is_swapped": false,
"gift_batch_id": "bd1fd5b5-6339-4331-a404-66200143ff0f",
"cart": {
"id": "e0597695-5e19-4bbc-9a99-0fd540a9e68f",
"items": [
{
"id": "5f4e70e9-5cc7-406e-8058-c513af667511",
"quantity": 1,
"product": {
"id": "e69ea31a-320f-48f5-8fd7-0692df22328e",
"name": "Cookies",
"brand": {
"id": "393d847d-874b-4338-b834-fe3e0cf27644",
"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": "15550197216@test.ongoody.com"
},
"workspace_id": "ae6e2795-8667-4d21-a1b0-fe7f642d7893",
"workspace_name": "Test Team",
"original_cart": null,
"original_amounts": null,
"reference_id": "U23DXZIHYSI4U9M8SBQ7XMVH"
}
],
"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": "e0597695-5e19-4bbc-9a99-0fd540a9e68f",
"items": [
{
"id": "5f4e70e9-5cc7-406e-8058-c513af667511",
"quantity": 1,
"product": {
"id": "e69ea31a-320f-48f5-8fd7-0692df22328e",
"name": "Cookies",
"brand": {
"id": "393d847d-874b-4338-b834-fe3e0cf27644",
"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": "60c4a674-4f0e-4031-9eca-645d34bb6cec",
"sender": {
"first_name": "Test",
"last_name": "User",
"email": "15550197216@test.ongoody.com"
},
"workspace_id": "ae6e2795-8667-4d21-a1b0-fe7f642d7893",
"workspace_name": "Test Team",
"reference_id": "61Q2FSAHYYISJRZDHQXGYTBU"
}
}
Schema
string
required
The type of event that occurred
string
required
The unique ID for this event
object
An order batch is the primary resource created by the API. Order batches
contain an array of orders.
Show properties
Show properties
string<uuid>
required
An order batch is the primary resource created by the API. Order batches
contain an array of orders.
string
required
The
pending status indicates that an order batch is being prepared to be
sent out. If it is not scheduled, it is being sent asynchronously. If it
is scheduled, it will stay in pending state until the scheduled time is
reached, at which point it will be processed and moved to complete. When
it is in pending status, no orders are created yet. When the order
batch is in complete status, all orders are created and available.Allowed values: pending complete failed canceledstring
required
The name of the sender. This is displayed on the order and notifications.
string
The message in this order batch, provided by the sender.
integer
required
The total number of orders in this order batch. This might be blank if the
order batch is scheduled for the future, or it could be fewer than the
recipient count if the order batch is in the process of being sent.
array[object]
required
A preview of the first 10 orders in this order batch. To paginate through
all of the orders, use the
/order_batches/:id/orders endpoint with
?page&per_page. If your use case never sends more than 10 orders in a
single batch, you can use this field instead of calling
/order_batches/:id/orders. For order batches with more than 10
recipients, this array will be empty while the orders are asynchronously
created in the background.Show properties
Show properties
string<uuid>
required
string
required
string
string
string
required
Allowed values:
created notified opened accepted
pending_payment paid ordered shipped delivered failed
canceledstring
required
This gift link can be sent to the recipient or shared with the sender.
For privacy reasons, this gift link does not display tracking
information. A separate link, the recipient link, is sent directly to
the recipient after they accept their gift, which does contain
tracking information.
object
required
The cart currently on this order. If the order is a gift that was
swapped,
cart displays the most recent products selected (i.e.
post-swap).array[object]
required
A list of the shipments for the order.
Show properties
Show properties
string<uuid>
required
string
required
Allowed values:
pending tracking shipped delivered delivered_override failed failed_unset_tracking failed_with_reshipstring
required
The name of the brand that this shipment is from
string
The carrier for this shipment, e.g. UPS.
string
Only for approved distribution partners.
string<date-time>
ISO 8601
string<date-time>
ISO 8601
string<date-time>
The estimated delivery time of this shipment.
string<uuid>
Organizations are sub-divided into workspaces. Orders are contained in workspaces, identified by this ID.
string
string<date-time>
For gifts, the date and time the gift is set to expire.
string
The digital greeting card on this gift.
string
The message in this gift, provided by the sender.
string
A thank you note sent by the recipient.
integer
The number of times the recipient viewed the gift.
boolean
If this gift was swapped by the recipient. Swapping allows a recipient to select another product or products, which replaces the
cart. The original products are saved to original_cart.string<uuid>
On Goody for Business, all orders are attached to a order batch, which is a collection of one or more orders.
object
required
Costs in USD cents (i.e. $1.00 = 100). If the order was swapped,
amounts displays the most recent amounts (i.e. post-swap).Show properties
Show properties
integer
required
Total cost of the products in this order.
integer
required
Total cost of shipping for this order.
integer
Total cost of processing fees for this order.
integer
Total amount of credit applied to this order.
integer
required
Total cost of the products, shipping, and processing fees in this order.
integer
Total tax for this order.
integer
Total cost of the products, shipping, processing fees, tax, and global shipping costs in this order.
integer
Total cost of global shipping for this order through the Global Relay service.
object
Only provided when calling the /orders/:id endpoint.
Show properties
Show properties
string<date-time>
required
ISO 8601
string<date-time>
When the recipient was notified of the order.
string<date-time>
For gifts, when the recipient opened the order.
string<date-time>
For gifts, when the recipient accepted the order.
string<date-time>
required
When the order entered pending payment status.
string<date-time>
When the order was paid for.
string<date-time>
When the order was first shipped. If there are multiple shipments, this is when the first shipment shipped.
string<date-time>
When the order was delivered. If there are multiple shipments, this is when all shipments were delivered.
object
If this order is a gift that was swapped, this displays the original cart that was sent to the recipient.
object
object
required
string
required
The reference ID displayed on receipts and other locations as the ID for this order.
integer
required
The total number of recipients in this order batch.
integer
required
object
required
The cart that was sent for this order batch. This is the original cart that was created for this order batch. If individual orders were swapped, this still remains the same, whereas orders’
cart would change if they were swapped.boolean
Whether this order batch was set up as a scheduled send. This stays as
true after the scheduled send is complete. To determine if the order batch is scheduled to be sent for the future, check if status is pending and scheduled_send_on is in the future. When a order batch is scheduled, orders are only created on the scheduled send date.string<date-time>
The date and time the order batch is scheduled to be sent. This will be
null if the order batch is not a scheduled send. This field remains after the scheduled send completes. ISO 8601, UTC.string<date-time>
The date and time the order batch is set to expire. ISO 8601, UTC.
string
The method for sending a order batch. Currently, the only supported send method is
link_multiple_custom_list which specifies that a link should be created for each order, but no email should automatically be sent to the recipient. Allowed value: link_multiple_custom_liststring
An internal name for the order batch, falling back to an auto-generated batch name. Not displayed to recipients.
string<uuid>
The digital greeting card on this order batch.
object
required
string<uuid>
Organizations are sub-divided into workspaces. Order batches are contained in workspaces, identified by this ID.
string
string
required
The reference ID displayed on receipts and other locations as the ID for this order batch.