Documentationv6.2

Create Instant Package

Create an instant / same-day delivery order using instant courier services, with support for KA Credit payment, PIN validation, nested destination data, vehicle type, insurance type, and multi-item packages.

POST

Supported Couriers

Courier code is sent through the service field inside each package. Examples:

  • gosend
  • grab_express
  • borzo

Use the courier code and service_type returned by the pricing/check tariff endpoint.

v6.2 Highlights

  • KA Credit payment support through payment_method: "credit"
  • PIN validation through pin when using KA Credit
  • Nested recipient data through packages[].destination
  • Vehicle selection through vehicle
  • Insurance type support through insurance_type
  • Multi-item package support through items

Important KA Credit Note

When using payment_method: "credit", ensure the KA Credit balance is at least equal to the shipping_cost of the package. If the balance is insufficient, the request may be rejected before courier booking is created.


Authentication

All requests must include a bearer token.

Authorization: Bearer <token>
Content-Type: application/json

Order Flow

sequenceDiagram
participant c as Client
participant kaj as KiriminAja
participant cr as Instant Courier

c->>kaj: Create Instant Package
Note over c,kaj: payment_method: "credit" requires PIN and sufficient balance
kaj->>kaj: Validate sender, destination, payment, PIN, and package
kaj->>kaj: Validate service, service_type, vehicle, and shipping_cost
kaj->>cr: Create instant courier booking
cr-->>kaj: Booking result / tracking data
kaj-->>c: Response order result

Flow Summary

  1. Client sends pickup information and package list.
  2. KiriminAja validates sender address and pickup coordinate.
  3. If payment_method is credit, KiriminAja validates pin and KA Credit balance.
  4. KiriminAja validates destination object, instant courier service, vehicle type, and shipping cost.
  5. KiriminAja creates an instant booking with the selected courier.
  6. Client receives the order creation result.

Request Payload

Top-Level Payload: Pickup / Sender Details

FieldTypeNullableDescription
addressstringNoSender / pickup full address
phonestringNoSender phone number. Use 08... or 62... format
latitudenumericNoSender pickup latitude
longitudenumericNoSender pickup longitude
namestringNoSender name
zipcodestringYesSender postal code
payment_methodenum: credit, cashYesPayment method. Use credit for KA Credit
pinstring, 6 digitsConditionalRequired when payment_method is credit
packagesarray, min 1 objectNoList of package objects to be created

Package Object

FieldTypeNullableDescription
order_idstringNoPartner-side order ID. Must be unique per order
destinationobjectNoRecipient destination object
insurance_typeenumYesCurrently instant can't support insurance allowance
shipping_costintegerNoShipping cost returned from pricing/check tariff endpoint
servicestringNoInstant courier code, for example gosend
service_typestringNoInstant service type, for example instant
package_type_idintegerNoPackage type ID. Example: 7
vehiclestringNoVehicle type. Example: motor
itemsarray, min 1 objectNoPackage item details

Destination Object

FieldTypeNullableDescription
namestringNoRecipient name
phonestringNoRecipient phone number
latitudenumericNoRecipient latitude
longitudenumericNoRecipient longitude
addressstringNoRecipient full address
address_notestringYesAdditional recipient address note

Items Object

FieldTypeNullableDescription
namestringNoItem name
descriptionstringYesItem description
priceintegerNoItem price in Rupiah
weightintegerNoItem weight in grams

Request Body Example

{
  "address": "House of KKK",
  "phone": "628126870021",
  "latitude": -6.229512799999999,
  "longitude": 106.9059138,
  "name": "House of kk",
  "zipcode": "13430",
  "payment_method": "credit",
  "pin": "123456",
  "packages": [
    {
      "order_id": "ADDI-1000000041",
      "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"
      },
      "insurance_type": "basic",
      "shipping_cost": 30500,
      "service": "gosend",
      "service_type": "instant",
      "package_type_id": 7,
      "vehicle": "motor",
      "items": [
        {
          "name": "Smartphone",
          "description": "Samsung Galaxy S24 Ultra",
          "price": 5000000,
          "weight": 750
        }
      ]
    }
  ]
}