API Reference

Complete reference for the Majir Rewards API. Base URL: https://api.majir.shop

Register

Register as an API developer and receive your API key.

POST /api/v1/developers/register

Creates a new developer account. Returns an API key with the prefix mjr_live_. Verify your email to activate the key for production use.

Body application/json

name string required

Developer's full name.

email string required

Email address. A verification link will be sent here.

company string

Company or organization name.

Response

developer_id string (uuid)

Unique identifier for your developer account.

api_key string

Your API key. Store this securely — it won't be shown again.

tier enum<string>

Rate limit tier. Available options: free, starter, enterprise

email_verified boolean

Whether the email has been verified. Initially false.

cURL
curl -X POST https://api.majir.shop/api/v1/developers/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Developer",
    "email": "jane@example.com",
    "company": "Acme Inc"
  }'
Response 201
{
  "success": true,
  "data": {
    "developer_id": "d8f7a1b2-3c4d-5e6f-...",
    "api_key": "mjr_live_k9x2m4p7q1w3...",
    "tier": "free",
    "email_verified": false
  }
}

Verify Email

Email verification callback.

GET /api/v1/developers/verify

Called when the developer clicks the verification link in their email. Activates the API key for production use.

Query Parameters

token string required

Verification token from the email link.

Response

email_verified boolean

Confirmation that the email is now verified.

message string

Human-readable success message.

cURL
curl https://api.majir.shop/api/v1/developers/verify\?token\=YOUR_VERIFICATION_TOKEN
Response 200
{
  "success": true,
  "data": {
    "email_verified": true,
    "message": "Email verified successfully"
  }
}

Usage Statistics

Get API key usage and rate limit status.

GET /api/v1/developers/usage
X-Majir-API-Key

Returns request counts, rate limit status, and tier information for the authenticated developer.

Response

tier string

Current rate limit tier. Example: "free"

requests_today integer

Number of API requests made today.

daily_limit integer

Maximum requests allowed per day for your tier.

total_requests integer

Total API requests since account creation.

api_key_created string (date-time)

ISO 8601 timestamp of when the API key was created.

cURL
curl https://api.majir.shop/api/v1/developers/usage \
  -H "X-Majir-API-Key: mjr_live_your_key_here"
Response 200
{
  "success": true,
  "data": {
    "tier": "free",
    "requests_today": 42,
    "daily_limit": 100,
    "total_requests": 1337,
    "api_key_created": "2026-03-20T10:00:00Z"
  }
}

Rotate Key

Invalidate your current API key and get a new one.

POST /api/v1/developers/keys/rotate
X-Majir-API-Key

Rotates your API key. The previous key is immediately invalidated. Use this if your key is compromised.

Response

api_key string

Your new API key. Store this securely.

previous_key_invalidated boolean

Confirms the old key has been revoked.

cURL
curl -X POST https://api.majir.shop/api/v1/developers/keys/rotate \
  -H "X-Majir-API-Key: mjr_live_your_key_here"
Response 200
{
  "success": true,
  "data": {
    "api_key": "mjr_live_n3w_r0t4t3d_k3y...",
    "previous_key_invalidated": true
  }
}

Record Click

Track a click event for attribution.

POST /api/v1/events/click
X-Majir-API-Key

Records a click event for attribution tracking. Use this when a user clicks on an offer or affiliate link. The click is attributed to your developer account for conversion tracking.

Body application/json

offer_id string required

ID of the offer being clicked.

url string (uri) required

Destination URL for the click.

Response

click_id string

Unique identifier for the recorded click event.

tracked boolean

Whether the click was successfully tracked for attribution.

redirect_url string (uri)

The attributed redirect URL to send the user to.

cURL
curl -X POST https://api.majir.shop/api/v1/events/click \
  -H "Content-Type: application/json" \
  -H "X-Majir-API-Key: mjr_live_your_key_here" \
  -d '{
    "offer_id": "offer_abc123",
    "url": "https://merchant.example.com/deal"
  }'
Response 201
{
  "success": true,
  "data": {
    "click_id": "clk_7f8a9b0c1d2e",
    "tracked": true,
    "redirect_url": "https://merchant.example.com/deal?ref=majir_clk_7f8a9b0c1d2e"
  }
}

Coming Soon

The following endpoints are in development and will be available in upcoming releases.

Coming Soon

Offers

Search offers, get offer details, and browse offer categories.

GET /api/v1/offers — Search offers

GET /api/v1/offers/:id — Get offer detail

GET /api/v1/offers/categories — List categories

Coming Soon

Merchants

Search merchants, get details, list their offers, and find nearby locations.

GET /api/v1/merchants — Search merchants

GET /api/v1/merchants/:id — Get merchant detail

GET /api/v1/merchants/:id/offers — Merchant offers

GET /api/v1/merchants/nearby — Nearby merchants

Coming Soon

Redemptions

Create redemptions, check status, and list redemption history.

POST /api/v1/redemptions — Create redemption

GET /api/v1/redemptions/:id — Redemption status

GET /api/v1/redemptions — List redemptions

Coming Soon

Webhooks

Receive real-time conversion postback notifications when attributed clicks result in purchases.

POST /api/v1/webhooks — Register webhook

GET /api/v1/webhooks — List webhooks

DELETE /api/v1/webhooks/:id — Remove webhook