Endpoint βοΈ
π§± Base URL
All requests are made through the following base URLs:
| Environment | Base URL |
|---|---|
Sandbox | |
Production |
π‘ Use the Sandbox environment for testing purposes before switching to Production.
π Authorization
Every request to the Payment API must include an API Key for authentication.
You can find your API Key in the Merchant Dashboard after registration.
Example Header:
-H "x-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
β οΈ Never expose your API key in client-side code or public repositories.
βοΈ Core Endpoints
Here are the main endpoints to get you started:
| Endpoint | Method | Description |
|---|---|---|
/methods | GET | Retrieve payment methods and Banks Code |
/create | POST | Create a new payment transaction |
/status/{id} | GET | Retrieve payment status by transaction ID |
/callback | POST | Receive payment notifications from the gateway |
π Create Your First Transaction
Hereβs an example of how to create a new transaction:
curl --location 'https://api-sandbox.collaborator.komerce.id/user/api/v1/user/payment/create' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"order_id": (required),
"payment_type": "bank_transfer",
"channel_code": string (required, valid bank code),
"amount": integer (required, min 10.000),
"customer": {
"name": string (required),
"email": string (required, valid email),
"phone": string (required)
},
"items": [
{
"name": string (required),
"quantity": integer (required),
"price": integer (required)
}
],
"expiry_duration": integer (optional, minimal 3600 seconds),
"callback_url": string (optional, valid URL),
"callback_api_key": (required if callback_url is filled, generate by user)
}'
β Testing Your Integration
You can test your setup using sandbox mode. Payments in sandbox mode are simulated β no real charges occur.