An order batch is the primary resource created by the API. Order batches contain an array of orders.

id
string
required
send_status
enum<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.

Available options:
pending,
complete,
failed,
canceled
from_name
string
required

The name of the sender. This is displayed on the order and notifications.

orders_count
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.

orders_preview
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.

recipients_count
integer
required

The total number of recipients in this order batch.

recipients_preview
object[]
required

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.

cart
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.

sender
object
required

The sender of the order batch.

reference_id
string
required

The reference ID displayed on receipts and other locations as the ID for this order batch.

message
string | null

The message in this order batch, provided by the sender.

is_scheduled_send
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.

scheduled_send_on
string | null

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.

expires_at
string | null

The date and time the order batch is set to expire. ISO 8601, UTC.

send_method
enum<string> | null

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.

Available options:
email_and_link,
link_multiple_custom_list,
direct_send
batch_name
string | null

An internal name for the order batch, falling back to an auto-generated batch name. Not displayed to recipients.

card_id
string | null

The digital greeting card on this order batch.

workspace_id
string | null

Organizations are sub-divided into workspaces. Order batches are contained in workspaces, identified by this ID.

workspace_name
string | null