Resources

Resources

Open API endpoints return a structured JSON response wrapping one or more resource objects. This page documents the shape of each resource the API returns. Most endpoints return the Customer resource; the others are returned by their respective endpoints (and several are also embedded inside the Customer resource).

Site resource

Returned by GET /site — the entry point for any integration. It carries your site's configuration: feature flags, default currency/locale, integration keys, payment-gateway settings, and your catalog (products, plans, paywalls, newsletters). Load it first so your front end knows which flows to render.

AttributeDescription
account_idThe account the site belongs to.
name / link / slugSite name, URL, and slug.
default_currency / default_localeDefault currency and locale.
security_keyThe site’s Google reCAPTCHA Enterprise public site key. Present only when fraud prevention (Risk Assessment) is enabled; otherwise null. Use it to load reCAPTCHA on your front end and generate the security_token sent with sensitive requests (e.g. register/login).
ecommerce_enabledWhether e-commerce is enabled.
email_verify_enabledWhether email verification is required.
passwordless_enabled / passwordless_token_durationPasswordless login toggle and token lifetime (minutes).
auth_token_ttl_daysLifetime of customer auth tokens, in days.
taxes_enabled / tax_inclusiveTax configuration.
restrictive_paywall_metatags_enabledWhether restrictive paywall metatags are on.
google_analytics_id, google_app_id, google_app_id_ios, google_app_id_android, facebook_app_id, klaviyo_api_key, auth0_base_url, auth0_client_idThird-party integration identifiers/keys (null when unset).
braintree_tokenization / braintree_currency / braintree_gateway_settingsBraintree client settings.
vantiv_gateway_settings / tap_gateway_settings / cybersource_gateway_settingsPer-gateway client settings (null when the gateway isn't active).
productsAvailable products, each with nested plans, paywall, and paywalls (see the sample below).
newslettersNewsletter lists available on the site.
logo / banner_url / custom_css / design_settingsBranding and design configuration.
settings / antiadblockMisc. site settings objects.
cancel_settings / cancellation_reasonsSelf-serve cancellation configuration.
billing_settingsBilling toggles (e.g. vendor_tip).

Sample payload

{
  "error": false,
  "data": {
    "account_id": "acct_1A2b3C4d5E6f7G8h",
    "security_key": null,
    "ecommerce_enabled": true,
    "email_verify_enabled": false,
    "passwordless_enabled": 0,
    "passwordless_token_duration": 15,
    "auth_token_ttl_days": 60,
    "google_analytics_id": null,
    "google_app_id": null,
    "google_app_id_ios": "",
    "google_app_id_android": "",
    "facebook_app_id": null,
    "klaviyo_api_key": null,
    "auth0_base_url": null,
    "auth0_client_id": null,
    "taxes_enabled": false,
    "tax_inclusive": false,
    "default_currency": "usd",
    "braintree_tokenization": "",
    "braintree_currency": "",
    "vantiv_gateway_settings": null,
    "tap_gateway_settings": null,
    "cybersource_gateway_settings": null,
    "braintree_gateway_settings": null,
    "name": "Example Publication",
    "link": "https://example.com",
    "slug": "example-publication",
    "logo": null,
    "banner_url": null,
    "custom_css": null,
    "settings": {},
    "default_locale": "en_US",
    "antiadblock": null,
    "products": [
      {
        "id": 1024,
        "address_required": true,
        "name": "Premium Digital",
        "description": "Try 2 weeks free, then only $9.95 / month",
        "entitlements": ["premium1"],
        "image": "https://uploads.pelcro.com/images/site/product/image/690.png",
        "plans": [
          {
            "id": 1025,
            "product_id": 1024,
            "amount": 995,
            "amount_formatted": "$9.95",
            "currency": "usd",
            "interval": "month",
            "interval_count": 1,
            "auto_renew": true,
            "trial_period_days": 14,
            "nickname": "2 Week Free Trial, then $9.95/month",
            "type": "regular"
          }
        ],
        "paywall": { "id": 1026, "product_id": 1024, "frequency_limit": 2, "tags": "premium1", "auto_trigger": true },
        "paywalls": []
      }
    ],
    "newsletters": [
      { "id": 12, "title": "Daily Briefing", "subtitle": "The day in five minutes", "status": "active", "addToRegistration": true, "onlySubscribers": false }
    ],
    "restrictive_paywall_metatags_enabled": false,
    "design_settings": null,
    "cancel_settings": { "status": false, "refund": false, "countries": false, "states": false },
    "cancellation_reasons": [],
    "billing_settings": { "vendor_tip": false }
  }
}

Customer resource

Returned by most endpoints. It carries the customer's profile, a set of relationships, and the authentication token. Relationships are only populated when present.

AttributeDescription
idUnique customer identifier.
name / full_nameThe customer's full name.
first_name / last_nameGiven and family names.
display_nameOptional public-facing name.
usernameOptional unique username.
emailThe customer's email address.
organizationAssociated organization ({id, name}), if any.
phonePhone number.
languageTwo-letter language code.
balanceAccount credit balance, in the smallest currency unit.
currencyThe customer's currency (set on first paid subscription).
email_confirm / phone_confirmWhether email / phone are verified.
tinTax identification number.
metadataArbitrary key-value pairs stored on the customer.
subscriptionsActive or extended subscriptions.
membershipsActive membership subscriptions.
expired_membershipsExpired membership subscriptions.
gift_recipientsGift subscriptions given by this customer.
expired_subscriptionsExpired subscriptions.
addressesThe customer's addresses.
invoicesThe customer's invoices.
chargesPayments made by the customer.
ordersE-commerce orders.
sourceThe default payment method.
sourcesAll payment methods.
last_login_methodHow the customer last signed in (e.g. email).
auth_token / tokenThe authentication token (see below).

The authentication token

A customer resource always contains the customer's identity as a JWT. This token must be sent in the authorization header to access protected endpoints. It can be read from either data.auth_token or data.token (both hold the same value).

Sample payload

{
    "data": {
        "id": 1017,
        "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": 1039, "name": "Carroll - Schumm" },
        "phone": "5555550123",
        "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,
        "expired_memberships": null,
        "gift_recipients": null,
        "expired_subscriptions": null,
        "addresses": null,
        "invoices": null,
        "charges": null,
        "orders": null,
        "source": {
            "id": 1040,
            "object_id": "card_xxxxxxxxxxxx",
            "status": "chargeable",
            "deletable": false,
            "is_default": true,
            "properties": { "id": "card_xxxxxxxxxxxx", "brand": "Visa", "last4": "4242", "exp_year": 2030, "exp_month": 3 }
        },
        "sources": [
            {
                "id": 1040,
                "object_id": "card_xxxxxxxxxxxx",
                "status": "chargeable",
                "deletable": false,
                "is_default": true,
                "properties": { "id": "card_xxxxxxxxxxxx", "brand": "Visa", "last4": "4242", "exp_year": 2030, "exp_month": 3 }
            }
        ],
        "metadata": { "key1": "value_for_metadata_key1", "key2": "value_for_metadata_key2" },
        "is_created": false,
        "last_login_method": "email",
        "last_active_at": null,
        "auth_token": "eyJ0xxx",
        "token": "eyJ0xxx"
    },
    "status": "success"
}

