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.00100.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; IIMMPACT submits its topup after payment succeeds.

FieldTypeRequiredDescription
items[].productstringYesProduct code from Product Listing.
items[].accountstringYesRecipient's account number or identifier, such as a bill account or mobile number.
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. IIMMPACT generates a transaction reference for each topup and calculates the sale price 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 matches calculation, with only order_id added. 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.
FieldTypeDescription
data.currencystringMYR.
data.payment_method_codestringSelected method.
data.customer_fee_percentstringPercentage of the fee the customer bears, 0.00100.00.
data.feeobjectFee rule.
data.itemsarrayItem details with resolved prices below.
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",
    "currency": "MYR",
    "payment_method_code": "CARD",
    "customer_fee_percent": "50.00",
    "fee": {
      "type": "percentage",
      "value": "1.70"
    },
    "items": [
      {
        "product": "TNB",
        "account": "220012345679",
        "amount": "60.00",
        "quantity": 1,
        "unit_price": "60.00",
        "subtotal": "60.00"
      },
      {
        "product": "TNB",
        "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"
    }
  }
}

Errors

HTTPCodeAction
400idempotency_key_requiredSupply a creation key.
409idempotency_conflictThis key was already used with different request data. Retry with the original data, or use a new key for a new request.
409duplicate_external_referenceUse the existing order identified by error.details.order_id.
422validation_errorCorrect field errors.
422payment_method_unavailableRefresh methods and choose an available one.

Duplicate-reference details

FieldTypeDescription
error.details.order_idstringExisting order ID within your account.
error.details.external_referencestringThe duplicated order reference.

See shared errors.

Next: Create Payment.

IIMMPACT API Documentation