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

# Get past orders report with detailed filtering

> Retrieves a detailed report of past billing attempts with advanced filtering options. This endpoint provides comprehensive data for analytics, troubleshooting, and reporting purposes.

**Filter Options:**
- By status: SUCCESS, FAILED, SKIPPED
- By date range: Filter by billing date range
- By attempt count: Filter by number of retry attempts
- By contract status: Filter by subscription contract status
- By contract ID: Get report for specific subscription

**Response Includes:**
- Detailed billing attempt information
- Shopify exception details for failed attempts (optional)
- Retry attempt count
- Processing timestamps
- Order totals and line items

**Authentication:** Requires valid X-API-Key header



## OpenAPI

````yaml /subscription/storefront-api-swagger.json get /subscriptions/cp/api/subscription-billing-attempts/past-orders/report
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for the customer-facing subscription portal.
    These APIs enable customers to manage their subscriptions, update billing
    information, modify delivery schedules, and access their account details
    through your storefront.


    **Important**: These APIs must be called from your shop's domain (e.g.,
    https://www.myshop.com/apps/subscriptions/cp/api/**) and require customer
    authentication. Unauthenticated requests will return a 401 Unauthorized
    error.
  title: Storefront APIs
  version: 0.0.1
servers:
  - url: https://www.myshop.com/apps
security: []
tags:
  - description: >-
      Core customer portal APIs for managing customer account settings,
      authentication, and portal configurations.
    name: Customer Portal
  - description: >-
      APIs for customers to view and manage their subscription contracts
      including status updates, frequency changes, and cancellations.
    name: Subscription Management
  - description: >-
      APIs for retrieving and updating subscription contract details — delivery
      schedules, line items, addresses, billing cycles.
    name: Subscription Contracts
  - description: >-
      APIs for retrieving available subscription plans and selling plan
      configurations exposed to customers.
    name: Subscription Plans
  - description: >-
      APIs for managing one-time add-on products that can be purchased alongside
      recurring subscription items.
    name: Subscription One-Time Products
  - description: >-
      APIs for retrieving aggregated subscription data and account-level
      subscription information for the signed-in customer.
    name: Subscription Data
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing payment methods, billing information, and processing
      subscription payments.
    name: Billing & Payments
  - description: >-
      APIs for retrieving product information, selling plans, variant data, and
      subscription-enabled products available to customers.
    name: Product Catalog
  - description: >-
      APIs for managing delivery schedules, shipping addresses, delivery
      methods, and tracking order status.
    name: Delivery & Shipping
  - description: >-
      APIs for handling subscription cancellations, retention activities, and
      customer feedback management.
    name: Customer Retention
  - description: >-
      APIs for integrating loyalty programs with subscriptions including points
      redemption and earning options.
    name: Loyalty Integration
  - description: >-
      APIs for accessing portal customization settings, translations, and theme
      configurations.
    name: Customization
  - description: >-
      APIs for retrieving promotional campaigns shown in the customer portal,
      tracking banner engagement, and redeeming campaign offers.
    name: Campaigns
  - description: >-
      APIs for local pickup and click-and-collect — listing pickup locations and
      resolving eligible pickup dates and time slots.
    name: Store Pickup
