OrderBatch
An order batch is the primary resource created by the API. Order batches contain an array of orders.
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.
pending
, complete
, failed
, canceled
The name of the sender. This is displayed on the order and notifications.
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.
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.
The total number of recipients in this order batch.
A preview of the first 10 recipients in this order batch. To see all of the recipients, use /order_batches/:id/recipients
. Recipients contain the original contact information provided for each recipient when the order batch was created.
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.
The sender of the order batch.
The reference ID displayed on receipts and other locations as the ID for this order batch.
The message in this order batch, provided by the sender.
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.
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.
The date and time the order batch is set to expire. ISO 8601, UTC.
The method for sending a order batch. email_and_link
sends a gift email to the recipient (specify email
for each recipient). link_multiple_custom_list
generates a gift link without an automatic email. direct_send
ships the product directly to the recipient (specify mailing_address
for each recipient). For more information, see Send Methods.
email_and_link
, link_multiple_custom_list
, direct_send
An internal name for the order batch, falling back to an auto-generated batch name. Not displayed to recipients.
The digital greeting card on this order batch.
Organizations are sub-divided into workspaces. Order batches are contained in workspaces, identified by this ID.