> ## Documentation Index
> Fetch the complete documentation index at: https://developer.ongoody.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List all order batches



## OpenAPI

````yaml GET /v1/order_batches
openapi: 3.0.1
info:
  title: Goody API
  version: 1.0.0
  contact:
    name: Goody Support
    email: support@ongoody.com
servers:
  - url: https://api.ongoody.com
    description: Production
  - url: https://api.sandbox.ongoody.com
    description: Sandbox
security: []
paths:
  /v1/order_batches:
    get:
      tags:
        - Order Batches
      summary: List order batches
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            default: 1
            minimum: 1
          description: Page for pagination, starting at 1
          required: false
        - name: per_page
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Items per page for pagination
          required: false
      responses:
        '200':
          description: Order batches retrieved
          content:
            application/json:
              examples:
                Order batches retrieved:
                  value:
                    data:
                      - id: 662b8afb-b89d-4b74-87ef-df032f8c65d8
                        send_status: complete
                        from_name: Earle
                        message: null
                        orders_count: 2
                        orders_preview:
                          - id: b2f9ca52-ec39-4381-8465-0b01a37d0504
                            status: created
                            individual_gift_link: >-
                              https://gifts.ongoody.com/gift/ZIOM9VVVMANJBKL6JZSMRUD2
                            recipient_first_name: Alena
                            recipient_last_name: Kenter
                            recipient_email: alena@ongoody.com
                            card_id: 2ca309cc-2f7c-4da9-9b4c-dce1dc662e31
                            message: Test Message
                            thank_you_note: null
                            view_count_recipient: 0
                            is_swapped: false
                            order_batch_id: 662b8afb-b89d-4b74-87ef-df032f8c65d8
                            expires_at: null
                            cart:
                              id: fe880b4a-473d-4165-9ffd-edfd0bbc6518
                              items:
                                - id: 0e82cf86-1b6d-482a-9002-19edcef5d910
                                  quantity: 1
                                  product:
                                    id: a78ee9d6-9c49-4aa5-889d-60483e512d53
                                    name: Cookies
                                    brand:
                                      id: c7f4ed50-0f22-446c-be7d-42cac2678426
                                      name: Cookie Company
                            shipments: []
                            amounts:
                              amount_product: 2000
                              amount_shipping: 500
                              amount_processing_fee: 0
                              amount_pre_tax_total: 2500
                              amount_tax: null
                              amount_total: null
                              amount_global_relay_cost: null
                            sender:
                              first_name: Test
                              last_name: User
                              email: 15551755323@test.ongoody.com
                            workspace_id: 908e78c2-64af-4ec2-a481-d0f6ef426633
                            workspace_name: Test Team
                            original_cart: null
                            original_amounts: null
                            reference_id: JEKZSQZHKWTEASSQXWGKES7B
                            payment_link: null
                          - id: dd90fb27-2082-416b-aac7-d7648994ec9f
                            status: created
                            individual_gift_link: >-
                              https://gifts.ongoody.com/gift/3QWOSUUTJ53MIABA4YDEZ9IA
                            recipient_first_name: Michael
                            recipient_last_name: Franci
                            recipient_email: michael@ongoody.com
                            card_id: 2ca309cc-2f7c-4da9-9b4c-dce1dc662e31
                            message: Test Message
                            thank_you_note: null
                            view_count_recipient: 0
                            is_swapped: false
                            order_batch_id: 662b8afb-b89d-4b74-87ef-df032f8c65d8
                            expires_at: null
                            cart:
                              id: fe880b4a-473d-4165-9ffd-edfd0bbc6518
                              items:
                                - id: 0e82cf86-1b6d-482a-9002-19edcef5d910
                                  quantity: 1
                                  product:
                                    id: a78ee9d6-9c49-4aa5-889d-60483e512d53
                                    name: Cookies
                                    brand:
                                      id: c7f4ed50-0f22-446c-be7d-42cac2678426
                                      name: Cookie Company
                            shipments: []
                            amounts:
                              amount_product: 2000
                              amount_shipping: 500
                              amount_processing_fee: 0
                              amount_pre_tax_total: 2500
                              amount_tax: null
                              amount_total: null
                              amount_global_relay_cost: null
                            sender:
                              first_name: Test
                              last_name: User
                              email: 15551755323@test.ongoody.com
                            workspace_id: 908e78c2-64af-4ec2-a481-d0f6ef426633
                            workspace_name: Test Team
                            original_cart: null
                            original_amounts: null
                            reference_id: GJZVQDFTQ3NIRIV8Y0EWHAWA
                            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: fe880b4a-473d-4165-9ffd-edfd0bbc6518
                          items:
                            - id: 0e82cf86-1b6d-482a-9002-19edcef5d910
                              quantity: 1
                              product:
                                id: a78ee9d6-9c49-4aa5-889d-60483e512d53
                                name: Cookies
                                brand:
                                  id: c7f4ed50-0f22-446c-be7d-42cac2678426
                                  name: Cookie Company
                        is_scheduled_send: false
                        scheduled_send_on: null
                        expires_at: null
                        send_method: null
                        batch_name: Thank You from Deckow, Skiles and Denesik
                        card_id: 2ca309cc-2f7c-4da9-9b4c-dce1dc662e31
                        sender:
                          first_name: Test
                          last_name: User
                          email: 15551755323@test.ongoody.com
                        workspace_id: 908e78c2-64af-4ec2-a481-d0f6ef426633
                        workspace_name: Test Team
                        reference_id: VCXKQ3P55QNWMIXM42AQNRSP
                        customer_reference_id: null
                      - id: 18745c22-33a8-4146-ac42-7eb59a2f45a4
                        send_status: complete
                        from_name: Adalberto
                        message: null
                        orders_count: 2
                        orders_preview:
                          - id: 6e97677a-547c-45d2-89c9-2cc3a1d5d604
                            status: created
                            individual_gift_link: >-
                              https://gifts.ongoody.com/gift/35PRSIKOV4P2G9OZWMFAWCR0
                            recipient_first_name: Alena
                            recipient_last_name: Kenter
                            recipient_email: alena@ongoody.com
                            card_id: 2ca309cc-2f7c-4da9-9b4c-dce1dc662e31
                            message: Test Message
                            thank_you_note: null
                            view_count_recipient: 0
                            is_swapped: false
                            order_batch_id: 18745c22-33a8-4146-ac42-7eb59a2f45a4
                            expires_at: null
                            cart:
                              id: a767e193-97a9-471d-9551-b5bc71d36539
                              items:
                                - id: d1390002-1cd9-4111-a880-f56774fd9e20
                                  quantity: 1
                                  product:
                                    id: ea295df7-33f2-42b3-a629-127a90a2d2e5
                                    name: Cookies
                                    brand:
                                      id: c7f4ed50-0f22-446c-be7d-42cac2678426
                                      name: Cookie Company
                            shipments: []
                            amounts:
                              amount_product: 2000
                              amount_shipping: 500
                              amount_processing_fee: 0
                              amount_pre_tax_total: 2500
                              amount_tax: null
                              amount_total: null
                              amount_global_relay_cost: null
                            sender:
                              first_name: Test
                              last_name: User
                              email: 15551755323@test.ongoody.com
                            workspace_id: 908e78c2-64af-4ec2-a481-d0f6ef426633
                            workspace_name: Test Team
                            original_cart: null
                            original_amounts: null
                            reference_id: XP16H0ZWJKHDR1RSYTMGY77O
                            payment_link: null
                          - id: 8e9f0b28-272b-4f03-8ce0-bd26f99fe872
                            status: created
                            individual_gift_link: >-
                              https://gifts.ongoody.com/gift/NENDELIMNGZR1QHFXWOZCRWY
                            recipient_first_name: Michael
                            recipient_last_name: Franci
                            recipient_email: michael@ongoody.com
                            card_id: 2ca309cc-2f7c-4da9-9b4c-dce1dc662e31
                            message: Test Message
                            thank_you_note: null
                            view_count_recipient: 0
                            is_swapped: false
                            order_batch_id: 18745c22-33a8-4146-ac42-7eb59a2f45a4
                            expires_at: null
                            cart:
                              id: a767e193-97a9-471d-9551-b5bc71d36539
                              items:
                                - id: d1390002-1cd9-4111-a880-f56774fd9e20
                                  quantity: 1
                                  product:
                                    id: ea295df7-33f2-42b3-a629-127a90a2d2e5
                                    name: Cookies
                                    brand:
                                      id: c7f4ed50-0f22-446c-be7d-42cac2678426
                                      name: Cookie Company
                            shipments: []
                            amounts:
                              amount_product: 2000
                              amount_shipping: 500
                              amount_processing_fee: 0
                              amount_pre_tax_total: 2500
                              amount_tax: null
                              amount_total: null
                              amount_global_relay_cost: null
                            sender:
                              first_name: Test
                              last_name: User
                              email: 15551755323@test.ongoody.com
                            workspace_id: 908e78c2-64af-4ec2-a481-d0f6ef426633
                            workspace_name: Test Team
                            original_cart: null
                            original_amounts: null
                            reference_id: 9GINXHEOEVJQH15WCAXBJMHO
                            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: a767e193-97a9-471d-9551-b5bc71d36539
                          items:
                            - id: d1390002-1cd9-4111-a880-f56774fd9e20
                              quantity: 1
                              product:
                                id: ea295df7-33f2-42b3-a629-127a90a2d2e5
                                name: Cookies
                                brand:
                                  id: c7f4ed50-0f22-446c-be7d-42cac2678426
                                  name: Cookie Company
                        is_scheduled_send: false
                        scheduled_send_on: null
                        expires_at: null
                        send_method: null
                        batch_name: Thank You from Turcotte and Sons
                        card_id: 2ca309cc-2f7c-4da9-9b4c-dce1dc662e31
                        sender:
                          first_name: Test
                          last_name: User
                          email: 15551755323@test.ongoody.com
                        workspace_id: 908e78c2-64af-4ec2-a481-d0f6ef426633
                        workspace_name: Test Team
                        reference_id: WE0MZ3QWJKUCHI1KCF9JZGWX
                        customer_reference_id: null
                    list_meta:
                      total_count: 2
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrderBatch'
                  list_meta:
                    $ref: '#/components/schemas/ListMeta'
      security:
        - bearer: []
