Storefront Subscription

The subscription object contains the information about the customer's active and expired subscriptions.

It also exposes an interface through which customers can cancel their subscriptions.

This resource is intended to be accessed directly by customers using a customer token.

  • Request Headers

  • Name
    Authorization
    Type
    customer auth
    Tags
    REQUIRED
    Description

    the token of your customer prefixed with customer if logged in, more information here


The Subscription object

  • Fields

  • Name
    id
    Type
    int64
    Tags
    Description

    id of the subscription

  • Name
    pretty_id
    Type
    string
    Tags
    Description

    human-readable id of the subscription

  • Name
    store_id
    Type
    int64
    Tags
    Description

    id of the store the subscription belongs to

  • Name
    customer
    Type
    Customer
    Tags
    Description

    the customer associated with this subscription

  • Name
    status
    Type
    string
    Tags
    Description

    status of the subscription (created, active, canceled)

  • Name
    checkout_id
    Type
    int64
    Tags
    Description

    id of the checkout session the subscription was created in

  • Name
    checkout_line_id
    Type
    int64
    Tags
    Description

    id of the checkout session line the subscription was created in

  • Name
    billing_name
    Type
    string
    Tags
    NULLABLE
    Description

    billing name associated with the subscription

  • Name
    billing_email
    Type
    string
    Tags
    NULLABLE
    Description

    billing email associated with the subscription

  • Name
    billing_country
    Type
    string
    Tags
    NULLABLE
    Description

    billing country associated with the subscription

  • Name
    gift
    Type
    boolean
    Tags
    Description

    whether the subscription is a gift

  • Name
    gift_to_customer
    Type
    Customer
    Tags
    NULLABLE
    Description

    the customer to whom the subscription is gifted

  • Name
    product_id
    Type
    int64
    Tags
    Description

    id of the product associated with the subscription

  • Name
    product_name
    Type
    string
    Tags
    Description

    name of the product associated with the subscription

  • Name
    product_image_url
    Type
    string
    Tags
    NULLABLE
    Description

    image URL of the product associated with the subscription

  • Name
    interval_value
    Type
    int
    Tags
    Description

    interval value indicating the frequency of the subscription

  • Name
    interval_scale
    Type
    string
    Tags
    Description

    interval scale indicating the unit of time for the subscription frequency (e.g., day, week, month)

  • Name
    currency
    Type
    string
    Tags
    Description

    currency of the subscription

  • Name
    tax_inclusive
    Type
    boolean
    Tags
    Description

    whether the subscription price is tax-inclusive

  • Name
    price
    Type
    int64
    Tags
    Description

    price of the subscription in zero-decimal format (where "$10.00" is 1000)

  • Name
    discount_amount
    Type
    int64
    Tags
    Description

    discount amount applied to the subscription

  • Name
    subtotal_amount
    Type
    int64
    Tags
    Description

    subtotal amount of the subscription

  • Name
    tax_amount
    Type
    int64
    Tags
    Description

    tax amount applied to the subscription

  • Name
    total_amount
    Type
    int64
    Tags
    Description

    total amount of the subscription

  • Name
    created_at
    Type
    timestamp
    Tags
    Description

    timestamp of when the subscription was created

  • Name
    updated_at
    Type
    timestamp
    Tags
    NULLABLE
    Description

    timestamp of when the subscription was last updated

  • Name
    active_at
    Type
    timestamp
    Tags
    NULLABLE
    Description

    timestamp of when the subscription became active

  • Name
    canceled_at
    Type
    timestamp
    Tags
    NULLABLE
    Description

    timestamp of when the subscription was canceled

  • Name
    cancel_reason
    Type
    string
    Tags
    NULLABLE
    Description

    reason for canceling the subscription

The Subscription object

{
    "id": "241664040164667392",
    "pretty_id": "pn-1u3ir3f1fgu8",
    "store_id": "235075606381871104",
    "customer": {
        "id": "235075788733423616",
        "steam_id": "76561198152492642",
        "steam": {
            "id": "76561198152492642",
            "name": "m0uka",
            "avatar_url": "https://avatars.steamstatic.com/10ce9e8c27d973ec572e3401e531c07d717c4648_full.jpg"
        },
        "name": null
    },
    "status": "canceled",
    "checkout_id": "241663964491034624",
    "checkout_line_id": "241663964491034625",
    "billing_name": "Bender Rodriguez",
    "billing_email": "[email protected]",
    "billing_country": "US",
    "gift": false,
    "gift_to_customer": null,
    "product_id": "235075696194502656",
    "product_version_id": "238792616567640064",
    "product_name": "Testing Product",
    "product_image_url": null,
    "interval_value": 1,
    "interval_scale": "month",
    "currency": "eur",
    "tax_inclusive": false,
    "price": 200,
    "price_str": "€2.00",
    "discount_amount": 0,
    "discount_amount_str": "€0.00",
    "subtotal_amount": 200,
    "subtotal_amount_str": "€2.00",
    "tax_amount": 42,
    "tax_amount_str": "€0.42",
    "total_amount": 242,
    "total_amount_str": "€2.42",
    "initial_discount_amount": 0,
    "initial_discount_amount_str": "€0.00",
    "initial_subtotal_amount": 200,
    "initial_subtotal_amount_str": "€2.00",
    "initial_giftcard_usage_amount": 200,
    "initial_giftcard_usage_amount_str": "€2.00",
    "initial_tax_amount": 0,
    "initial_tax_amount_str": "€0.00",
    "initial_total_amount": 0,
    "initial_total_amount_str": "€0.00",
    "current_period_start": "2023-12-21T19:09:01.356641Z",
    "current_period_end": "2024-01-20T19:09:01.356641Z",
    "billing_cycle_sequence": 1,
    "created_at": "2023-12-21T19:09:00.326517Z",
    "updated_at": null,
    "active_at": "2023-12-21T19:09:01.354102Z",
    "canceled_at": "2024-01-18T12:55:59.237002Z",
    "cancel_reason": "customer"
}