Skip to main content

Get Product

GET/products/
Returns full details for a single product, including images, digital codes, subscription variants, and categories.

Authentication

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Acceptapplication/jsonRecommended

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe product ID

Example Request

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

Success Response

{
  "message": null,
  "data": {
    "id": 101,
    "store_id": 1,
    "name": "Premium License",
    "slug": "premium-license",
    "type": "code",
    "price": 49.99,
    "discount_price": null,
    "discount_expiry": null,
    "description": "Premium software license key...",
    "status": 1,
    "min_qty": 1,
    "max_purchase_count": null,
    "purchase_count": 15,
    "fields": [],
    "is_noticeable": false,
    "license_config": null,
    "metadata": null,
    "deleted_at": null,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-15T00:00:00.000000Z",
    "actual_price": 49.99,
    "current_stock": 25,
    "is_new": false,
    "is_discounted": false,
    "is_discount_expired": false,
    "show_discount_countdown": false,
    "show_discount_savings": false,
    "discount_savings_amount": 0,
    "codes": [
      {
        "id": 301,
        "code": "XXXX-XXXX-XXXX",
        "order_product_id": null,
        "product_id": 101,
        "store_id": 1,
        "deleted_at": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z"
      }
    ],
    "image": {
      "id": 201,
      "model_type": "App\\Models\\StoreProduct",
      "model_id": 101,
      "type": "main_product_image",
      "file_name": "product-image.png",
      "path": "products/images",
      "metadata": null,
      "deleted_at": null,
      "created_at": "2024-01-01T00:00:00.000000Z",
      "updated_at": "2024-01-01T00:00:00.000000Z",
      "full_link": "https://cdn.rmz.gg/products/images/product-image.png"
    },
    "subscription_variants": [],
    "categories": [
      {
        "id": 1,
        "slug": "software",
        "title": "Software",
        "description": null,
        "metadata": null,
        "is_active": true,
        "parent_id": null,
        "store_id": 1,
        "deleted_at": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "sort_index": 1,
        "pivot": {
          "product_id": 101,
          "category_id": 1
        }
      }
    ]
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}

Response Fields

FieldTypeDescription
idintegerProduct ID
store_idintegerStore ID
namestringProduct name
slugstringURL-friendly identifier
typestringProduct type: product, code, service, subscription, course, license
pricefloatDisplay price
discount_pricefloat/nullDiscounted price if a discount is active
discount_expirystring/nullDiscount expiry date
descriptionstringProduct description
statusintegerProduct status (1 = active, 3 = disabled)
min_qtyintegerMinimum order quantity
max_purchase_countinteger/nullMaximum total purchases allowed (null = unlimited)
purchase_countintegerCurrent total purchase count
fieldsarrayCustom fields/options configured for the product
is_noticeablebooleanWhether the product accepts customer notes
license_configobject/nullLicense configuration (for license type products)
metadataobject/nullProduct metadata including display settings
actual_pricefloatComputed selling price (discount price if active, otherwise regular price)
current_stockintegerCurrent available stock
is_newbooleanWhether the product was created in the last 12 hours
is_discountedbooleanWhether an active discount is currently applied
is_discount_expiredbooleanWhether the discount has expired
show_discount_countdownbooleanWhether to show a discount countdown timer
show_discount_savingsbooleanWhether to show discount savings amount
discount_savings_amountfloatAmount saved with discount (0 if no active discount)
imageobject/nullProduct image with full_link containing the full CDN URL
image.full_linkstringFull CDN URL for the image
codesarrayAvailable (unsold) digital codes (for code type products). Only codes where order_product_id is null are returned.
subscription_variantsarraySubscription plans (for subscription type products). Each variant includes a durationText field with the Arabic duration label.
subscription_variants[].durationTextstringArabic label for the duration (e.g., “شهر”, “سنه”)
categoriesarrayAssigned categories with pivot data
The codes array only includes unsold codes (where order_product_id is null). For security, ensure you do not expose this data to end users in client-side applications.

Error Responses

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