Skip to main content

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,
    "store_id": 1,
    "customer_id": 123,
    "product_id": 102,
    "order_id": 78901,
    "order_product_item_id": 1001,
    "duration": "annually",
    "is_active": true,
    "start_date": "2024-01-01",
    "end_date": "2024-12-31",
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z",
    "durationText": "سنه",
    "daysLeft": 276,
    "product": {
      "id": 102,
      "name": "Pro Plan",
      "slug": "pro-plan",
      "type": "subscription"
    },
    "customer": {
      "id": 123,
      "firstName": "Ahmed",
      "lastName": "Ali",
      "email": "ahmed@example.com",
      "country_code": "966",
      "phone": "501234567",
      "is_banned": false
    },
    "order": {
      "id": 78901,
      "store_id": 1,
      "customer_id": 123,
      "coupon_id": null,
      "total": 199.99,
      "checkout_id": 55001,
      "current_status": 4,
      "seen_at": null,
      "order_review_notification_sent_at": null,
      "tax_rate": null,
      "tax_amount": null,
      "prices_include_tax": false,
      "tax_country_code": null,
      "tax_registration_number": null,
      "created_at": "2024-01-01T00:00:00.000000Z",
      "updated_at": "2024-01-01T00:00:00.000000Z",
      "human_format": {
        "date_human": "منذ سنة",
        "date_normal": "Mon, Jan 1, 2024 12:00 AM"
      }
    }
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}

Response Fields

FieldTypeDescription
idintegerSubscription ID
store_idintegerStore ID
customer_idintegerCustomer ID
product_idintegerProduct ID
order_idintegerOriginal order ID
order_product_item_idintegerOrder item ID
durationstringDuration key: monthly, quarterly, semiAnnual, annually, biennial, quinquennial, decennial
is_activebooleanWhether the subscription is currently active
start_datestring/nullSubscription start date (null if not yet activated)
end_datestring/nullSubscription end date
durationTextstringArabic label for the duration (e.g., “شهر”, “٣ اشهر”, “سنه”)
daysLeftintegerNumber of days remaining (0 if expired or not started)
productobjectThe subscription product (id, name, slug, type)
customerobjectThe subscribing customer
customer.is_bannedbooleanWhether the customer is banned
orderobjectThe full original order object including human_format

Error Responses

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