API · Subscriptions

Subscriptions API

Query available plans, check subscription status, and manage billing through Apple In-App Purchase or Stripe.

Plans

GET List plans

/api/v1/subscriptions/plans/

Returns all available subscription plans with pricing and feature details.

Plan fields

FieldTypeDescription
uidstringPlan identifier
namestringPlan name (e.g., "Pro", "Business")
slugstringURL-safe plan slug
descriptionstringPlan description
price_monthlystringMonthly price (decimal)
price_yearlystringYearly price (decimal)
currencystringISO 4217 currency code
featuresobject[]Feature list with limits
is_popularbooleanHighlighted plan flag
stripe_monthly_price_idstringStripe Price ID for monthly billing
stripe_yearly_price_idstringStripe Price ID for yearly billing
Request
curl https://app.instica.com/api/v1/subscriptions/plans/ \
  -H "Authorization: Bearer YOUR_TOKEN"
Response — 200 OK
[
  {
    "uid": "plan_pro",
    "name": "Pro",
    "slug": "pro",
    "description": "For growing sellers",
    "price_monthly": "19.99",
    "price_yearly": "199.99",
    "currency": "USD",
    "features": [
      {
        "name": "Inventory items",
        "limit": 5000
      },
      {
        "name": "Marketplace connections",
        "limit": 5
      }
    ],
    "is_popular": true,
    "stripe_monthly_price_id": "price_1N...",
    "stripe_yearly_price_id": "price_1N..."
  }
]

Subscription status

GET Get status

/api/v1/subscriptions/status/

Returns the current subscription state, active plan details, usage, and billing provider.

Status fields

FieldTypeDescription
is_activebooleanWhether subscription is active
planobjectCurrent plan details (or null)
billing_providerstringstripe, apple, or none
current_period_endstringISO 8601 period end date
cancel_at_period_endbooleanWhether cancellation is pending
trial_endstring | nullTrial end date if applicable
usageobjectCurrent usage vs plan limits
Response — 200 OK
{
  "is_active": true,
  "plan": {
    "uid": "plan_pro",
    "name": "Pro",
    "slug": "pro"
  },
  "billing_provider": "stripe",
  "current_period_end": "2025-02-15T00:00:00Z",
  "cancel_at_period_end": false,
  "trial_end": null,
  "usage": {
    "inventory_items": 1234,
    "inventory_limit": 5000,
    "marketplace_connections": 3,
    "marketplace_limit": 5
  }
}

Apple In-App Purchase

iOS app subscriptions are managed through App Store. The API provides endpoints for account tokens and transaction syncing.

EndpointMethodDescription
/api/v1/subscriptions/apple/account-token/GETGet account token for StoreKit
/api/v1/subscriptions/apple/transactions/POSTSubmit App Store transaction

iOS only: These endpoints are called by the Instica Inventory iOS app during purchase flows. Direct API calls are not required for Stripe subscribers.

Account token response

FieldTypeDescription
account_tokenstringUUID token for StoreKit purchase attribution
Get account token
curl https://app.instica.com/api/v1/subscriptions/apple/account-token/ \
  -H "Authorization: Bearer YOUR_TOKEN"
Response — 200 OK
{
  "account_token": "550e8400-e29b-41d4-a716-446655440000"
}
Submit transaction
curl -X POST \
  https://app.instica.com/api/v1/subscriptions/apple/transactions/ \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "2000000123456789",
    "original_transaction_id": "2000000123456789"
  }'

Stripe billing

Web and API subscribers use Stripe for billing. These endpoints manage checkout sessions, customer portals, and subscription lifecycle.

EndpointMethodDescription
/api/v1/subscriptions/stripe/checkout/POSTCreate a Stripe Checkout session
/api/v1/subscriptions/stripe/portal/POSTCreate a billing portal session
/api/v1/subscriptions/stripe/details/GETGet Stripe subscription details
/api/v1/subscriptions/stripe/reactivate/POSTReactivate cancelled subscription

Checkout request body

FieldTypeRequiredDescription
price_idstringYesStripe Price ID from the plans endpoint
success_urlstringNoRedirect URL after success
cancel_urlstringNoRedirect URL on cancel

Checkout response

FieldTypeDescription
checkout_urlstringStripe Checkout session URL — redirect user here
session_idstringStripe Session ID for tracking
Create checkout
curl -X POST \
  https://app.instica.com/api/v1/subscriptions/stripe/checkout/ \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "price_id": "price_1NxyzMonthly",
    "success_url": "https://app.instica.com/settings/billing?success=true",
    "cancel_url": "https://app.instica.com/pricing"
  }'
Response — 200 OK
{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_live_...",
  "session_id": "cs_live_a1b2c3..."
}
Create billing portal
curl -X POST \
  https://app.instica.com/api/v1/subscriptions/stripe/portal/ \
  -H "Authorization: Bearer YOUR_TOKEN"

# Response: { "portal_url": "https://billing.stripe.com/p/session/..." }
Reactivate
curl -X POST \
  https://app.instica.com/api/v1/subscriptions/stripe/reactivate/ \
  -H "Authorization: Bearer YOUR_TOKEN"

# Response: { "status": "active", "cancel_at_period_end": false }

Payment methods

EndpointMethodDescription
/api/v1/subscriptions/stripe/payment-methods/GETList payment methods

Payment method fields

FieldTypeDescription
idstringStripe PaymentMethod ID
typestringcard, us_bank_account, etc.
cardobjectCard details (brand, last4, exp_month, exp_year)
is_defaultbooleanWhether this is the default payment method
Response — 200 OK
[
  {
    "id": "pm_1Nxyz...",
    "type": "card",
    "card": {
      "brand": "visa",
      "last4": "4242",
      "exp_month": 12,
      "exp_year": 2026
    },
    "is_default": true
  }
]

Invoices

EndpointMethodDescription
/api/v1/subscriptions/stripe/invoices/GETList invoices

Invoice fields

FieldTypeDescription
idstringStripe Invoice ID
statusstringpaid, open, void, uncollectible
amount_dueintegerAmount in cents
currencystringISO 4217 currency code
createdintegerUnix timestamp
hosted_invoice_urlstringURL for the hosted invoice page
invoice_pdfstringURL to download the invoice PDF
Response — 200 OK
[
  {
    "id": "in_1Nxyz...",
    "status": "paid",
    "amount_due": 1999,
    "currency": "usd",
    "created": 1706140800,
    "hosted_invoice_url": "https://invoice.stripe.com/i/...",
    "invoice_pdf": "https://pay.stripe.com/invoice/..."
  }
]