Adjustment API
Overview
The Adjustment API allows partners to manage inventory adjustments for stock corrections, including creating adjustments, retrieving adjustment details, and managing approval workflows.
Base URL
- Production:
https://open.bebaskirim.com/api/partner/v1
Authentication
All API requests require authentication using API key and tenant identification:
- Authorization: API key authentication
- X-Tenant-Id: Your tenant identifier
curl -H "Authorization: YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
https://open.bebaskirim.com/api/partner/v1/adjustmentsEndpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/partner/v1/adjustments | Create new adjustment |
| GET | /api/engine/v1/adjustments | Get adjustment list |
| GET | /api/engine/v1/adjustments/:id | Get adjustment detail |
| PATCH | /api/partner/v1/adjustments/:id/approve | Approve adjustment |
| PATCH | /api/partner/v1/adjustments/:id/reject | Reject adjustment |
1. Create Adjustment
Create a new inventory adjustment for stock corrections.
Endpoint: POST /api/partner/v1/adjustments
Headers:
Authorization: {token}(required)X-Tenant-Id: {tenant_id}(required)
Request Body:
{
"location_id": 1,
"type": "increase",
"stock_source": "good",
"reason": "Stock correction",
"items": [
{
"product_id": "PROD-2024-001",
"quantity": 10,
"unit_cost": 50000,
"notes": "Additional stock found"
}
]
}Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| location_id | integer | Yes | Location ID for adjustment |
| type | string | Yes | Adjustment type: increase or decrease |
| stock_source | string | Yes | Stock source: good or damaged |
| reason | string | Yes | Reason for adjustment |
| items | array | Yes | Array of adjustment items |
| items[].product_id | string | Yes | Product identifier |
| items[].quantity | number | Yes | Quantity to adjust |
| items[].unit_cost | number | Yes | Unit cost per item |
| items[].notes | string | No | Additional notes for item |
Example Request:
curl -X POST https://sandbox-api.bebaskirim.com/api/partner/v1/adjustments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"location_id": 1,
"type": "increase",
"reason": "Stock correction",
"items": [
{
"product_id": "PROD-2024-001",
"quantity": 10,
"unit_cost": 50000,
"notes": "Additional stock found"
}
]
}'Example Response:
{
"status": "ok",
"data": {
"adjustment": {
"id": "ADJ-2024-001",
"adjustment_number": "ADJ-2024-001",
"location": {
"id": 1,
"code": "WH-001",
"name": "Warehouse A",
"address": "Jl. Warehouse No. 456, Jakarta"
},
"type": "increase",
"stock_source": "good",
"reason": "Stock correction",
"status": "pending",
"total_amount": 500000,
"item_count": 1,
"items": [
{
"id": 1,
"product_id": "PROD-2024-001",
"product_name": "Product A",
"sku": "SKU-001",
"quantity": 10,
"unit_cost": 50000,
"total_cost": 500000,
"notes": "Additional stock found"
}
],
"created_by": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"approved_at": null,
"approved_by": null,
"rejected_at": null,
"rejected_by": null,
"rejection_reason": null
}
},
"errors": null,
"request_id": "request-id"
}2. Get Adjustment List
Retrieve a paginated list of adjustments with filtering options.
Endpoint: GET /api/engine/v1/adjustments
Headers:
Authorization: {token}(required)X-Tenant-Id: {tenant_id}(required)
Query Parameters:
page(integer, optional): Page number for pagination (default: 1)per_page(integer, optional): Number of items per page (default: 10, max: 100)status(string, optional): Filter by status:pending,approved,rejectedlocation_id(integer, optional): Filter by location IDtype(string, optional): Filter by type:increase,decrease
Example Request:
curl -X GET "https://sandbox-api.bebaskirim.com/api/engine/v1/adjustments?page=1&per_page=10&status=pending&location_id=1&type=increase" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID"Example Response:
{
"status": "ok",
"data": {
"adjustments": [
{
"id": "ADJ-2024-001",
"adjustment_number": "ADJ-2024-001",
"location": {
"id": 1,
"code": "WH-001",
"name": "Warehouse A"
},
"type": "increase",
"reason": "Stock correction",
"status": "pending",
"total_amount": 500000,
"item_count": 1,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"current_page": 1,
"per_page": 10,
"total": 25,
"last_page": 3
}
},
"errors": null,
"request_id": "request-id"
}3. Get Adjustment Detail
Retrieve detailed information about a specific adjustment.
Endpoint: GET /api/engine/v1/adjustments/:id
Headers:
Authorization: {token}(required)X-Tenant-Id: {tenant_id}(required)
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Adjustment ID |
Example Request:
curl -X GET https://sandbox-api.bebaskirim.com/api/engine/v1/adjustments/ADJ-2024-001 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID"Example Response:
{
"status": "ok",
"data": {
"adjustment": {
"id": "ADJ-2024-001",
"adjustment_number": "ADJ-2024-001",
"location": {
"id": 1,
"code": "WH-001",
"name": "Warehouse A",
"address": "Jl. Warehouse No. 456, Jakarta"
},
"type": "increase",
"stock_source": "good",
"reason": "Stock correction",
"status": "pending",
"total_amount": 500000,
"items": [
{
"id": 1,
"product_id": "PROD-2024-001",
"product_name": "Product A",
"sku": "SKU-001",
"quantity": 10,
"unit_cost": 50000,
"total_cost": 500000,
"notes": "Additional stock found",
"current_stock": 100
}
],
"created_by": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"approved_at": null,
"approved_by": null,
"rejected_at": null,
"rejected_by": null,
"rejection_reason": null
}
},
"errors": null,
"request_id": "request-id"
}4. Approve Adjustment
Approve a pending adjustment to apply the stock changes.
Endpoint: PATCH /api/partner/v1/adjustments/:id/approve
Headers:
Authorization: {token}(required)X-Tenant-Id: {tenant_id}(required)
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Adjustment ID |
Request Body:
{}Example Request:
curl -X POST https://sandbox-api.bebaskirim.com/api/partner/v1/adjustments/ADJ-2024-001/approve \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{}'Example Response:
{
"status": "ok",
"data": null,
"errors": null,
"request_id": "request-id"
}5. Reject Adjustment
Reject a pending adjustment.
Endpoint: PATCH /api/partner/v1/adjustments/:id/reject
Headers:
Authorization: {token}(required)X-Tenant-Id: {tenant_id}(required)
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Adjustment ID |
Request Body:
{
"reason": "Insufficient documentation provided"
}Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| reason | string | Yes | Reason for rejection |
Example Request:
curl -X POST https://sandbox-api.bebaskirim.com/api/partner/v1/adjustments/ADJ-2024-001/reject \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"reason": "Insufficient documentation provided"
}'Example Response:
{
"status": "ok",
"data": null,
"errors": null,
"request_id": "request-id"
}Status Codes
| Status | Description |
|---|---|
| pending | Adjustment created, awaiting approval |
| approved | Adjustment approved and stock updated |
| rejected | Adjustment rejected |
Adjustment Types
| Type | Description |
|---|---|
| increase | Stock increase adjustment |
| decrease | Stock decrease adjustment |