Skip to main content

List Subscriptions

GET/subscriptions
Returns a paginated list of customer subscriptions for the authenticated store. You can filter by customer email, phone, or country code.

Authentication

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Acceptapplication/jsonRecommended

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
customerEmailstringNoFilter by customer email
customerPhonestringNoFilter by customer phone number
customerCountryCodestringNoFilter by customer country code (e.g., 966)

Example Request

curl -X GET "https://merchant-api.rmz.gg/shawarma/subscriptions?customerEmail=ahmed@example.com" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Success Response

{
  "message": null,
  "data": {
    "current_page": 1,
    "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,
        "customer": {
          "id": 123,
          "firstName": "Ahmed",
          "lastName": "Ali",
          "email": "ahmed@example.com",
          "country_code": "966",
          "phone": "501234567",
          "is_banned": false
        },
        "product": {
          "id": 102,
          "name": "Pro Plan",
          "slug": "pro-plan",
          "type": "subscription"
        }
      }
    ],
    "first_page_url": "https://merchant-api.rmz.gg/shawarma/subscriptions?page=1",
    "from": 1,
    "next_page_url": null,
    "path": "https://merchant-api.rmz.gg/shawarma/subscriptions",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}

Filter Examples

By Customer Phone

curl -X GET "https://merchant-api.rmz.gg/shawarma/subscriptions?customerCountryCode=966&customerPhone=501234567" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

All Subscriptions (No Filter)

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

Error Responses

CodeDescription
401Unauthorized — invalid or missing token