Subscription resource

Embedded in the Customer resource (subscriptions, memberships, …) and returned by the membership authorization endpoints.

AttributeDescription
idUnique subscription identifier.
statusLifecycle status (e.g. active, trialing, canceled, extended).
billingCollection method (charge_automatically or send_invoice).
quantityNumber of units / seats.
current_period_start / current_period_endCurrent billing period (YYYY-MM-DD).
startSubscription start date.
trial_start / trial_endTrial window, if any.
cancel_at / cancel_at_period_end / canceled_atCancellation schedule and timestamp.
cancel_reasonReason supplied at cancellation.
renews_at / expires_at / end_dateNext renewal / expiry timestamps.
address_id / address_requiredLinked shipping address and whether one is required.
domains / ip_addressesAuthorized email domains / IP ranges (membership subscriptions).
seats_occupied / seat_capacity / pending_membersMembership seat usage.
is_gift_donor / is_gift_recipient / gift_code / is_redeemedGift attributes.
shipments_remaining / shipments_suspended_untilShipment tracking for physical plans.
payment_methodHuman-readable description of the charging method.
planThe associated plan.
scheduleThe active subscription schedule (phases), if any.
metadataArbitrary key-value pairs.

Address resource

Embedded in the Customer resource (addresses) and returned by the address endpoints.

AttributeDescription
idUnique address identifier.
typeshipping or billing.
is_defaultWhether this is the default address of its type.
first_name / last_nameRecipient name.
company / title / departmentOptional organizational fields.
line1 / line2Street address.
city / state / state_nameCity and state/region (code + full name).
country / country_nameTwo-letter country code + full name.
postal_codePostal / ZIP code.
phoneContact phone number.
delivery_instructions / delivery_sequence_numberOptional delivery metadata.
vendor_idAssigned vendor, when vendor delivery is used.
created_at / updated_atTimestamps.