components:
  schemas:
    OrderBatch:
      type: object
      description: >-
        An order batch is the primary resource created by the API. Order batches
        contain an array of orders.
      properties:
        id:
          type: string
          format: uuid
        send_status:
          $ref: '#/components/schemas/OrderBatchSendStatus'
          description: >-
            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.
        from_name:
          type: string
          description: >-
            The name of the sender. This is displayed on the order and
            notifications.
        message:
          type: string
          nullable: true
          description: The message in this order batch, provided by the sender.
        orders_count:
          type: integer
          description: >-
            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:
          type: array
          items:
            $ref: '#/components/schemas/Order'
          description: >-
            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:
          type: integer
          description: The total number of recipients in this order batch.
        recipients_preview:
          type: array
          items:
            $ref: '#/components/schemas/OrderBatchRecipient'
          description: >-
            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:
          $ref: '#/components/schemas/Cart'
          description: >-
            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.
        is_scheduled_send:
          type: boolean
          description: >-
            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:
          type: string
          format: date-time
          description: >-
            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.
          nullable: true
        expires_at:
          type: string
          format: date-time
          description: The date and time the order batch is set to expire. ISO 8601, UTC.
          nullable: true
        send_method:
          $ref: '#/components/schemas/OrderBatchSendMethod'
          nullable: true
        batch_name:
          type: string
          nullable: true
          description: >-
            An internal name for the order batch, falling back to an
            auto-generated batch name. Not displayed to recipients.
        card_id:
          type: string
          format: uuid
          nullable: true
          description: The digital greeting card on this order batch.
        sender:
          $ref: '#/components/schemas/Sender'
          description: The sender of the order batch.
        workspace_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Organizations are sub-divided into workspaces. Order batches are
            contained in workspaces, identified by this ID.
        workspace_name:
          type: string
          nullable: true
        reference_id:
          type: string
          description: >-
            The reference ID displayed on receipts and other locations as the ID
            for this order batch.
        customer_reference_id:
          type: string
          nullable: true
          description: >-
            A unique client-supplied reference for this order batch, provided on
            creation to prevent duplicate order batches. Returns the value sent
            when the batch was created, or `null` if none was provided.
      required:
        - id
        - send_status
        - orders_preview
        - orders_count
        - cart
        - from_name
        - recipients_preview
        - recipients_count
        - sender
        - reference_id
    ListMeta:
      type: object
      properties:
        total_count:
          type: integer
          description: The total number of items in this list.
    OrderBatchSendStatus:
      type: string
      enum:
        - pending
        - complete
        - failed
        - canceled
    Order:
      type: object
      description: >-
        An individual order contains the gift link to be sent to the recipient
        (if applicable) and other information about the order.
      properties:
        id:
          type: string
          format: uuid
        recipient_first_name:
          type: string
        recipient_last_name:
          type: string
          nullable: true
        recipient_email:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/OrderStatus'
        individual_gift_link:
          type: string
          description: >-
            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.
        cart:
          $ref: '#/components/schemas/Cart'
          description: >-
            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).
        cart_selections:
          type: array
          items:
            $ref: '#/components/schemas/CartSelection'
          description: >-
            Product variant selections for each cart product. Only for commerce
            app orders.
          nullable: true
        shipments:
          type: array
          items:
            $ref: '#/components/schemas/Shipment'
          description: A list of the shipments for the order.
        workspace_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Organizations are sub-divided into workspaces. Orders are contained
            in workspaces, identified by this ID.
        workspace_name:
          type: string
          nullable: true
        expires_at:
          type: string
          format: date-time
          description: For gifts, the date and time the gift is set to expire.
          nullable: true
        card_id:
          type: string
          format: uuid
          nullable: true
          description: The digital greeting card on this gift.
        message:
          type: string
          nullable: true
          description: The message in this gift, provided by the sender.
        thank_you_note:
          type: string
          nullable: true
          description: A thank you note sent by the recipient.
        view_count_recipient:
          type: integer
          description: The number of times the recipient viewed the gift.
        is_swapped:
          type: boolean
          description: >-
            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`.
        order_batch_id:
          type: string
          format: uuid
          description: >-
            On Goody for Business, all orders are attached to a order batch,
            which is a collection of one or more orders.
        amounts:
          type: object
          description: >-
            Costs in USD cents (i.e. $1.00 = 100). If the order was swapped,
            `amounts` displays the most recent amounts (i.e. post-swap).
          properties:
            amount_product:
              type: integer
              description: Total cost of the products in this order.
            amount_shipping:
              type: integer
              description: Total cost of shipping for this order.
            amount_processing_fee:
              type: integer
              nullable: true
              description: Total cost of processing fees for this order.
            amount_credit_applied:
              type: integer
              nullable: true
              description: Total amount of credit applied to this order.
            amount_pre_tax_total:
              type: integer
              description: >-
                Total cost of the products, shipping, and processing fees in
                this order.
            amount_tax:
              type: integer
              nullable: true
              description: Total tax for this order.
            amount_total:
              type: integer
              nullable: true
              description: >-
                Total cost of the products, shipping, processing fees, tax, and
                global shipping costs in this order.
            amount_global_relay_cost:
              type: integer
              nullable: true
              description: >-
                Total cost of global shipping for this order through the Global
                Relay service.
          required:
            - amount_product
            - amount_shipping
            - amount_pre_tax_total
        event_times:
          type: object
          description: Only provided when calling the /orders/:id endpoint.
          properties:
            created_at:
              type: string
              format: date-time
              description: ISO 8601
            notified_at:
              type: string
              format: date-time
              description: When the recipient was notified of the order.
              nullable: true
            opened_at:
              type: string
              format: date-time
              description: For gifts, when the recipient opened the order.
              nullable: true
            accepted_at:
              type: string
              format: date-time
              description: For gifts, when the recipient accepted the order.
              nullable: true
            pending_payment_at:
              type: string
              format: date-time
              description: When the order entered pending payment status.
              nullable: true
            paid_at:
              type: string
              format: date-time
              description: When the order was paid for.
              nullable: true
            shipped_at:
              type: string
              format: date-time
              description: >-
                When the order was first shipped. If there are multiple
                shipments, this is when the first shipment shipped.
              nullable: true
            delivered_at:
              type: string
              format: date-time
              description: >-
                When the order was delivered. If there are multiple shipments,
                this is when all shipments were delivered.
              nullable: true
          required:
            - created_at
          nullable: true
        original_cart:
          $ref: '#/components/schemas/Cart'
          description: >-
            If this order is a gift that was swapped, this displays the original
            cart that was sent to the recipient.
          nullable: true
        original_amounts:
          type: object
          description: >-
            If this order is a gift that was swapped, this displays the original
            amounts of the cart that was sent to the recipient.
          properties:
            original_amount_product:
              type: integer
              nullable: true
            original_amount_shipping:
              type: integer
              nullable: true
            original_amount_credit_applied:
              type: integer
              nullable: true
            original_amount_pre_tax_total:
              type: integer
              nullable: true
          nullable: true
        sender:
          $ref: '#/components/schemas/Sender'
          description: The Goody user who sent this order.
        payment_link:
          type: string
          nullable: true
          description: >-
            For commerce apps using Hosted Payment, the payment link for the
            gift with the credit card entry form. Available when the gift is in
            `pending_payment` status (after it has been accepted).
        reference_id:
          type: string
          description: >-
            The reference ID displayed on receipts and other locations as the ID
            for this order.
      required:
        - id
        - recipient_first_name
        - status
        - individual_gift_link
        - cart
        - shipments
        - amounts
        - sender
        - reference_id
    OrderBatchRecipient:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
      required:
        - first_name
    Cart:
      type: object
      properties:
        id:
          type: string
          format: uuid
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
    OrderBatchSendMethod:
      type: string
      enum:
        - email_and_link
        - link_multiple_custom_list
        - direct_send
      description: >-
        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](/introduction/send-methods).
    Sender:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
      required:
        - first_name
        - last_name
        - email
    OrderStatus:
      type: string
      enum:
        - created
        - notified
        - opened
        - accepted
        - pending_payment
        - paid
        - ordered
        - shipped
        - delivered
        - failed
        - canceled
    CartSelection:
      type: object
      description: Product variant selections for a specific gift cart product.
      properties:
        id:
          type: string
          format: uuid
        cart_item_id:
          type: string
          format: uuid
          description: >-
            The cart item ID this selection belongs to. Match this with
            cart.items[].id.
        quantity_index:
          type: integer
          description: >-
            The index of this selection within multiple quantities of the same
            product. If a given cart product has multiple quantities, this will
            be 0 for the first unit, 1 for the second unit, etc.
        variants:
          type: array
          items:
            type: string
          description: The selected variants for this product selection and quantity index.
      required:
        - id
        - cart_item_id
        - quantity_index
        - variants
    Shipment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending
            - tracking
            - shipped
            - delivered
            - delivered_override
            - failed
            - failed_unset_tracking
            - failed_with_reship
        brand_name:
          type: string
          description: The name of the brand that this shipment is from.
        tracking_carrier:
          type: string
          nullable: true
          description: The carrier for this shipment, e.g. UPS.
        tracking_number:
          type: string
          nullable: true
          description: Only for approved distribution partners.
        tracking_url:
          type: string
          nullable: true
          description: Only for approved distribution partners.
        shipped_at:
          type: string
          format: date-time
          description: ISO 8601
          nullable: true
        delivered_at:
          type: string
          format: date-time
          description: ISO 8601
          nullable: true
        delivery_eta:
          type: string
          format: date-time
          description: The estimated delivery time of this shipment.
          nullable: true
      required:
        - id
        - status
        - brand_name
    CartItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        product:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            brand:
              type: object
              description: The brand that this product is from.
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
              required:
                - id
                - name
          required:
            - id
            - name
            - brand
        quantity:
          type: integer
      required:
        - id
        - product
        - quantity
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: Your Goody API key.

````