API Reference

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

Register

Developer registration, available only when explicitly enabled.

POST /api/v1/developers/register

Public self-service registration is closed. The endpoint returns 403 while registration is disabled. When explicitly enabled, it creates a developer account and returns verification status. The registration response never contains an API key.

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

developerId string (uuid)

Unique identifier for your developer account.

email string

Email address for the developer account.

verificationRequired boolean

Always true for a newly registered account. Email verification must finish before a key can be issued.

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 when enabled 201
{
  "statuscode": 201,
  "success": true,
  "message": "Developer registered. Verification instructions will arrive by email.",
  "data": {
    "developerId": "d8f7a1b2-3c4d-5e6f-8a90-123456789abc",
    "email": "jane@example.com",
    "verificationRequired": true
  },
  "timestamp": "2026-11-14T12:00:00.000Z"
}

Verify Email

Email verification callback.

GET /api/v1/developers/verify

A valid unused verification link returns a new API key and sets the developer-session cookie. Registration can remain closed while existing verification links are processed.

Query Parameters

token string required

Verification token from the email link.

Response

isVerified boolean

Confirmation that the email is now verified.

apiKey string

Newly issued API key. Store it securely. The response also includes developerId, email and sessionExpiresAt. The session token is set in the majir_dev_session cookie, not in JSON.

cURL
curl https://api.majir.shop/api/v1/developers/verify\?token\=YOUR_VERIFICATION_TOKEN
Response 200
{
  "statuscode": 200,
  "success": true,
  "message": "Email verified successfully",
  "data": {
    "developerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "email": "jane@example.com",
    "isVerified": true,
    "apiKey": "YOUR_NEW_API_KEY",
    "sessionExpiresAt": "2026-11-15T00:00:00.000Z"
  },
  "timestamp": "2026-11-14T00:00:00.000Z"
}

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: "
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

apiKey string

Your new API key. Store this securely.

keyPrefix string

Prefix identifying the newly issued key.

cURL
curl -X POST https://api.majir.shop/api/v1/developers/keys/rotate \
  -H "X-Majir-API-Key: "
Response 200
{
  "statuscode": 200,
  "success": true,
  "message": "API key rotated successfully",
  "data": {
    "apiKey": "YOUR_ROTATED_API_KEY",
    "keyPrefix": "mjr_live_example"
  },
  "timestamp": "2026-11-14T00:00:00.000Z"
}

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: " \
  -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