Invoice resource

Embedded in the Customer resource (invoices) and returned by the invoice endpoints.

AttributeDescription
idUnique invoice identifier.
statusInvoice status (e.g. paid, open, draft, void).
amount_due / amount_paid / amount_remainingAmounts in the smallest currency unit.
totalTotal amount including tax.
tax / tax_percentTax amount and rate.
discountApplied discount, if any.
currencyThree-letter currency code.
billingCollection method.
paidWhether the invoice is paid.
due_datePayment due date.
hosted_invoice_url / invoice_pdfLinks to the hosted invoice and PDF.
planThe plan this invoice is for.
subscription_idThe related subscription.
default_sourceThe payment method used.
pelcro_vendor_tip_amountVendor tip, if any.
created_at / updated_atTimestamps.

Order resource

Embedded in the Customer resource (orders) and returned by the e-commerce order endpoints.

AttributeDescription
idUnique order identifier.
user_idThe customer who placed the order.
address_idShipping address.
amountOrder total, in the smallest currency unit.
shipping_rateShipping cost.
currencyThree-letter currency code.
couponApplied coupon, if any.
statusOrder status.
payment_methodPayment method used.
itemsThe ordered line items (SKU + quantity).
metadataArbitrary key-value pairs.
createdCreation timestamp.

Payment method resource

Returned by the payment methods endpoints, and embedded as source / sources in the Customer resource.

AttributeDescription
idUnique payment-method identifier.
object_idThe gateway's identifier for the method.
statuse.g. chargeable.
is_defaultWhether this is the customer's default method.
deletableWhether it can be removed.
propertiesCard details: brand, last4, exp_month, exp_year.
setup_intentPresent when the gateway requires 3D Secure confirmation.

Sample payload

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

Newsletter resource

Returned by the newsletter endpoints.

AttributeDescription
emailThe subscriber's email address.
first_name / last_nameSubscriber name.
postal_codePostal / ZIP code.
sourceWhere the subscription originated (e.g. web).
listsThe newsletter lists subscribed to.
consent_url / consent_text / consent_type / consent_ipConsent capture details.
statusSubscription status.
site_idThe site the subscription belongs to.
created_at / updated_atTimestamps.

Sample payload

{
    "data": {
        "id": 1050,
        "email": "[email protected]",
        "first_name": "Zakary",
        "last_name": "Bernier",
        "postal_code": "10022",
        "source": "web",
        "lists": ["weekly-digest"],
        "consent_url": "https://www.example.com/newsletter",
        "consent_text": "I agree to receive the newsletter.",
        "consent_type": "opt_in",
        "consent_ip": "203.0.113.10",
        "status": "subscribed",
        "site_id": 1025,
        "created_at": 1677088109,
        "updated_at": 1677088109
    }
}

Plan resource

Returned by the Eligible plans endpoint, as part of the Segments feature.

AttributeDescription
idUnique plan identifier.
nicknameDisplay name.
descriptionPlan description.
interval / interval_countBilling interval (e.g. month × 1).
amount / currencyPrice in the smallest currency unit + currency.
is_donationWhether the plan is a donation.
auto_renewWhether it renews automatically.
typePlan type (e.g. regular, membership).
entitlementsAssociated entitlements, if any.
segmentsThe customer segments the plan is eligible for.

Sample payload

{
    "error": false,
    "data": [
        {
            "id": 1041,
            "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

Returned by the Eligible coupons endpoint, as part of the Segments feature.

AttributeDescription
idUnique coupon identifier.
codeThe coupon code to apply.
typeWhat the coupon applies to (e.g. subscription).
durationHow long the discount lasts (e.g. forever, once).
segmentsThe customer segments the coupon is eligible for.

Sample payload

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

Product SKU resource

Returned by the Eligible product SKUs endpoint, as part of the Segments feature.

AttributeDescription
idUnique SKU identifier.
nameSKU name.
price / currencyPrice in the smallest currency unit + currency.
imageSKU image path.
inventory_type / inventory_quantity / inventory_descriptionInventory tracking.
expires_atExpiry date, if any.
entitlementsAssociated entitlements, if any.
segmentsThe customer segments the SKU is eligible for.

Sample payload

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