All API requests must include the following headers. All header names are Case-sensitive:
Authorization: Bearer your_api_key_here
X-Api-Email: your_email_here
Content-Type: application/json
Accept: application/json
Register
Register a new user account as your downline.
POST /api/accounts/register
{
"email": "[email protected]",
"name": "Jane Doe"
}
- The email field must be an active Gmail
- The name field must be between 3-100 characters
Success
{
"status": 200,
"message": "Account registered successfully",
"data": {
"email": "[email protected]",
"name": "Jane Doe",
"role": "member",
"tier": "basic",
"point": 0,
"balance": 0
}
}
Failed
{
"status": 400,
"message": "Target email already registered"
}
Login
Login to an existing account (for resellers or their downlines).
POST /api/accounts/login
{
"email": "[email protected]"
}
Success
{
"status": 200,
"message": "Login successful",
"data": {
"email": "[email protected]",
"name": "Jane Doe",
"role": "member",
"tier": "basic",
"point": 0,
"balance": 0
}
}
Failed
{
"status": 400,
"message": "Target account is neither yours or your downline"
}
Account Info
Get detailed information about the account.
POST /api/accounts/info
{
"email": "[email protected]"
}
Success
{
"status": 200,
"message": "Account info retrieved successfully",
"data": {
"email": "[email protected]",
"name": "Jane Doe",
"role": "member",
"tier": "basic",
"point": 0,
"balance": 0,
"code": "5JfrHT",
"is_premium": false,
"premium_ended_at": "2023-01-01 00:00:00",
"referrer_code": "s40c5F",
"created_at": "2023-01-01 00:00:00",
"updated_at": "2023-01-01 00:00:00"
}
}
Failed
{
"status": 400,
"message": "Target email is not registered"
}
Buy Plan
Purchase a premium plan
POST /api/transactions/buy
{
"email": "[email protected]",
"plan": "basic", // basic, gold, diamond
"channel_code": "BALANCE", // should be always BALANCE
"coupon_code": null // coupon code (optional)
}
Success
{
"status": 200,
"message": "Purchase completed successfully",
"data": {
"reference": "INV26010121MDNH572N5",
"type": "debit",
"status": "success", // unpaid, success, expired, failed, processing, refund
"amount": 50000,
"currency": "IDR",
"sku": "PLAN_BASIC",
"description": "Buy Plan Basic",
"coupon_code": null,
"wallet_or_va_number": "1234567890",
"channel_code": "BALANCE",
"is_qr": false,
"qr_url": null,
"is_link": true,
"link_url": null,
"invoice_url": "https://premzone.com/member/invoice/INV26010121MDNH572N5",
"via_api": true,
"webhook_sent": false,
"created_at": "2023-01-01 00:00:00",
"expired_at": "2023-01-01 00:05:00"
}
}
Failed
{
"status": 400,
"message": "Target account is not registered"
}
Check Status
Check transaction status.
POST /api/transactions/status
{
"reference": "INV26010121MDNH572N5"
}
Success
{
"status": 200,
"message": "Transaction found",
"data": {
"reference": "INV26010121MDNH572N5",
"type": "debit",
"status": "processing", // unpaid, success, expired, failed, processing, refund
"amount": 50000,
"currency": "IDR",
"sku": "PLAN_BASIC",
"description": "Buy Plan Basic",
"coupon_code": null,
"wallet_or_va_number": "1234567890",
"channel_code": "BALANCE",
"is_qr": false,
"qr_url": null,
"is_link": true,
"link_url": null,
"invoice_url": "https://premzone.com/member/invoice/INV26010121MDNH572N5",
"via_api": true,
"webhook_sent": false,
"created_at": "2023-01-01 00:00:00",
"expired_at": "2023-01-01 00:05:00"
}
}
Failed
{
"status": 400,
"message": "Transaction not found"
}
This webhook request will be sent to your webhook URL whenever your transaction status changed.
Available transaction statuses: unpaid, success, expired, failed, processing, refund
POST https://yoursite.com/webhook-url
Header:
X-Api-Secret: your_api_secret_here
X-Webhook-Event: TRX_STATUS_UPDATE
Content-Type: application/json
Accept: application/json
Body:
{
"reference": "INV26010121MDNH572N5",
"status": "success" // unpaid, success, expired, failed, processing, refund
}