paths:
  /subscriptions/cp/api/subscription-billing-attempts/past-orders/report:
    get:
      tags:
        - Billing & Payments
      summary: Get past orders report with detailed filtering
      description: >-
        Retrieves a detailed report of past billing attempts with advanced
        filtering options. This endpoint provides comprehensive data for
        analytics, troubleshooting, and reporting purposes.


        **Filter Options:**

        - By status: SUCCESS, FAILED, SKIPPED

        - By date range: Filter by billing date range

        - By attempt count: Filter by number of retry attempts

        - By contract status: Filter by subscription contract status

        - By contract ID: Get report for specific subscription


        **Response Includes:**

        - Detailed billing attempt information

        - Shopify exception details for failed attempts (optional)

        - Retry attempt count

        - Processing timestamps

        - Order totals and line items


        **Authentication:** Requires valid X-API-Key header
      operationId: getPastOrdersReportForCP
      parameters:
        - in: query
          name: contractId
          required: false
          schema:
            format: int64
            type: integer
        - in: query
          name: status
          required: true
          schema:
            enum:
              - SUCCESS
              - FAILURE
              - REQUESTING
              - PROGRESS
              - QUEUED
              - SKIPPED
              - SOCIAL_CONNECTION_NULL
              - CONTRACT_CANCELLED
              - CONTRACT_ENDED
              - CONTRACT_PAUSED
              - AUTO_CHARGE_DISABLED
              - SHOPIFY_EXCEPTION
              - SKIPPED_DUNNING_MGMT
              - SKIPPED_INVENTORY_MGMT
              - IMMEDIATE_TRIGGERED
              - SECURITY_CHALLENGE
              - CONTRACT_PAUSED_MAX_CYCLES
              - REFUNDED
              - SKIPPED_DEMO_SHOP
              - SKIPPED_SHOP_INFO_NOT_FOUND
              - SKIPPED_BILLING_DATE_STALE
              - SKIPPED_DUNNING_NOT_CONFIGURED
              - PENDING_CONSOLIDATION
            type: string
        - in: query
          name: includeShopifyException
          required: false
          schema:
            default: false
            type: boolean
        - in: query
          name: fromDay
          required: false
          schema:
            format: date-time
            type: string
        - in: query
          name: toDay
          required: false
          schema:
            format: date-time
            type: string
        - in: query
          name: attemptCount
          required: false
          schema:
            format: int32
            type: integer
        - in: query
          name: billingErrorsKeys
          required: false
          schema:
            type: string
        - in: query
          name: customerName
          required: false
          schema:
            type: string
        - in: query
          name: errorMessage
          required: false
          schema:
            type: string
        - in: query
          name: contractStatus
          required: false
          schema:
            type: string
        - in: query
          name: pageable
          required: true
          schema:
            $ref: '#/components/schemas/Pageable'
      responses:
        '200':
          content:
            '*/*':
              schema:
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
                type: array
          description: Successfully retrieved report
        '400':
          content:
            '*/*':
              schema:
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
                type: array
          description: Invalid filter parameters
        '401':
          content:
            '*/*':
              schema:
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
                type: array
          description: Authentication required
        '403':
          content:
            '*/*':
              schema:
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
                type: array
          description: Insufficient permissions
