Download OpenAPI specification:
Secure REST API for authorized third-party applications to create and manage sales orders. Integrations are authenticated via JWT bearer tokens and RSA request signatures.
The Sales Order API provides a secure integration interface for authorized third-party applications to create and manage sales orders programmatically.
This API is intended for external partner systems that need to submit sales orders into our platform. All requests are authenticated and validated to ensure data integrity and secure communication.
The API acts as a secure gateway between external partner applications and our order management system. Partner credentials are validated on every request, and payload integrity is enforced through JWT authentication and RSA signature verification.
Follow these steps to begin integration:
client_id and client_secret from our integration team/api/v1/auth/login to obtain a JWT access tokenThis API uses a two-layer authentication model to protect all integration endpoints:
X-SIGNATURE headerBefore calling protected endpoints, obtain a JWT access token by sending your client_id and client_secret to /api/v1/auth/login.
Request Example:
POST /api/v1/auth/login
Content-Type: application/json
{
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expired_at": 1704067200
}
Access tokens are valid for 12 hours. When a token expires, renew it using /api/v1/auth/refresh without re-submitting your client credentials.
Sales order requests require an X-SIGNATURE header in addition to the JWT bearer token. The signature confirms that the request originated from the registered partner and has not been tampered with.
X-SIGNATURE = SHA256withRSA(PrivateKey, StringToSign)
StringToSign = client_id + "|" + X-TIMESTAMP
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAomV+Vm1xlRXanmh108Ku
sls7SSKec0oCejtc9QGObpd4RnQ+7gihm2k6etnSNP7b+XrpY+fBkiQNaBInii9M
10kW9Bhf/M9GH/edL3IqnzDNSi7tcoQgnO7h8xmzLNWHTjtR6bkrsdBS5dry6hto
taF5KXomuoYgztCdGDOa0W20aeLzYSXIoW7s/Ay5yIXt0xaXTll3/bmezleguFPn
wQZq5EqZFWlUZvutDi+f2l9rTRY0Fb64y+VAf+mnIbEovGqsPEeF/p97YWxcY7CW
m8NsT0lwBVOtkmEl967Brz5yvEObF5bJgVodi6mNVsN1ki0MCitIhYO8shcE7eUi
lQIDAQAB
-----END PUBLIC KEY-----
Include the following headers when creating a sales order:
Required headers
Authorization: Bearer <JWT_TOKEN>
X-CLIENT-ID: <your-client-id>
X-TIMESTAMP: <current-unix-timestamp>
X-SIGNATURE: <generated-signature>
Content-Type: application/json
client_id embedded in the JWT must match the X-CLIENT-ID header valueX-SIGNATURE is verified against your registered public keyX-TIMESTAMP must match the timestamp used when generating the signatureTo renew an expired access token without re-authenticating:
Request Example:
POST /api/v1/auth/refresh
Content-Type: application/json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expired_at": 1704110400
}
client_secret or RSA private key in source code or logs| client_id required | string Client ID |
| client_secret required | string Client Secret |
{- "client_id": "partner-client-001",
- "client_secret": "secret-key-123"
}{- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "expired_at": 1704067200
}| token required | string JWT Token |
{- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}{- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "expired_at": 1704067200
}Endpoints for creating and managing sales orders submitted by authorized partner applications.
| customer_code required | string Customer code |
| site_code required | string Site code |
| sales_name required | string Sales person name |
| address required | string Delivery address |
| purchase_order_no | string or null Purchase order number from the external partner system |
required | Array of objects (ProductDto) List of products |
{- "customer_code": "CUST-001",
- "site_code": "SITE-001",
- "sales_name": "John Doe",
- "address": "Jl. Sudirman No. 1, Jakarta",
- "purchase_order_no": "PO-2025-00001",
- "products": [
- {
- "product_code": "PROD-001",
- "quantity": 10
}
]
}{- "message": "Sales order created successfully",
- "data": {
- "code": "SO-20250101-00001",
- "status": "DRAFT",
- "created_at": "2025-01-01T00:00:00.000Z"
}
}