Resources

Open API endpoints return a structured JSON response. When the response is successful, the structure of the response varies depending on the resource returned by the endpoint.

Customer resource

This resource is returned by most endpoints, it contains basic customer information, a few relationships as well as the authentication token. Here's a list of some of these key attributes:

AttributeDescription
subscriptionsList of active or extended subscriptions.
membershipsList of active membership extended subscriptions.
gift_recipientsList of gift subscriptions.
expired_subscriptionsList of expired subscriptions.
addressesList of addresses.
invoicesList of invoices.
chargesList of payments.
ordersList of e-commerce orders.
sourceThe default payment method.
sourcesList of all payment methods.
auth_tokenThe authentication token, which must be used to perform requests on any protected endpoints.

The authentication token

A customer resource always contain the identity of the customer as a JWT token. It is this token which must be sent as part of the authorization header to access protected endpoints. The token can be retrieved in two ways from the payload of the resource, either from data.auth_token, or data.token attribute.

Sample payload

Here's a sample payload containing all attributes returned as part of this resource.

{
    "data": {
        "id": 3823525,
        "name": "Zakary Bernier",
        "full_name": "Zakary Bernier",
        "first_name": "Zakary",
        "last_name": "Bernier",
        "display_name": "Zakary Bernier",
        "username": "zakary-bernier",
        "email": "[email protected]",
        "organization": {
            "id": 31778,
            "name": "Carroll - Schumm"
        },
        "phone": "4861384097",
        "language": "en",
        "balance": 0,
        "email_confirm": false,
        "email_hardbounce": false,
        "phone_confirm": false,
        "tin": null,
        "salutation": "Mr.",
        "title": "Administrator",
        "profile_photo": null,
        "currency": null,
        "subscriptions": null,
        "memberships": null,
        "gift_recipients": null,
        "expired_subscriptions": null,
        "addresses": null,
        "invoices": null,
        "charges": null,
        "orders": null,
        "source": {
            "id": 1917778,
            "object_id": "card_xxxxxxxxxxxx",
            "status": "chargeable",
            "deletable": false,
            "is_default": true,
            "properties": {
                "id": "card_xxxxxxxxxxxx",
                "brand": "Visa",
                "last4": "4242",
                "exp_year": 2025,
                "exp_month": 3
            }
        },
        "sources": [
            {
                "id": 1917778,
                "object_id": "card_xxxxxxxxxxxx",
                "status": "chargeable",
                "deletable": false,
                "is_default": true,
                "properties": {
                    "id": "card_xxxxxxxxxxxx",
                    "brand": "Visa",
                    "last4": "4242",
                    "exp_year": 2025,
                    "exp_month": 3
                }
            }
        ],
        "metadata": {
            "key1": "value_for_metadata_key1",
            "key2": "value_for_metadata_key2"
        },
        "is_created": false,
        "last_login_method": "email",
        "auth_token": "eyJ0xxx",
        "token": "eyJ0xxx",
        "setup_intent": {
            "id": seti_xxxxxxxxxxxx",
            "client_secret": "seti_xxxxxxxxxxxx",
            "status": "succeeded"
        }
    },
    "status": "success"
}

Plan resource

This resource is returned by the Eligible plans endpoint, as part of the Segments feature.

Sample payload

Here's a sample payload containing all attributes returned as part of this resource.

{
    "error": false,
    "data": [
        {
            "id": 27447,
            "nickname": "Monthly @ 9.95 USD",
            "description": null,
            "interval": "month",
            "interval_count": 1,
            "is_donation": false,
            "amount": 995,
            "currency": "usd",
            "auto_renew": true,
            "type": "regular",
            "entitlements": null,
            "segments": [
                {
                    "id": 3,
                    "name": "Subscriber Prospects"
                }
            ]
        }
    ]
}

Coupon resource

This resource is returned by the Eligible coupons endpoint, as part of the Segments feature.

Sample payload

Here's a sample payload containing all attributes returned as part of this resource.

{
    "error": false,
    "data": [
        {
            "id": 707638,
            "code": "5DOLLAROFF",
            "type": "subscription",
            "duration": "forever",
            "segments": [
                {
                    "id": 3,
                    "name": "Subscriber Prospects"
                }
            ]
        }
    ]
}

Product SKU resource

This resource is returned by the Eligible product skus endpoint, as part of the Segments feature.

Sample payload

Here's a sample payload containing all attributes returned as part of this resource.

{
    "error": false,
    "data": [
        {
            "id": 546,
            "name": "SKU #1",
            "price": 995,
            "image": "/images/site/ecommerce/product/sku/image/546-1708523419.png",
            "currency": "usd",
            "inventory_type": 0,
            "inventory_quantity": 1,
            "inventory_description": null,
            "expires_at": null,
            "entitlements": null,
            "segments": [
                {
                    "id": 3,
                    "name": "Subscriber Prospects"
                }
            ]
        }
    ]
}

Newsletter resource

This resource is returned for Newsletter endpoints.

Payment method resource

This resource is returned for Payment methods endpoints.

Sample payload

Here's a sample payload containing all attributes returned as part of this resource.

{
    "data": {
        "id": 1917757,
        "object_id": "card_xxxxxxxxxxxx",
        "status": "chargeable",
        "deletable": false,
        "is_default": true,
        "properties": {
            "id": "card_xxxxxxxxxxxx",
            "brand": "Visa",
            "last4": "4242",
            "exp_year": 2025,
            "exp_month": 3
        },
        "setup_intent": {
            "id": "seti_xxxxxxxxxxxx",
            "client_secret": "seti_xxxxxxxxxxxx",
            "status": "succeeded"
        }
    }
}