components:
  schemas:
    Pageable:
      properties:
        page:
          format: int32
          minimum: 0
          type: integer
        size:
          format: int32
          minimum: 1
          type: integer
        sort:
          items:
            type: string
          type: array
      type: object
    SubscriptionBillingAttemptDetails:
      properties:
        subscriptionBillingAttempt:
          $ref: '#/components/schemas/SubscriptionBillingAttempt'
        subscriptionContractDetails:
          $ref: '#/components/schemas/SubscriptionContractDetails'
      type: object
    SubscriptionBillingAttempt:
      properties:
        applyUsageCharge:
          type: boolean
        attemptCount:
          format: int32
          type: integer
        attemptTime:
          format: date-time
          type: string
        billingAttemptId:
          type: string
        billingAttemptResponseMessage:
          type: string
        billingDate:
          format: date-time
          type: string
        consolidatedIntoAttemptId:
          format: int64
          type: integer
        contractId:
          format: int64
          type: integer
        graphOrderId:
          type: string
        id:
          format: int64
          type: integer
        inventorySkippedAttemptCount:
          format: int32
          type: integer
        inventorySkippedRetryingNeeded:
          type: boolean
        lastShippingUpdatedAt:
          format: date-time
          type: string
        orderAmount:
          format: double
          type: number
        orderAmountContractCurrency:
          format: double
          type: number
        orderAmountShopCurrency:
          format: double
          type: number
        orderAmountUSD:
          format: double
          type: number
        orderId:
          format: int64
          type: integer
        orderName:
          type: string
        orderNote:
          type: string
        partialLinesSkipped:
          enum:
            - INVENTORY_MANAGEMENT
            - MANUAL
          type: string
        progressAttemptCount:
          format: int32
          type: integer
        recurringChargeId:
          format: int64
          type: integer
        retryingNeeded:
          type: boolean
        securityChallengeSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CONTRACT_CANCELLED
          type: string
        shop:
          type: string
        status:
          enum:
            - SUCCESS
            - FAILURE
            - REQUESTING
            - PROGRESS
            - QUEUED
            - SKIPPED
            - SOCIAL_CONNECTION_NULL
            - CONTRACT_CANCELLED
            - CONTRACT_ENDED
            - CONTRACT_PAUSED
            - AUTO_CHARGE_DISABLED
            - SHOPIFY_EXCEPTION
            - SKIPPED_DUNNING_MGMT
            - SKIPPED_INVENTORY_MGMT
            - IMMEDIATE_TRIGGERED
            - SECURITY_CHALLENGE
            - CONTRACT_PAUSED_MAX_CYCLES
            - REFUNDED
            - SKIPPED_DEMO_SHOP
            - SKIPPED_SHOP_INFO_NOT_FOUND
            - SKIPPED_BILLING_DATE_STALE
            - SKIPPED_DUNNING_NOT_CONFIGURED
            - PENDING_CONSOLIDATION
          type: string
        transactionFailedEmailSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
          type: string
        transactionFailedSmsSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - PHONE_NUMBER_EMPTY
          type: string
        transactionRate:
          format: double
          type: number
        upcomingOrderEmailSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
          type: string
        upcomingOrderSmsSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
            - PHONE_NUMBER_EMPTY
          type: string
        usageChargeStatus:
          enum:
            - SUCCESS
            - FAILED
            - TO_BE_TRIED
          type: string
      required:
        - retryingNeeded
        - shop
      type: object
    SubscriptionContractDetails:
      properties:
        activatedOn:
          format: date-time
          type: string
        allowDeliveryAddressOverride:
          type: boolean
        allowDeliveryPriceOverride:
          type: boolean
        autoCharge:
          type: boolean
        billingCountryCode:
          type: string
        billingDateAfterTrial:
          format: date-time
          type: string
        billingPolicyInterval:
          type: string
        billingPolicyIntervalCount:
          format: int32
          type: integer
        cancellationFeedback:
          type: string
        cancellationNote:
          type: string
        cancelledOn:
          format: date-time
          type: string
        contractAmount:
          format: double
          type: number
        contractAmountUSD:
          format: double
          type: number
        contractDetailsJSON:
          type: string
        createdAt:
          format: date-time
          type: string
        currencyCode:
          type: string
        customerEmail:
          type: string
        customerFirstName:
          type: string
        customerId:
          format: int64
          type: integer
        customerLastName:
          type: string
        customerName:
          type: string
        customerTag:
          type: string
        deletedVariantIds:
          type: string
        deliveryCountryCode:
          type: string
        deliveryPolicyInterval:
          type: string
        deliveryPolicyIntervalCount:
          format: int32
          type: integer
        disableFixEmptyQueue:
          type: boolean
        emailBouncedOrFailed:
          type: boolean
        endsAt:
          format: date-time
          type: string
        graphCustomerId:
          type: string
        graphOrderId:
          type: string
        graphSubscriptionContractId:
          type: string
        id:
          format: int64
          type: integer
        importedId:
          type: string
        lastSuccessfulOrder:
          type: string
        lifetimeValue:
          format: double
          type: number
        lifetimeValueUSD:
          format: double
          type: number
        maxCycles:
          format: int32
          type: integer
        minCycles:
          format: int32
          type: integer
        nextBillingDate:
          format: date-time
          type: string
        orderAmount:
          format: double
          type: number
        orderAmountContractCurrency:
          format: double
          type: number
        orderAmountShopCurrency:
          format: double
          type: number
        orderAmountUSD:
          format: double
          type: number
        orderId:
          format: int64
          type: integer
        orderName:
          type: string
        orderNote:
          type: string
        orderNoteAttributes:
          type: string
        originType:
          enum:
            - STORE_FRONT
            - IMPORTED
            - SPLIT_ATTEMPT_BILLING
            - SPLIT_CONTRACT
          type: string
        originalContractId:
          format: int64
          type: integer
        pauseDurationCycle:
          format: int32
          type: integer
        pauseFeedback:
          type: string
        pauseReason:
          type: string
        pauseTillDate:
          format: date-time
          type: string
        pausedFromActive:
          type: boolean
        pausedOn:
          format: date-time
          type: string
        pendingCancellationCycle:
          format: int32
          type: integer
        pendingCancellationDate:
          format: date-time
          type: string
        phone:
          type: string
        queueUpdatedAt:
          format: date-time
          type: string
        shop:
          type: string
        skipPaymentCreateUnpaidOrder:
          type: boolean
        startsAt:
          format: date-time
          type: string
        status:
          type: string
        stopUpComingOrderEmail:
          type: boolean
        subscriptionContractId:
          format: int64
          type: integer
        subscriptionCreatedEmailSent:
          type: boolean
        subscriptionCreatedEmailSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_PAUSED_STATUS
          type: string
        subscriptionCreatedSmsSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_PAUSED_STATUS
            - PHONE_NUMBER_EMPTY
          type: string
        subscriptionType:
          enum:
            - REGULAR_SUBSCRIPTION
            - BUILD_A_BOX_CLASSIC
            - BUILD_A_BOX_SINGLE_PRODUCT
            - BUNDLING_CLASSIC
            - BUNDLING_MIX_AND_MATCH
            - SECTIONED_BUNDLE
            - VOLUME_DISCOUNT
          type: string
        subscriptionTypeIdentifier:
          type: string
        totalSuccessfulOrders:
          format: int32
          type: integer
        upcomingEmailBufferDays:
          format: int32
          type: integer
        upcomingEmailTaskUrl:
          type: string
        updatedAt:
          format: date-time
          type: string
        updatingQueue:
          type: boolean
      required:
        - shop
      type: object

````