Documentationv6.2

Create Instant Package

Place an instant (same-day) delivery order via GoSend, GrabExpress, or Borzo with KA Credit payment support.

POST

This endpoint is used to create instant / same-day shipping orders using GoSend, GrabExpress, or Borzo couriers, and to receive the AWB number. Version v6.2 introduces KA Credit payment support, a destination structure as a nested object, and multi-item support with metadata.

KA Credit Note: When using payment_method: "credit", ensure your KA Credit balance is at least equal to the shipping_cost of the package. If the balance is insufficient, the request will be rejected before the AWB is generated.

Order Flow (Sequence)

sequenceDiagram
participant c as Client
participant kaj as KiriminAja
participant pg as Payment
participant pl as 3PL (GoSend / Grab / Borzo)

c->>kaj: Create Instant Package
Note over c,kaj: payment_method: "credit"<br/>memerlukan saldo cukup
kaj->>kaj: Validasi PIN & saldo KA Credit
kaj-->>pg: Create Non-COD Payment (jika non-credit)
pg-->>kaj: Confirm Payment
kaj->>pl: Create Booking
pl->>kaj: AWB & Polyline
kaj->>c: Response AWB + Tracking
pl-->>kaj: Driver Assigned (async)
kaj-->>c: Webhook Driver Update

Request Parameters

Top-Level Payload (Sender Details)

FieldData TypeNullableDescription
addressstring (min:10, max:200)falsePickup address
address_notestring (max:100)trueAdditional notes on the pickup address (e.g., "In front of Oren's House")
namestring (min:1, max:50)falseSender's name
phonestring (min:9, max:13)falseSender's phone number. Must be in the format 08... or 62...
latitudenumericfalseLatitude of pickup location
longitudenumericfalseLongitude of pickup location
zipcodestring (max:5)truePickup ZIP code
payment_methodenum (credit, va, cash)truev6.2 NEW Payment method. Enter "credit" for KA Credit. Default: va
pinstring (6 digits)truev6.2 NEW KA Credit account PIN. Required when payment_method = "credit"
packagesarray (min: 1 object)falseSee Package Object structure

Package Object

FieldData TypeNullableDescription
order_idstring (max:30)falsePartner-side order ID. Must include a prefix
destinationobjectfalseRecipient details. See the Destination Object structure
serviceenum (gosend, grab_express, borzo)falseInstant courier code
service_typestringfalseService type from the pricing response (e.g., instant, same_day, bike, car)
vehicleenum (motorcycle, car)falseCourier vehicle. Validated against each courier's supported capacity
package_type_idintegerfalsePackage type (default 7)
shipping_costintegerfalseShipping rate from the pricing response. This amount will be debited from the KA Credit
insurance_typeenum (none, basic, premium)truev6.2 NEW Insurance type. basic follows the courier's default coverage; premium is optional with an additional fee. Default: none
descriptionstring (max:255)trueGeneral package description / notes for the carrier
itemsarray (min:1 object)falsev6.2 NEW List of items in the package. See Items Object

Destination Object

FieldData TypeNullableDescription
namestring (max:50)falseRecipient's name
phonestring (min:9, max:13)falseRecipient's phone number
latitudenumericfalseLatitude of delivery location
longitudenumericfalseLongitude of the delivery point
addressstring (min:10, max:255)falseRecipient's full address
address_notestring (max:100)trueRecipient's address note (e.g., "Building A, 5th Floor")

Items Object

FieldData TypeNullableDescription
namestring (max:100)falseItem name
descriptionstring (max:255)trueItem description
priceinteger (min:1000)falseItem price per unit (Rupiah). Used as the basis for insurance coverage (see insurance notes for each courier)
weightinteger (min:1)falseWeight per unit in grams
qtyinteger (min:1)trueQuantity. Default 1
metadataobjecttrueFree-form metadata from the partner. See Metadata Object

Metadata Object (opsional)

FieldData TypeNullableDescription
skustring (max:50)trueProduct SKU from the partner
variant_labelstring (max:100)trueProduct variant label

Insurance Note: Coverage limits and insurance terms are determined by the selected courier. For details (coverage limits, exclusion list, claim window), see the internal document Instant Courier — Shipping Insurance Scheme.

Request Example (KA Credit)

