Skip to content

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/transfers

Base URL

  • Sandbox: https://sandbox-api.bebaskirim.com
  • Production: https://api.bebaskirim.com

Endpoints

MethodEndpointDescription
POST/api/partner/v1/transfersCreate new transfer
GET/api/engine/v1/transfersGet transfer list
GET/api/engine/v1/transfers/:idGet transfer detail
PATCH/api/partner/v1/transfers/:id/approveApprove transfer
PATCH/api/partner/v1/transfers/:id/rejectReject 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

ParameterTypeRequiredDescription
from_location_idintegerYesSource location ID
to_location_idintegerYesDestination location ID
transfer_datedateYesTransfer request date (YYYY-MM-DD)
expected_arrival_datedateNoExpected arrival date (YYYY-MM-DD)
reference_numberstringNoExternal reference number
notesstringNoAdditional notes
itemsarrayYesArray of transfer items
items[].product_idstringYesProduct identifier
items[].quantitynumberYesQuantity to transfer
items[].notesstringNoItem-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

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
per_pageintegerNoItems per page (default: 10, max: 100)
statusstringNoFilter by status: pending, approved, rejected, in_transit, completed
from_location_idintegerNoFilter by source location ID
to_location_idintegerNoFilter by destination location ID
transfer_date_fromdateNoFilter transfers from date (YYYY-MM-DD)
transfer_date_todateNoFilter 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

ParameterTypeRequiredDescription
idstringYesTransfer 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

ParameterTypeRequiredDescription
idstringYesTransfer 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

ParameterTypeRequiredDescription
idstringYesTransfer ID

Request Body

json
{
  "reason": "Insufficient stock at source location"
}

Request Parameters

ParameterTypeRequiredDescription
reasonstringYesReason 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

StatusDescription
pendingTransfer request created, awaiting approval
approvedTransfer request approved
rejectedTransfer request rejected
in_transitItems have been shipped
completedTransfer has been received at destination