🛍️Order

All about order service

Store order

Create data order

BODY (raw)

  • order_date: create date the order was created

  • brand_name: brand or shop name

  • shipper_name: name of the order sender

  • shipper_phone: order sender's telephone number

  • shipper_destination_id: id of destination from endpoint destination

  • shipper_address: address of the sender

  • shipper_email: email address of the sender

  • receiver_name: the name of the package recipient

  • receiver_phone: the phone number of the package recipient

  • receiver_destination_id: id of destination from endpoint destination

  • receiver_address: the address of the package recipient

  • shipping: Support expedition JNE/SICEPAT/SAP/IDEXPRESS/JNT/NINJA

  • shipping_type: Support REG19, SIUNT, STD, GOKIL, IDlite, Idtruck, JTR18, UDRREG, DRGREG, JTR23, REG23, EZ, REGULER, Standard, JNEFlat.

  • payment_method: Support BANK TRANSFER/COD

  • shipping_cost: Shipping cost for goods

  • shipping_cashback: Shipping cost cashback

  • service_fee: Service administration fee

  • additional_cost: Additional shipping cost (optional)

  • grand_total: Total cost shipping

  • cod_value: Total price cod

  • insurance_value: Total insurance fee

  • order_details: Array of object below this

[
  {
    product_name: "HP Iphone 200000",
    product_variant_name: "HP Iphone 30 Pro",
    product_price: 100000,
    product_width: 1,
    product_height: 0,
    product_weight: 0,
    product_length: 0,
    qty: 1,
    subtotal: 100000,
  },
];

POST /order/api/v1/orders/store

var myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

var raw = JSON.stringify({
  order_date: "2024-05-29 23:59:59",
  brand_name: "Komship",
  shipper_name: "Toko Official Komship",
  shipper_phone: "6281234567689",
  shipper_destination_id: 17588,
  shipper_address: "order address detail",
  shipper_email: "test@gmail.com",
  receiver_name: "Buyer A",
  receiver_phone: "6281209876543",
  receiver_destination_id: 17589,
  receiver_address: "order destination address detail",
  shipping: "JNT",
  shipping_type: "EZ",
  payment_method: "COD",
  shipping_cost: 22000,
  shipping_cashback: 10000,
  service_fee: 2500,
  additional_cost: 1000,
  grand_total: 317000,
  cod_value: 317000,
  insurance_value: 1000,
  order_details: [
    {
      product_name: "Komship package",
      product_variant_name: "Komship variant product",
      product_price: 500000,
      product_width: 5,
      product_height: 2,
      product_weight: 5100,
      product_length: 20,
      qty: 1,
      subtotal: 500000,
    },
  ],
});

var requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow",
};

fetch(
  "https://api.collaborator.komerce.my.id/order/api/v1/orders/store",
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

The value of insurance_value can refer to the following example:

For example, a partner adds an order with a total product_price = IDR 1,000,000 from sum of all product in one order and shipping_costs = IDR 25,000, then the transaction value = IDR 1,025,000 using JNE. Based on the table below, the value for JNE is (0.2% x Goods Value) + IDR 5,000. Calculation: (0.2% x IDR 1,000,000) + IDR 5,000 = IDR 2,000 + IDR 5,000 = IDR 7,000. So, the insurance_value that must be paid by the partner = IDR 7,000.

Insurance costs will cut into the net_profit earned by the partner. If insurance costs will be charged to the buyer, then add a value to additional_costs in the same amount as insurance_value

Cancel order

Cancel the order that has been made

BODY(raw)

  • order_no: number of order from response orders/store

PUT /order/api/v1/orders/cancel

var myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

var raw = JSON.stringify({
  order_no: "KOM20230419102113",
});

var requestOptions = {
  method: "PUT",
  headers: myHeaders,
  body: raw,
  redirect: "follow",
};

fetch(
  "https://api.collaborator.komerce.my.id/order/api/v1/orders/cancel",
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

Detail order

Returns data detail order

Query params

  • order_no: "KOM20230612145122"

GET /order/api/v1/orders/detail

var myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

var requestOptions = {
  method: "GET",
  headers: myHeaders,
  body: raw,
  redirect: "follow",
};

fetch(
  "https://api.collaborator.komerce.my.id/order/api/v1/orders/detail?order_no=KOM20230612145122",
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

Request pickup

Create request pickup to expedition

BODY (raw)

  • pickup_vehicle:

  • pickup_time: Order pickup time HH:mm:ss

  • pickup_date: Order pickup date YYYY-MM-DD

  • orders: Array of objects below this

POST /order/api/v1/pickup/request

var myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

var raw = JSON.stringify({
  pickup_date: "2023-06-12",
  pickup_time: "20:00:00",
  pickup_vehicle: "Motor",
  orders: [
    {
      order_no: "KOM20230612190023",
    },
  ],
});

var requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow",
};

fetch(
  "https://api.collaborator.komerce.my.id/order/api/v1/pickup/request",
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

Print airway bill the order

Query params

  • page: count page (page_2)

  • order_no: number of order

POST /order/api/v1/orders/print-label

var myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

var requestOptions = {
  method: "POST",
  headers: myHeaders,
  redirect: "follow",
};

fetch(
  "https://api.collaborator.komerce.my.id/order/api/v1/orders/print-label?order_no=KOM20230906161162, KOM20230612190023, KOM20230906195899&page=page_2",
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

Update status order

Update status order after create order

BODY (raw)

  • status: status order Diterima/Diajukan/Dikirim/Retur/Batal/Dipacking

  • cnote: number of airway bill

  • order_no: number of order

PUT /order/api/v1/callback/update-status

var myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

var raw = JSON.stringify({
  "order_no": "KOM20230821133873",
  "cnote": "010116230046541",
  "status": "received"
});

var requestOptions = {
  method: 'PUT',
  headers: myHeaders,
  body: raw
  redirect: 'follow'
};

fetch("https://api.collaborator.komerce.my.id/order/api/v1/callback/update-status", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

History airway bill

Returns the history of packages currently being shipped by the expedition

Query params

  • airway_bill: number of airway bill

  • shipping: support expedtion JNE/SICEPAT/SAP/IDEXPRESS/JNT/NINJA

GET /order/api/v1/orders/history-airway-bill

const myHeaders = new Headers();
myHeaders.append("x-api-key", "xyz");

const requestOptions = {
  method: "GET",
  headers: myHeaders,
  redirect: "follow",
};

fetch(
  "https://api.collaborator.komerce.my.id/order/api/v1/orders/history-airway-bill?shipping=SAP&airway_bill=DMP00125410785",
  requestOptions
)
  .then((response) => response.json())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));

Last updated