Transfer API
The Transfer API allows partners to manage inventory transfers between locations, including creating transfer requests, retrieving transfer details, and managing approval workflows.
Authentication
All API requests require authentication using API key and tenant identification:
- Authorization: Bearer token authentication
- X-Tenant-Id: Your tenant identifier
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
https://sandbox-api.bebaskirim.com/api/partner/v1/transfersBase URL
- Sandbox:
https://sandbox-api.bebaskirim.com - Production:
https://api.bebaskirim.com
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/partner/v1/transfers | Create new transfer |
| GET | /api/engine/v1/transfers | Get transfer list |
| GET | /api/engine/v1/transfers/:id | Get transfer detail |
| PATCH | /api/partner/v1/transfers/:id/approve | Approve transfer |
| PATCH | /api/partner/v1/transfers/:id/reject | Reject transfer |
1. Create Transfer
Create a new transfer request to move inventory between locations.
Endpoint: POST /api/partner/v1/transfers
Request Headers
- Authorization: Bearer token (required)
- X-Tenant-Id: Tenant identifier (required)
Request Body
json
{
"from_location_id": 1,
"to_location_id": 2,
"transfer_date": "2024-01-15",
"expected_arrival_date": "2024-01-17",
"reference_number": "TRF-2024-001",
"notes": "Restock inventory for high-demand location",
"items": [
{
"product_id": "PROD-2024-001",
"quantity": 50,
"notes": "Transfer half of current stock"
},
{
"product_id": "PROD-2024-002",
"quantity": 25,
"notes": "Emergency restock"
}
]
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from_location_id | integer | Yes | Source location ID |
| to_location_id | integer | Yes | Destination location ID |
| transfer_date | date | Yes | Transfer request date (YYYY-MM-DD) |
| expected_arrival_date | date | No | Expected arrival date (YYYY-MM-DD) |
| reference_number | string | No | External reference number |
| notes | string | No | Additional notes |
| items | array | Yes | Array of transfer items |
| items[].product_id | string | Yes | Product identifier |
| items[].quantity | number | Yes | Quantity to transfer |
| items[].notes | string | No | Item-specific notes |
Response
json
{
"status": "ok",
"data": {
"transfer": {
"id": "TRF-2024-001",
"transfer_number": "TRF-2024-001",
"from_location": {
"id": 1,
"code": "WH-001",
"name": "Warehouse A",
"address": "Jl. Warehouse A No. 123, Jakarta"
},
"to_location": {
"id": 2,
"code": "ST-001",
"name": "Store B",
"address": "Jl. Store B No. 456, Jakarta"
},
"transfer_date": "2024-01-15",
"expected_arrival_date": "2024-01-17",
"actual_arrival_date": null,
"reference_number": "TRF-2024-001",
"status": "pending",
"total_items": 2,
"total_quantity": 75,
"notes": "Restock inventory for high-demand location",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"created_by": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
"items": [
{
"id": 1,
"product_id": "PROD-2024-001",
"product_name": "Product A",
"sku": "SKU-001",
"quantity": 50,
"available_stock": 100,
"unit_price": 45000,
"total_value": 2250000,
"notes": "Transfer half of current stock"
},
{
"id": 2,
"product_id": "PROD-2024-002",
"product_name": "Product B",
"sku": "SKU-002",
"quantity": 25,
"available_stock": 30,
"unit_price": 75000,
"total_value": 1875000,
"notes": "Emergency restock"
}
],
"total_value": 4125000,
"approved_at": null,
"approved_by": null,
"rejected_at": null,
"rejected_by": null,
"rejection_reason": null,
"shipped_at": null,
"shipped_by": null,
"received_at": null,
"received_by": null
}
},
"errors": null,
"request_id": "request-id"
}Example Request
bash
curl -X POST https://sandbox-api.bebaskirim.com/api/partner/v1/transfers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"from_location_id": 1,
"to_location_id": 2,
"transfer_date": "2024-01-15",
"expected_arrival_date": "2024-01-17",
"reference_number": "TRF-2024-001",
"notes": "Restock inventory for high-demand location",
"items": [
{
"product_id": "PROD-2024-001",
"quantity": 50,
"notes": "Transfer half of current stock"
},
{
"product_id": "PROD-2024-002",
"quantity": 25,
"notes": "Emergency restock"
}
]
}'2. Get Transfer List
Retrieve a paginated list of transfers with filtering options.
Endpoint: GET /api/engine/v1/transfers
Request Headers
- Authorization: Bearer token (required)
- X-Tenant-Id: Tenant identifier (required)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number (default: 1) |
| per_page | integer | No | Items per page (default: 10, max: 100) |
| status | string | No | Filter by status: pending, approved, rejected, in_transit, completed |
| from_location_id | integer | No | Filter by source location ID |
| to_location_id | integer | No | Filter by destination location ID |
| transfer_date_from | date | No | Filter transfers from date (YYYY-MM-DD) |
| transfer_date_to | date | No | Filter transfers to date (YYYY-MM-DD) |
Response
json
{
"status": "ok",
"data": {
"transfers": [
{
"id": "TRF-2024-001",
"transfer_number": "TRF-2024-001",
"from_location": {
"id": 1,
"code": "WH-001",
"name": "Warehouse A"
},
"to_location": {
"id": 2,
"code": "ST-001",
"name": "Store B"
},
"transfer_date": "2024-01-15",
"expected_arrival_date": "2024-01-17",
"reference_number": "TRF-2024-001",
"status": "pending",
"total_items": 2,
"total_quantity": 75,
"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"
}Example Request
bash
curl -X GET "https://sandbox-api.bebaskirim.com/api/engine/v1/transfers?page=1&per_page=10&status=pending&from_location_id=1&to_location_id=2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID"3. Get Transfer Detail
Retrieve detailed information about a specific transfer request.
Endpoint: GET /api/engine/v1/transfers/:id
Request Headers
- Authorization: Bearer token (required)
- X-Tenant-Id: Tenant identifier (required)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Transfer ID |
Response
json
{
"status": "ok",
"data": {
"transfer": {
"id": "TRF-2024-001",
"transfer_number": "TRF-2024-001",
"from_location": {
"id": 1,
"code": "WH-001",
"name": "Warehouse A",
"address": "Jl. Warehouse A No. 123, Jakarta",
"contact_person": "John Doe",
"phone": "+62-21-12345678"
},
"to_location": {
"id": 2,
"code": "ST-001",
"name": "Store B",
"address": "Jl. Store B No. 456, Jakarta",
"contact_person": "Jane Smith",
"phone": "+62-21-87654321"
},
"transfer_date": "2024-01-15",
"expected_arrival_date": "2024-01-17",
"actual_arrival_date": null,
"reference_number": "TRF-2024-001",
"status": "pending",
"notes": "Restock inventory for high-demand location",
"items": [
{
"id": 1,
"product_id": "PROD-2024-001",
"product_name": "Product A",
"sku": "SKU-001",
"quantity": 50,
"available_stock": 100,
"unit_price": 45000,
"total_value": 2250000,
"notes": "Transfer half of current stock"
},
{
"id": 2,
"product_id": "PROD-2024-002",
"product_name": "Product B",
"sku": "SKU-002",
"quantity": 25,
"available_stock": 30,
"unit_price": 75000,
"total_value": 1875000,
"notes": "Emergency restock"
}
],
"total_items": 2,
"total_quantity": 75,
"total_value": 4125000,
"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,
"shipped_at": null,
"shipped_by": null,
"received_at": null,
"received_by": null
}
},
"errors": null,
"request_id": "request-id"
}Example Request
bash
curl -X GET https://sandbox-api.bebaskirim.com/api/engine/v1/transfers/TRF-2024-001 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID"4. Approve Transfer
Approve a pending transfer request.
Endpoint: PATCH /api/partner/v1/transfers/:id/approve
Request Headers
- Authorization: Bearer token (required)
- X-Tenant-Id: Tenant identifier (required)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Transfer ID |
Request Body
json
{}Response
json
{
"status": "ok",
"data": {
"transfer": {
"id": "TRF-2024-001",
"transfer_number": "TRF-2024-001",
"status": "approved",
"approved_at": "2024-01-15T14:30:00Z",
"approved_by": {
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com"
}
}
},
"errors": null,
"request_id": "request-id"
}Example Request
bash
curl -X PATCH https://sandbox-api.bebaskirim.com/api/partner/v1/transfers/TRF-2024-001/approve \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{}'5. Reject Transfer
Reject a pending transfer request.
Endpoint: PATCH /api/partner/v1/transfers/:id/reject
Request Headers
- Authorization: Bearer token (required)
- X-Tenant-Id: Tenant identifier (required)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Transfer ID |
Request Body
json
{
"reason": "Insufficient stock at source location"
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reason | string | Yes | Reason for rejection |
Response
json
{
"status": "ok",
"data": {
"transfer": {
"id": "TRF-2024-001",
"transfer_number": "TRF-2024-001",
"status": "rejected",
"rejected_at": "2024-01-15T14:30:00Z",
"rejected_by": {
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com"
},
"rejection_reason": "Insufficient stock at source location"
}
},
"errors": null,
"request_id": "request-id"
}Example Request
bash
curl -X PATCH https://sandbox-api.bebaskirim.com/api/partner/v1/transfers/TRF-2024-001/reject \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Tenant-Id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"reason": "Insufficient stock at source location"
}'Status Codes
| Status | Description |
|---|---|
| pending | Transfer request created, awaiting approval |
| approved | Transfer request approved |
| rejected | Transfer request rejected |
| in_transit | Items have been shipped |
| completed | Transfer has been received at destination |