Rates API
Overview
The Rates API provides shipping rate calculation and courier management capabilities for your e-commerce operations. It allows you to check shipping rates for different couriers and service types based on origin and destination addresses, as well as retrieve a list of available logistics providers and services configured for your tenant.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/partner/v1/rates | Check shipping rates |
1. Check Estimated Shipping Rates
Calculate shipping rates for available tenants couriers and service types based on origin and destination addresses.
Endpoint
POST /api/partner/v1/ratesAuthentication
All API requests require authentication using API key in the Authorization header:
Authorization: YOUR_API_KEY
X-Tenant-IDRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| origin_code | string | Yes | Origin code |
| destination_code | string | Yes | Destination code |
| weight | number | Yes | Total weight in grams |
| length | number | No | Package length in cm |
| width | number | No | Package width in cm |
| height | number | No | Package height in cm |
| value | number | No | Package value for insurance |
Response
Success Response (200 OK)
json
{
"status": "ok",
"data": [
{
"pattern": "JNT - Reguler",
"provider_code": "CR_JNT",
"provider_name": "JNT",
"service_type": "Reguler",
"discount_percentage": 10,
"cod_percentage": 2,
"insurance_percentage": 1,
"return_percentage": 5,
"handling_percentage": 3,
"is_default": true,
"is_active": true,
"price": 1800,
"public_price": 2000,
"is_cod": false,
"etd_min": null,
"etd_max": null,
"minimum_weight": null
},
{
"pattern": "JNE - Reguler",
"provider_code": "CR_JNE",
"provider_name": "JNE",
"service_type": "Reguler",
"discount_percentage": 10,
"cod_percentage": 2,
"insurance_percentage": 1,
"return_percentage": 5,
"handling_percentage": 3,
"is_default": true,
"is_active": true,
"price": 10800,
"public_price": 12000,
"is_cod": true,
"etd_min": 1,
"etd_max": 1,
"minimum_weight": null
}
],
"errors": null,
"request_id": "request-id"
}Example Request
bash
curl -X POST https://sandbox-api.bebaskirim.com/api/partner/v1/rates \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"origin_code": "31.72.06.1002",
"destination_code": "32.73.17.1002",
"weight": 1000,
"length": 20,
"width": 15,
"height": 10,
"value": 100000
}'Courier Service Codes
Supported Couriers
Please check the tenant specific logistic that currently active
Rate Limits
- Check Shipping Rates: 60 requests per minute
Best Practices
Rate Calculation
- Cache rate results for at least 5 minutes to reduce API calls
- Include package dimensions for more accurate volumetric calculations
Address Validation
- Always validate origin and destination codes before making rate requests
- Use Area API to validate addresses and get accurate origin and destination codes