Pay on Delivery

Let customers confirm an order and pay cash on delivery, settled from your dashboard.

Overview

Pay on Delivery (COD) lets a customer place an order without paying online — the cash is collected by your courier on delivery, and you mark it collected afterwards. Because it is physical cash in Haiti, COD is available for HTG orders only.

Enabling COD

There are three ways COD becomes available on an order:

  • Enable Pay on Delivery for the app under Settings → Payment Methods.
  • Pass allowPayOnDelivery: true on a specific init-payment call.
  • Initialize with amount: 0 — with nothing to charge online, the order automatically becomes COD.
Passing allowPayOnDelivery: true with a non-HTG currency is rejected with a 400.

Delivery Fee Options

The deliveryFee option controls how shipping is handled for a COD order:

deliveryFeeBehavior
"on_delivery"Everything (incl. shipping) is collected on delivery. Online charge is 0. (Default.)
"prepaid"The shipping fee is paid online up front (via Moncash); the goods are collected on delivery.
await icone.initPayment({
  action: "purchase",
  referenceId: "order_500",
  currency: "htg",
  amount: 3000,
  allowPayOnDelivery: true,
  deliveryFee: "on_delivery", // everything paid on delivery
  items: [{ name: "Combo", quantity: 1, unitPrice: 3000 }],
  successUrl: "https://yourstore.com/thanks",
  cancelUrl: "https://yourstore.com/cart",
});

Settling an Order

A COD order stays in a pending, awaiting-collection state. Once the cash is collected, mark it from the transaction in your dashboard ("Mark collected"), or via the API:

POST /api/app/:appId/transaction/:transactionId/collect
Content-Type: application/json

{ "action": "collect" }   // or "cancel"

Collecting marks the payment successful and fires a payment.success webhook; cancelling marks it failed. The action is idempotent — an order that is no longer awaiting collection returns 409.

Webhook Events

  • order.cod_placed — sent when a full-COD order is confirmed at checkout (status pending).
  • payment.success / payment.failed — sent when you settle the order. The payload includes codAmount and prepaidAmount.