Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rmz.gg/llms.txt

Use this file to discover all available pages before exploring further.

Get Subscription

GET/subscriptions/
Returns full details for a single customer subscription, including product, customer, and order information.

Authentication

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Acceptapplication/jsonRecommended

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe subscription ID

Example Request

curl -X GET "https://merchant-api.rmz.gg/shawarma/subscriptions/501" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Success Response

{
  "message": null,
  "data": {
    "id": 501,
    "status": "active",
    "external_customer_id": "usr_abc123",
    "starts_at": "2024-01-01",
    "ends_at": "2024-12-31",
    "start_date": "2024-01-01",
    "end_date": "2024-12-31",
    "current_period_start": "2024-01-01T00:00:00.000000Z",
    "current_period_end": "2024-12-31T00:00:00.000000Z",
    "trial_ends_at": null,
    "cancel_at_period_end": false,
    "canceled_at": null,
    "duration": "annually",
    "order_id": 78901,
    "auto_renew": true,
    "price": {
      "amount": 199.99,
      "formatted": "١٩٩٫٩٩ ر.س",
      "currency": "SAR"
    },
    "metadata": {
      "external_user_id": "usr_abc123",
      "plan": "pro"
    },
    "product": {
      "id": 102,
      "name": "Pro Plan",
      "slug": "pro-plan",
      "type": "subscription"
    },
    "variant": {
      "id": 15,
      "duration": "annually",
      "duration_text": "سنه",
      "price": 199.99
    },
    "payment_method": {
      "last_four": "4242",
      "scheme": "visa"
    },
    "scheduled_variant": null,
    "features": null,
    "is_active": true,
    "is_expired": false,
    "days_remaining": 276,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}

Response Fields

FieldTypeDescription
idintegerSubscription ID
statusstringCurrent status: trialing, active, past_due, paused, canceled, expired
external_customer_idstring/nullStable identifier the merchant supplied at checkout creation. Use this to correlate RMZ subscriptions with your own user records. null if not supplied.
current_period_startstringStart of current billing period (ISO 8601)
current_period_endstringEnd of current billing period (ISO 8601)
trial_ends_atstring/nullWhen the trial ends (null if no trial)
cancel_at_period_endbooleanWhether the subscription will cancel at end of current period
canceled_atstring/nullWhen cancellation was requested
paused_atstringISO 8601 timestamp recording when the subscription was paused. Only present when status is paused.
paused_remaining_daysintegerNumber of days that were remaining in the current period at the moment of pause. When the subscription is unpaused, this many days are added to the new period end. Only present when status is paused.
next_retry_atstringISO 8601 timestamp for when the next automatic retry charge will be attempted. Only present when status is past_due.
durationstringDuration key: monthly, quarterly, semiAnnual, annually, biennial, quinquennial, decennial
order_idintegerOriginal order ID
auto_renewbooleanWhether auto-renewal is active (has saved card and not canceling)
priceobjectThe locked subscription price (set at creation, immune to variant price changes)
metadataobject/nullCustom key-value pairs attached at checkout session creation
productobjectThe subscription product (id, name, slug, type)
variantobjectCurrent subscription variant (id, duration, duration_text, price)
payment_methodobject/nullSaved card info (last_four, scheme) — only if auto-renew is active
scheduled_variantobject/nullPending variant change (applied at next renewal)
is_activebooleanWhether the subscription currently grants access
is_expiredbooleanWhether the subscription has expired
days_remainingintegerNumber of days remaining in current period

Error Responses

CodeDescription
401Unauthorized — invalid or missing token
404Subscription not found