Skip to content

Step 3: Create Order ​

Create the confirmed purchase and freeze its item prices. No payment starts.

Endpoint ​

http
POST https://api.iimmpact.com/v2/orders

Request headers ​

FieldTypeRequiredDescription
X-Api-KeystringYesYour API key; keep it on your backend.
X-TimestampstringYesCurrent Unix time in seconds; within five minutes of server time.
X-NoncestringYesFresh identifier for every request, including retries.
X-SignaturestringYesv1= followed by the request's HMAC signature.

Follow API Key Authentication. Sign the exact body, or an empty body for bodyless requests, and the sorted query when present.

FieldTypeRequiredDescription
Content-TypestringYesapplication/json.
Idempotency-KeystringYesUnique creation key; follow retry rules.

Request fields ​

FieldTypeRequiredDescription
external_referencestringYesYour order reference; unique within your account.
itemsarrayYesProducts to purchase. Include at least one item.
metadataobjectNoAdditional information as string-to-string entries.
FieldTypeRequiredDescription
payment_method_codestringYesCode from Payment Methods.
customer_fee_percentstringNoPercentage of the fee the customer bears, 0.00–100.00; defaults to 0.00.

Method and customer fee percent provide the current calculation only. They do not bind future payments; payer identity, card input, and return URL belong to payment creation.

Item fields ​

See Product Listing for available products. Each item follows Make Payment — Request Body; the purchased product runs after payment succeeds.

FieldTypeRequiredDescription
items[].productstringYesProduct code from Product Listing.
items[].accountstringProduct-dependentRecipient's account number or identifier. Send "" only when the product allows an optional account; otherwise provide its required destination. A supplied value must still pass that product's validation.
items[].amountstring or numberYesAmount for one topup. Required for every product; follows the existing Make Payment rules.
items[].quantityintegerNoNumber of topups for this item; defaults to 1. Must be positive.
items[].remarksstringNoAdditional remarks.
items[].extrasobjectConditionalAdditional fields required by the selected product; see Make Payment above.

Order limit

Each order supports up to 100 topups in total. Add the quantities of all items; the total must not exceed 100. An omitted quantity counts as 1.

For example, 10 items with quantity 10 reaches the limit. This limit is checked during calculation and order creation.

Use subproducts where required and bill presentment for bill validation. Each purchased unit gets a fulfillment reference and a sale price calculated from the item details.

Request example ​

json
{
  "external_reference": "ORD-00042",
  "payment_method_code": "CARD",
  "customer_fee_percent": "50.00",
  "items": [
    {
      "product": "TNB",
      "account": "220012345679",
      "amount": "60.00",
      "quantity": 1
    },
    {
      "product": "TNB",
      "account": "220012345678",
      "amount": "40.00",
      "quantity": 1
    }
  ]
}

Response fields ​

The response includes the creation calculation, order_id, and the new-payment admission cutoff. Values reflect creation-time prices and fees; payment creation checks the confirmed total again before charging.

FieldTypeDescription
data.order_idstringSave for payment creation and order reads.
data.external_referencestringYour order reference, echoed back.
data.statusstringpayment_pending on a new order.
data.created_atstringUTC order creation time.
data.updated_atstringUTC time of the latest public change.
data.expires_atstringUTC deadline for creating payments, 24 hours after order creation.
FieldTypeDescription
data.currencystringMYR.
data.payment_method_codestringSelected method.
data.customer_fee_percentstringPercentage of the fee the customer bears, 0.00–100.00.
data.feeobjectFee rule.
data.itemsarrayItem details with resolved prices below.
items[].productstringProduct code.
items[].product_namestringProduct display name.
items[].amountstringRequested topup amount, returned as a two-place decimal string.
items[].unit_pricestringTwo-place sale price per unit; may differ from face value.
items[].subtotalstringUnit price × quantity.
data.totalsobjectTwo-place amounts below.
totals.items_subtotalstringSum of item sale subtotals.
totals.feeobjectThe payment fee split between customer and you.
totals.fee.totalstringFull payment fee.
totals.fee.customerstringCustomer's portion of the fee.
totals.fee.merchantstringYour portion of the fee.
totals.payment_totalstringItem subtotal plus customer fee; use as expected_payment_total.

Response example — 201 ​

json
{
  "data": {
    "order_id": "ord_example",
    "external_reference": "ORD-00042",
    "status": "payment_pending",
    "currency": "MYR",
    "payment_method_code": "CARD",
    "customer_fee_percent": "50.00",
    "fee": {
      "type": "percentage",
      "value": "1.70"
    },
    "items": [
      {
        "product": "TNB",
        "product_name": "Tenaga Nasional Berhad",
        "account": "220012345679",
        "amount": "60.00",
        "quantity": 1,
        "unit_price": "60.00",
        "subtotal": "60.00"
      },
      {
        "product": "TNB",
        "product_name": "Tenaga Nasional Berhad",
        "account": "220012345678",
        "amount": "40.00",
        "quantity": 1,
        "unit_price": "40.00",
        "subtotal": "40.00"
      }
    ],
    "totals": {
      "items_subtotal": "100.00",
      "fee": {
        "total": "1.70",
        "customer": "0.85",
        "merchant": "0.85"
      },
      "payment_total": "100.85"
    },
    "created_at": "2026-09-14T02:00:00.000Z",
    "updated_at": "2026-09-14T02:00:00.000Z",
    "expires_at": "2026-09-15T02:00:00.000Z"
  }
}

Errors ​

HTTPCodeAction
400validation_errorCorrect field errors; error.details also covers a missing or malformed Idempotency-Key.
400invalid_itemsOne or more items failed product validation; error.details.items lists each failure's index, code, and message.
400payment_method_unavailableRefresh methods and choose an available one.
409idempotency_conflictThis key was already used with different request data. Retry with the original data, or use a new key for a new request.
409idempotency_in_progressThe original request with this key is still being processed; retry the same request after it resolves.
409duplicate_external_referenceUse the existing order identified by error.details.order_id.

Duplicate-reference details ​

FieldTypeDescription
error.details.order_idstringExisting order ID within your account.

See shared errors.

Next: Create Payment.

Pine Labs API Documentation