⚡ Quick Start
Base URL: https://api.gotopup.biz.id
API Version: v1
Authentication: Bearer Token (API Key) or Otomax Username/Signature
Content-Type: application/json (for POST/PUT requests)
Authentication Methods
Custom API (Bearer Token)
For custom API integration, use Bearer token authentication:
Authorization: Bearer YOUR_API_KEY
Demo API Keys (for testing):
Buyer: buyer_api_key_123
Seller: seller_api_key_123
Otomax Integration (Query Parameters)
For Otomax software integration, use GET requests with query parameters:
?username=YOUR_USERNAME&sign=YOUR_SIGNATURE&code=PRODUCT_CODE&customer=CUSTOMER_NUMBER&ref_id=REF_ID
Demo Otomax Credentials:
Username: otomax_username_123
Signature: your_signature_hash
👤 Buyer API Endpoints
Complete documentation for all Buyer API endpoints. Use these endpoints to check balance, get price lists, make transactions, and manage your account.
Check Balance
Check wallet balance
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/balance \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json"
fetch('https://api.gotopup.biz.id/api/buyer/balance', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/balance');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"balance": 1000000,
"currency": "IDR"
}
}
Price List
Get product price list with optional filters
Request Body Variables
| Variable |
Type |
Required |
Description |
category |
string |
No |
Filter by category (e.g., "pulsa", "pln", "games") |
operator |
string |
No |
Filter by operator (e.g., "telkomsel", "indosat", "xl") |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/price-list \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"category": "pulsa", "operator": "telkomsel"}'
fetch('https://api.gotopup.biz.id/api/buyer/price-list', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
category: 'pulsa',
operator: 'telkomsel'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/price-list');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'category' => 'pulsa',
'operator' => 'telkomsel'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": [
{
"code": "TELKOMSEL5",
"name": "Pulsa Telkomsel 5.000",
"category": "prabayar",
"subcategory": "pulsa",
"operator": "Telkomsel",
"price": 5500,
"status": "active"
},
{
"code": "TELKOMSEL10",
"name": "Pulsa Telkomsel 10.000",
"category": "prabayar",
"subcategory": "pulsa",
"operator": "Telkomsel",
"price": 10500,
"status": "active"
}
]
}
Deposit
Top up wallet (deposit funds). Minimum deposit: Rp 50,000
Request Body Variables
| Variable |
Type |
Required |
Description |
amount |
number |
Yes |
Deposit amount (minimum: 50000) |
ref_id |
string |
Yes |
Unique reference ID for this deposit |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/deposit \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"amount": 100000, "ref_id": "DEPO-001"}'
fetch('https://api.gotopup.biz.id/api/buyer/deposit', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 100000,
ref_id: 'DEPO-001'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/deposit');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'amount' => 100000,
'ref_id' => 'DEPO-001'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "Deposit berhasil",
"data": {
"ref_id": "DEPO-001",
"amount": 100000,
"balance_before": 500000,
"balance_after": 600000,
"timestamp": "2025-01-15T10:30:00Z"
}
}
Transaction (Topup)
Buy product (Prabayar - topup). Balance will be deducted immediately.
Request Body Variables
| Variable |
Type |
Required |
Description |
code |
string |
Yes |
Product code (e.g., "TELKOMSEL5") |
customer_number |
string |
Yes |
Customer phone number (e.g., "081234567890") |
ref_id |
string |
Yes |
Unique reference ID for this transaction |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/transaction \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"code": "TELKOMSEL5", "customer_number": "081234567890", "ref_id": "TXN-001"}'
fetch('https://api.gotopup.biz.id/api/buyer/transaction', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'TELKOMSEL5',
customer_number: '081234567890',
ref_id: 'TXN-001'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/transaction');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'code' => 'TELKOMSEL5',
'customer_number' => '081234567890',
'ref_id' => 'TXN-001'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "Transaksi berhasil",
"data": {
"ref_id": "TXN-001",
"transaction_id": "TXN123456",
"code": "TELKOMSEL5",
"customer_number": "081234567890",
"product_name": "Pulsa Telkomsel 5.000",
"price": 5500,
"sn": "1234567890123456",
"status": "success",
"timestamp": "2025-01-15T10:30:00Z"
}
}
Inquiry (Pascabayar)
Inquiry bill information for pascabayar products (PLN, PDAM, etc.)
Request Body Variables
| Variable |
Type |
Required |
Description |
code |
string |
Yes |
Product code for pascabayar |
customer_number |
string |
Yes |
Customer number (meter number, account number, etc.) |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/inquiry \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"code": "PLN-PASCABAYAR", "customer_number": "12345678901"}'
fetch('https://api.gotopup.biz.id/api/buyer/inquiry', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'PLN-PASCABAYAR',
customer_number: '12345678901'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/inquiry');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'code' => 'PLN-PASCABAYAR',
'customer_number' => '12345678901'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"customer_number": "12345678901",
"customer_name": "John Doe",
"bill_period": "2025-01",
"total_bill": 150000,
"admin_fee": 2500,
"total_amount": 152500
}
}
Payment (Pascabayar)
Pay bill for pascabayar products
Request Body Variables
| Variable |
Type |
Required |
Description |
code |
string |
Yes |
Product code for pascabayar |
customer_number |
string |
Yes |
Customer number |
ref_id |
string |
Yes |
Unique reference ID for this payment |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/payment \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"code": "PLN-PASCABAYAR", "customer_number": "12345678901", "ref_id": "PAY-001"}'
fetch('https://api.gotopup.biz.id/api/buyer/payment', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'PLN-PASCABAYAR',
customer_number: '12345678901',
ref_id: 'PAY-001'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/payment');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'code' => 'PLN-PASCABAYAR',
'customer_number' => '12345678901',
'ref_id' => 'PAY-001'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"ref_id": "PAY-001",
"transaction_id": "TXN123456",
"customer_number": "12345678901",
"product_name": "PLN Pascabayar",
"price": 152500,
"status": "pending"
}
}
Transaction History
Get transaction history with filters and pagination
Request Body Variables
| Variable |
Type |
Required |
Description |
status |
string |
No |
Filter by status: "pending", "success", "failed", "processing" |
start_date |
string |
No |
Start date (ISO 8601 format: "2025-01-01") |
end_date |
string |
No |
End date (ISO 8601 format: "2025-01-31") |
page |
number |
No |
Page number (default: 1) |
limit |
number |
No |
Items per page (default: 20, max: 100) |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/transactions \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"status": "success", "start_date": "2025-01-01", "end_date": "2025-01-31", "page": 1, "limit": 20}'
fetch('https://api.gotopup.biz.id/api/buyer/transactions', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'success',
start_date: '2025-01-01',
end_date: '2025-01-31',
page: 1,
limit: 20
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/transactions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'status' => 'success',
'start_date' => '2025-01-01',
'end_date' => '2025-01-31',
'page' => 1,
'limit' => 20
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"transactions": [
{
"ref_id": "TXN-001",
"transaction_id": "TXN123456",
"customer_number": "081234567890",
"code": "TELKOMSEL5",
"product_name": "Pulsa Telkomsel 5.000",
"price": 5500,
"status": "success",
"sn": "1234567890123456",
"timestamp": "2025-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"total_pages": 3
}
}
}
API Configuration
Get API configuration
Code Examples
curl -X GET https://api.gotopup.biz.id/api/buyer/api/config \
-H "Authorization: Bearer buyer_api_key_123"
fetch('https://api.gotopup.biz.id/api/buyer/api/config', {
method: 'GET',
headers: {
'Authorization': 'Bearer buyer_api_key_123'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/api/config');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"api_key": "buyer_api_key_123",
"webhook_url": "https://your-domain.com/webhook",
"ip_whitelist": ["192.168.1.1"],
"rate_limit": 100,
"is_active": true
}
}
Update API configuration (webhook URL, IP whitelist, rate limit)
Request Body Variables
| Variable |
Type |
Required |
Description |
webhook_url |
string (URL) |
No |
Webhook URL for receiving notifications |
ip_whitelist |
array of strings |
No |
List of allowed IP addresses |
rate_limit |
number |
No |
Rate limit per minute (1-1000) |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/api/config \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"webhook_url": "https://your-domain.com/webhook", "rate_limit": 100}'
fetch('https://api.gotopup.biz.id/api/buyer/api/config', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook_url: 'https://your-domain.com/webhook',
rate_limit: 100
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/api/config');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'webhook_url' => 'https://your-domain.com/webhook',
'rate_limit' => 100
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "API config berhasil diupdate",
"data": {
"api_key": "buyer_api_key_123",
"webhook_url": "https://your-domain.com/webhook",
"ip_whitelist": ["192.168.1.1"],
"rate_limit": 100
}
}
Reports
Generate reports (transaction, purchase, deposit)
Request Body Variables
| Variable |
Type |
Required |
Description |
type |
string |
Yes |
Report type: "transaction", "purchase", "deposit" |
format |
string |
No |
Output format: "json" (default) or "csv" |
start_date |
string |
No |
Start date filter |
end_date |
string |
No |
End date filter |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/buyer/reports \
-H "Authorization: Bearer buyer_api_key_123" \
-H "Content-Type: application/json" \
-d '{"type": "transaction", "format": "json", "start_date": "2025-01-01", "end_date": "2025-01-31"}'
fetch('https://api.gotopup.biz.id/api/buyer/reports', {
method: 'POST',
headers: {
'Authorization': 'Bearer buyer_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'transaction',
format: 'json',
start_date: '2025-01-01',
end_date: '2025-01-31'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/buyer/reports');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer buyer_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'transaction',
'format' => 'json',
'start_date' => '2025-01-01',
'end_date' => '2025-01-31'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"type": "transaction",
"period": {
"start_date": "2025-01-01",
"end_date": "2025-01-31"
},
"summary": {
"total_transactions": 45,
"success_transactions": 42,
"failed_transactions": 3,
"total_amount": 247500,
"success_amount": 231000
},
"transactions": [...]
}
}
🏪 Seller API Endpoints
Complete documentation for all Seller API endpoints. Use these endpoints to manage products, handle settlements, and track sales.
Products Management
Get list of seller's products
Code Examples
curl -X GET https://api.gotopup.biz.id/api/seller/products \
-H "Authorization: Bearer seller_api_key_123"
fetch('https://api.gotopup.biz.id/api/seller/products', {
method: 'GET',
headers: {
'Authorization': 'Bearer seller_api_key_123'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/products');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": [
{
"code": "TELKOMSEL5",
"name": "Pulsa Telkomsel 5.000",
"category": "prabayar",
"subcategory": "pulsa",
"operator": "Telkomsel",
"price": 5500,
"status": "active"
}
]
}
Create new product
Request Body Variables
| Variable |
Type |
Required |
Description |
code |
string |
Yes |
Unique product code |
name |
string |
Yes |
Product name |
category |
string |
Yes |
"prabayar" or "pascabayar" |
subcategory |
string |
Yes |
Product subcategory (e.g., "pulsa", "pln", "games") |
operator |
string |
No |
Operator name (e.g., "Telkomsel", "Indosat") |
price |
number |
Yes |
Product price (minimum: 0) |
status |
string |
No |
"active" (default) or "inactive" |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/seller/products \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"code": "TELKOMSEL5", "name": "Pulsa Telkomsel 5.000", "category": "prabayar", "subcategory": "pulsa", "operator": "Telkomsel", "price": 5500, "status": "active"}'
fetch('https://api.gotopup.biz.id/api/seller/products', {
method: 'POST',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'TELKOMSEL5',
name: 'Pulsa Telkomsel 5.000',
category: 'prabayar',
subcategory: 'pulsa',
operator: 'Telkomsel',
price: 5500,
status: 'active'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/products');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'code' => 'TELKOMSEL5',
'name' => 'Pulsa Telkomsel 5.000',
'category' => 'prabayar',
'subcategory' => 'pulsa',
'operator' => 'Telkomsel',
'price' => 5500,
'status' => 'active'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "Product created successfully",
"data": {
"code": "TELKOMSEL5",
"name": "Pulsa Telkomsel 5.000",
"category": "prabayar",
"subcategory": "pulsa",
"operator": "Telkomsel",
"price": 5500,
"status": "active"
}
}
Update product (price, status, description)
Request Body Variables
| Variable |
Type |
Required |
Description |
price |
number |
No |
New product price |
status |
string |
No |
"active", "inactive", or "maintenance" |
description |
string |
No |
Product description |
Code Examples
curl -X PUT https://api.gotopup.biz.id/api/seller/products/TELKOMSEL5 \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"price": 5500, "status": "active"}'
fetch('https://api.gotopup.biz.id/api/seller/products/TELKOMSEL5', {
method: 'PUT',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
price: 5500,
status: 'active'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/products/TELKOMSEL5');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'price' => 5500,
'status' => 'active'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "Product updated successfully",
"data": {
"code": "TELKOMSEL5",
"name": "Pulsa Telkomsel 5.000",
"price": 5500,
"status": "active"
}
}
Settlement
Request settlement/withdrawal. Minimum: Rp 50,000
Request Body Variables
| Variable |
Type |
Required |
Description |
amount |
number |
Yes |
Settlement amount (minimum: 50000) |
bank_account |
object |
Yes |
Bank account information |
bank_account.bank_code |
string |
Yes |
Bank code (e.g., "BCA", "BNI", "MANDIRI") |
bank_account.account_number |
string |
Yes |
Bank account number |
bank_account.account_name |
string |
Yes |
Account holder name |
ref_id |
string |
No |
Unique reference ID |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/seller/settlement/request \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"amount": 500000, "bank_account": {"bank_code": "BCA", "account_number": "1234567890", "account_name": "Nama Pemilik Rekening"}, "ref_id": "SETTLE-001"}'
fetch('https://api.gotopup.biz.id/api/seller/settlement/request', {
method: 'POST',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 500000,
bank_account: {
bank_code: 'BCA',
account_number: '1234567890',
account_name: 'Nama Pemilik Rekening'
},
ref_id: 'SETTLE-001'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/settlement/request');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'amount' => 500000,
'bank_account' => [
'bank_code' => 'BCA',
'account_number' => '1234567890',
'account_name' => 'Nama Pemilik Rekening'
],
'ref_id' => 'SETTLE-001'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "Settlement request berhasil dibuat",
"data": {
"settlement_id": "SETT123456",
"amount": 500000,
"fee": 5000,
"net_amount": 495000,
"status": "pending",
"estimated_completion": "2025-01-18T10:00:00Z"
}
}
Transaction History
Get seller transaction history
Request Body Variables
| Variable |
Type |
Required |
Description |
status |
string |
No |
Filter by status: "pending", "success", "failed", "processing" |
start_date |
string |
No |
Start date (ISO 8601 format) |
end_date |
string |
No |
End date (ISO 8601 format) |
page |
number |
No |
Page number (default: 1) |
limit |
number |
No |
Items per page (default: 20, max: 100) |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/seller/transactions \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"status": "success", "start_date": "2025-01-01", "end_date": "2025-01-31"}'
fetch('https://api.gotopup.biz.id/api/seller/transactions', {
method: 'POST',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'success',
start_date: '2025-01-01',
end_date: '2025-01-31'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/transactions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'status' => 'success',
'start_date' => '2025-01-01',
'end_date' => '2025-01-31'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"transactions": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"total_pages": 3
}
}
}
API Configuration
Update webhook URL and API settings
Request Body Variables
| Variable |
Type |
Required |
Description |
webhook_url |
string (URL) |
No |
Webhook URL for receiving notifications |
ip_whitelist |
array of strings |
No |
List of allowed IP addresses |
rate_limit |
number |
No |
Rate limit per minute (1-1000) |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/seller/api/config \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"webhook_url": "https://your-domain.com/webhook"}'
fetch('https://api.gotopup.biz.id/api/seller/api/config', {
method: 'POST',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook_url: 'https://your-domain.com/webhook'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/api/config');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'webhook_url' => 'https://your-domain.com/webhook'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"message": "API config berhasil diupdate",
"data": {
"api_key": "seller_api_key_123",
"webhook_url": "https://your-domain.com/webhook",
"ip_whitelist": [],
"rate_limit": 100
}
}
Reports
Generate sales/transaction/product reports
Request Body Variables
| Variable |
Type |
Required |
Description |
type |
string |
Yes |
Report type: "transaction", "sales", "product" |
format |
string |
No |
Output format: "json" (default) or "csv" |
start_date |
string |
No |
Start date filter |
end_date |
string |
No |
End date filter |
Code Examples
curl -X POST https://api.gotopup.biz.id/api/seller/reports \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"type": "sales", "format": "json", "start_date": "2025-01-01", "end_date": "2025-01-31"}'
fetch('https://api.gotopup.biz.id/api/seller/reports', {
method: 'POST',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'sales',
format: 'json',
start_date: '2025-01-01',
end_date: '2025-01-31'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/reports');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'type' => 'sales',
'format' => 'json',
'start_date' => '2025-01-01',
'end_date' => '2025-01-31'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "success",
"code": "00",
"data": {
"type": "sales",
"period": {
"start_date": "2025-01-01",
"end_date": "2025-01-31"
},
"summary": {
"total_transactions": 45,
"success_transactions": 42,
"failed_transactions": 3,
"total_revenue": 231000,
"success_revenue": 231000,
"commission_rate": 0.05,
"commission_amount": 11550,
"net_revenue": 219450
}
}
}
🔌 Otomax Integration
Note: Otomax integration uses GET requests with query parameters. Signature validation is required for production use.
Transaction Request
Request transaction via Otomax (for buyers using Otomax software)
Query Parameters
| Parameter |
Type |
Required |
Description |
username |
string |
Yes |
Otomax username |
sign |
string |
Yes |
Signature hash (for authentication) |
code |
string |
Yes |
Product code |
customer |
string |
Yes |
Customer phone number |
ref_id |
string |
Yes |
Unique reference ID |
Code Examples
curl "https://api.gotopup.biz.id/api/otomax/request?username=otomax_username_123&sign=your_signature_hash&code=TELKOMSEL5&customer=081234567890&ref_id=TXN-001"
const params = new URLSearchParams({
username: 'otomax_username_123',
sign: 'your_signature_hash',
code: 'TELKOMSEL5',
customer: '081234567890',
ref_id: 'TXN-001'
});
fetch(`https://api.gotopup.biz.id/api/otomax/request?${params}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$params = http_build_query([
'username' => 'otomax_username_123',
'sign' => 'your_signature_hash',
'code' => 'TELKOMSEL5',
'customer' => '081234567890',
'ref_id' => 'TXN-001'
]);
$ch = curl_init('https://api.gotopup.biz.id/api/otomax/request?' . $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "00",
"message": "Success",
"ref_id": "TXN-001",
"sn": null
}
Price List
Get price list via Otomax
Query Parameters
| Parameter |
Type |
Required |
Description |
username |
string |
Yes |
Otomax username |
sign |
string |
Yes |
Signature hash |
category |
string |
No |
Filter by category |
operator |
string |
No |
Filter by operator |
Code Examples
curl "https://api.gotopup.biz.id/api/otomax/price-list?username=otomax_username_123&sign=your_signature_hash&category=pulsa&operator=telkomsel"
const params = new URLSearchParams({
username: 'otomax_username_123',
sign: 'your_signature_hash',
category: 'pulsa',
operator: 'telkomsel'
});
fetch(`https://api.gotopup.biz.id/api/otomax/price-list?${params}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$params = http_build_query([
'username' => 'otomax_username_123',
'sign' => 'your_signature_hash',
'category' => 'pulsa',
'operator' => 'telkomsel'
]);
$ch = curl_init('https://api.gotopup.biz.id/api/otomax/price-list?' . $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "00",
"message": "Success",
"data": [
{
"code": "TELKOMSEL5",
"name": "Pulsa Telkomsel 5.000",
"price": 5500,
"status": "active"
}
]
}
Balance Check
Check balance via Otomax
Query Parameters
| Parameter |
Type |
Required |
Description |
username |
string |
Yes |
Otomax username |
sign |
string |
Yes |
Signature hash |
Code Examples
curl "https://api.gotopup.biz.id/api/otomax/balance?username=otomax_username_123&sign=your_signature_hash"
const params = new URLSearchParams({
username: 'otomax_username_123',
sign: 'your_signature_hash'
});
fetch(`https://api.gotopup.biz.id/api/otomax/balance?${params}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$params = http_build_query([
'username' => 'otomax_username_123',
'sign' => 'your_signature_hash'
]);
$ch = curl_init('https://api.gotopup.biz.id/api/otomax/balance?' . $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Response Example
{
"status": "00",
"message": "Success",
"balance": 1000000,
"currency": "IDR"
}
Callback
Receive callback from seller's Otomax system (GoTopUp will POST to seller's callback URL)
Note: This endpoint is called by GoTopUp to your callback URL. You need to configure your callback URL in the dashboard.
Request Body Variables
| Variable |
Type |
Required |
Description |
ref_id |
string |
Yes |
Transaction reference ID |
code |
string |
No |
Product code |
customer_number |
string |
No |
Customer number |
status |
string |
Yes |
"success", "failed", or "pending" |
sn |
string |
No |
Serial number (for successful transactions) |
message |
string |
No |
Status message |
Code Examples (Your Server Receives This)
# GoTopUp will POST to your callback URL:
# POST https://your-callback-url.com/otomax
# Content-Type: application/json
#
# {
# "ref_id": "TXN-001",
# "code": "TELKOMSEL5",
# "customer_number": "081234567890",
# "status": "success",
# "sn": "1234567890123456",
# "message": "Transaksi berhasil"
# }
// Example: Express.js endpoint to receive callback
app.post('/otomax-callback', (req, res) => {
const { ref_id, code, customer_number, status, sn, message } = req.body;
// Process the callback
console.log('Received callback:', { ref_id, status, sn });
// Update your database, send notification, etc.
res.json({ status: 'received' });
});
// Example: PHP endpoint to receive callback
$data = json_decode(file_get_contents('php://input'), true);
$ref_id = $data['ref_id'];
$code = $data['code'] ?? null;
$customer_number = $data['customer_number'] ?? null;
$status = $data['status'];
$sn = $data['sn'] ?? null;
$message = $data['message'] ?? null;
// Process the callback
// Update your database, send notification, etc.
header('Content-Type: application/json');
echo json_encode(['status' => 'received']);
Response Example (Your Server Should Return)
{
"status": "received"
}
🔔 Webhook Documentation
Seller Webhooks
When a transaction is processed, GoTopUp will POST to your configured webhook URL:
Webhook URL Configuration
curl -X POST https://api.gotopup.biz.id/api/seller/api/config \
-H "Authorization: Bearer seller_api_key_123" \
-H "Content-Type: application/json" \
-d '{"webhook_url": "https://your-domain.com/webhook"}'
fetch('https://api.gotopup.biz.id/api/seller/api/config', {
method: 'POST',
headers: {
'Authorization': 'Bearer seller_api_key_123',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook_url: 'https://your-domain.com/webhook'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
$ch = curl_init('https://api.gotopup.biz.id/api/seller/api/config');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer seller_api_key_123',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'webhook_url' => 'https://your-domain.com/webhook'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Webhook Receiver Example (Your Server)
// Example: Express.js endpoint to receive webhooks
app.post('/webhook', express.json(), (req, res) => {
const { event, data, timestamp } = req.body;
// Verify webhook signature (recommended)
// const signature = req.headers['x-signature'];
// if (!verifySignature(signature, req.body)) {
// return res.status(401).send('Invalid signature');
// }
// Handle different event types
switch (event) {
case 'transaction.success':
console.log('Transaction succeeded:', data);
// Update your database, send notification, etc.
break;
case 'transaction.failed':
console.log('Transaction failed:', data);
break;
case 'settlement.completed':
console.log('Settlement completed:', data);
break;
}
res.json({ status: 'received' });
});
// Example: PHP endpoint to receive webhooks
$data = json_decode(file_get_contents('php://input'), true);
$event = $data['event'];
$webhookData = $data['data'];
$timestamp = $data['timestamp'];
// Verify webhook signature (recommended)
// $signature = $_SERVER['HTTP_X_SIGNATURE'] ?? '';
// if (!verifySignature($signature, $data)) {
// http_response_code(401);
// echo json_encode(['error' => 'Invalid signature']);
// exit;
// }
// Handle different event types
switch ($event) {
case 'transaction.success':
// Update your database, send notification, etc.
break;
case 'transaction.failed':
// Handle failed transaction
break;
case 'settlement.completed':
// Handle settlement completion
break;
}
header('Content-Type: application/json');
echo json_encode(['status' => 'received']);
Webhook Payload Example
{
"event": "transaction.success",
"data": {
"ref_id": "TXN-001",
"transaction_id": "TXN123456",
"code": "TELKOMSEL5",
"customer_number": "081234567890",
"status": "success",
"sn": "1234567890123456",
"price": 5500,
"timestamp": "2025-01-15T10:30:00Z"
},
"timestamp": "2025-01-15T10:30:00Z"
}
Webhook Events
transaction.success - Transaction completed successfully
transaction.failed - Transaction failed
transaction.pending - Transaction is being processed
settlement.completed - Settlement request completed