Constructors

Properties

httpRequest: BaseHttpRequest

Methods

  • Retrieve statistics for a single store Returns statistics for specified report types.

    You need to specify the report types you want to retrieve in the report_types query parameter as a comma-separated list, e.g. report_types=sales_and_costs,profit.

    Note: You cannot get statistics for a period longer than 6 months.

    To get statistics in the default currency of a store for sales_and_costs and profit reports for August 2022, you can use the following URL: https://api.printful.com/v2/stores/{id}/statistics?report_types=sales_and_costs,profit&date_from=2022-08-01&date_to=2022-08-31.

    Currently, the following report types are available:

    Report type Description
    sales_and_costs Detailed information on sales and costs grouped by date.
    sales_and_costs_summary Short information on sales and costs grouped by date.
    printful_costs Amount paid to Printful for fulfillment and shipping.
    profit Profit in the specified period.
    total_paid_orders The number of paid orders in the specified period.
    costs_by_amount Information on costs by amount grouped by date.
    costs_by_product Information on costs grouped by product.
    costs_by_variant Information on costs grouped by variant.
    average_fulfillment_time Average time it took Printful to fulfill your orders.

    The response structure for the specific reports is documented in the response schema (result.store_statistics.[reportName]).

    Parameters

    • storeId: number

      Use this to specify which store you want to use. The store IDs can be retrieved with the Get basic information about stores endpoint.

    • dateFrom: string

      The beginning of the period to get the statistics from (date in Y-m-d format).

    • dateTo: string

      The end of the period to get the statistics from (date in Y-m-d format).

    • reportTypes:
          | "sales_and_costs"
          | "profit"
          | "average_fulfillment_type"
          | "costs_by_amount"
          | "costs_by_product"
          | "costs_by_variant"
          | "printful_costs"
          | "sales_and_costs_summary"
          | "total_paid_orders"

      A comma-separated list of report types to be retrieved.

    • Optionalcurrency: string

      The currency (3-letter code) to return the statistics in. The store currency will be used by default.

    Returns CancelablePromise<{
        data: StoreStatistics;
    }>

    any OK

    ApiError

  • Retrieves a list of stores Retrieves a list of all stores available to the token. If the token is a store level token it will return only the one store, if it is an account level token it will return all stores available to the account.

    Parameters

    Returns CancelablePromise<any>

    any OK

    ApiError