{
  "address": "House of KKK",
  "address_note": "Depan Rumah Oren",
  "name": "House of kk",
  "phone": "628126870021",
  "latitude": -6.229512799999999,
  "longitude": 106.9059138,
  "zipcode": "13430",
  "payment_method": "credit",
  "pin": "123456",
  "packages": [
    {
      "order_id": "FEB-2374823799",
      "destination": {
        "name": "John Doe",
        "phone": "081234567890",
        "latitude": -6.2088,
        "longitude": 106.8456,
        "address": "Jl. Sudirman No. 123, Jakarta Pusat",
        "address_note": "Gedung A Lantai 5"
      },
      "service": "gosend",
      "service_type": "instant",
      "vehicle": "motor",
      "package_type_id": 7,
      "shipping_cost": 30500,
      "insurance_type": "basic",
      "description": "ini desc",
      "items": [
        {
          "name": "Smartphone",
          "description": "Samsung Galaxy S24 Ultra",
          "price": 5000000,
          "weight": 80,
          "qty": 2,
          "metadata": {
            "sku": "xx-1",
            "variant_label": "x-1-2"
          }
        }
      ]
    }
  ]
}

Success Response

{
  "status": true,
  "text": "success",
  "code": 0,
  "method": "instant_request_pickup",
  "result": {
    "payment": {
      "payment_id": "PID-1736406074",
      "payment_method": "credit",
      "amount": 30500,
      "credit_balance_after": 1969500,
      "status_code": "Pembayaran berhasil",
      "qr_content": null,
      "pay_time": "2026-06-25 10:01:14"
    },
    "packages": [
      {
        "awb": "GK-11-3177494",
        "order_id": "FEB-2374823799",
        "service": "gosend",
        "service_type": "instant",
        "vehicle": "motor",
        "insurance_type": "basic",
        "status": 105,
        "live_track_url": null,
        "poly_line": "db}n@{`l`TyAYp@yDhAaIt@yEd@wBTwAx@{FbAaGRgBf@_CjA}H?IoMoBeEi@...",
        "origin": {
          "name": "House of kk",
          "address": "House of KKK",
          "phone": "628126870021",
          "lat_long": "-6.2295127999999,106.9059138"
        },
        "destination": {
          "name": "John Doe",
          "address": "Jl. Sudirman No. 123, Jakarta Pusat",
          "phone": "081234567890",
          "lat_long": "-6.2088,106.8456"
        },
        "driver": {
          "name": null,
          "phone": null,
          "image": null
        }
      }
    ]
  }
}

Key Response Fields

FieldData TypeDescription
statusbooleantrue if successful
result.payment.payment_idstringUnique payment ID (e.g., PID-1736406074)
result.payment.payment_methodenumPayment method used
result.payment.amountintegerAmount charged, equal to shipping_cost
result.payment.credit_balance_afterintegerv6.2 NEW Remaining KA Credit balance after deduction. Appears only when payment_method = "credit"
result.payment.status_codestringPayment status (e.g., "Payment successful")
result.payment.qr_contentstring | nullQR code content for non-credit payments. null for KA Credit
result.payment.pay_timestring | nullTime the payment was successful
result.packages[].awbstringAWB number from the courier (e.g., GK-11-3177494 for GoSend)
result.packages[].order_idstringEchoes the order_id from the request
result.packages[].statusintegerNumeric order status code
result.packages[].insurance_typeenumEchoes the active insurance type for this package
result.packages[].poly_linestringEncoded polyline of the route to be displayed on the map
result.packages[].live_track_urlstring | nullLive tracking URL. null until a driver is assigned
result.packages[].driverobjectDriver details. All fields are null until assignment is complete

Error Response

Saldo KA Credit tidak mencukupi

{
  "status": false,
  "code": 4002,
  "text": "Saldo KA Credit tidak mencukupi. Saldo saat ini Rp10.000. Total kebutuhan Rp30.500.",
  "method": "instant_request_pickup"
}

PIN tidak valid

{
  "status": false,
  "code": 4001,
  "text": "PIN KA Credit tidak valid.",
  "method": "instant_request_pickup"
}

Item melebihi cap asuransi kurir

{
  "status": false,
  "code": 4101,
  "text": "Total nilai barang melebihi cap pertanggungan untuk service grab_express tipe car (Rp3.000.000).",
  "method": "instant_request_pickup"
}

Validasi field umum

{
  "status": false,
  "code": 422,
  "text": "The destination.latitude field is required.",
  "method": "instant_request_pickup"
}