Skip to content
BonicBD
COD Order Protection · Bangladesh

Send Meta the Orders That Actually Get Confirmed

A COD checkout shows an order-received page, but the sale is only real once your team confirms it — often by phone, days later. A purchase event fired at checkout counts a sale that has not happened yet. COD Order Protection holds the order, waits for your confirmation, and only then dispatches the purchase to Meta, TikTok, GA4 and Google Ads.

Included on every paid plan 50 confirmed orders on the free trial 180-day default data retention ৳1,000/month from GO

On WooCommerce, this is a setting — not an integration

BonicBD Tracker ships a Purchase trigger setting. Choose Completed and the plugin does the COD path by itself: the order payload is captured at checkout, no purchase is sent while the order sits unconfirmed, and Purchase fires the moment you mark it Completed. Cancelled, refunded and failed orders never fire. No PHP snippet, no webhook, no backend work.

The hold-and-webhook API described on this page is for everyone else: a custom or headless storefront, an ERP or courier panel outside WooCommerce, or a team that wants an explicit confirm/reject decision instead of relying on one status. If you run WooCommerce and mark delivered orders Completed anyway, start with the plugin setting.

Why checkout is the wrong moment

Three things a browser pixel cannot see

The order is not final at checkout

A COD checkout is a request, not a sale. The order still has to be confirmed by phone or in an admin panel, and a share of them never are. A purchase fired at checkout reports revenue that may never be collected.

Confirmation happens outside the browser

Your agent marks the order confirmed in a panel, an ERP, a courier integration or a spreadsheet. None of those places can fire a browser event, so the real confirmation has no way back into the pixel.

Cancellations never come back

When an order is cancelled or returned, a browser-only setup has nothing to send. The ad platform keeps optimising toward a profile that fills forms and then cancels.

What this changes in practice

Reported purchases move toward the number you actually deliver. Expect reported conversions to fall for a short period while delivery optimisation re-learns, then stabilise against orders that ship.

The state machine

What happens to an order between checkout and purchase

heldOrder captured, no purchase sent
confirmation_pendingWaiting on your team
confirmedYour status names a sale
dispatchingPurchase on its way to destinations
sentDelivered to the destination

Statuses that confirm a purchase

  • confirmed, processing, completed, paid
  • shipped, order-shipped, dispatched, partially-shipped
  • delivered, delivered-cash-collected, out-for-delivery, ready-for-pickup
  • in-transit, intransit, picked-up

Statuses that close without a purchase

  • cancelled, canceled
  • failed, refunded
  • returned, trash
  • Anything not on either list is ignored — an unknown status is never treated as a sale. Use a per-account status mapping if your panel uses its own vocabulary.
The API

Two endpoints, one order identifier

1

Hold the order at checkout

Post the order to the hold endpoint with the hold key for your container. Nothing is forwarded to an ad platform at this stage.

# hold — capture the order, send no purchase yet POST https://track.yourdomain.com/c/<cid>/cod/hold x-bonicbd-cod-key: <hold key from panel> x-bbd-request-id: <your idempotency id> x-bbd-timestamp: <unix seconds> { "order_id": "BD-10241", "value": 2450, "currency": "BDT", "payment_method": "cod", "source": "website", "event_source_url": "https://yourdomain.com/checkout", "user_data": { "em": "<sha256>", "ph": "<sha256>" }, "items": [{ "item_id": "SKU-14", "price": 2450, "quantity": 1 }] }
2

Send the status change when it happens

When your panel, ERP or courier integration records a status, forward it to the webhook endpoint with the webhook secret. The status classifier decides confirm, reject or ignore.

# order.status — the transition that may produce a purchase POST https://track.yourdomain.com/c/<cid>/cod/webhook x-bonicbd-webhook-secret: <webhook secret from panel> x-bbd-request-id: <your idempotency id> x-bbd-timestamp: <unix seconds> { "order_id": "BD-10241", "type": "order.status", "status": "confirmed", "occurred_at": 1795132800 }
3

Record a return with its own return id

A return needs a return_id. BonicBD emits a refund event under a separate identifier, so it never overwrites or collides with the original purchase.

# order.returned — return_id is required on this type { "order_id": "BD-10241", "type": "order.returned", "return_id": "RET-3391", "status": "returned" }

Request rules worth knowing before you build

  • Credentials go in headers only. A credential in a query string is rejected.
  • Timestamps are checked. A request outside the replay window is refused, so clock drift on your server matters.
  • Every request needs an idempotency id. Replaying the same x-bbd-request-id returns the stored response instead of creating a second order. A different body on the same id is a conflict.
  • Event identifiers are derived, not random. The purchase for an order always carries the same identifier, so a retry cannot create a duplicate purchase.
  • Payloads are validated field by field. A rejected body names the offending fields and never echoes raw values.
Quota, honestly

Confirmed orders per 30-day block, and what happens at the limit

PlanConfirmed COD orders per blockMonthly price
Free Trial50৳0
GO300৳1,000
Starter800৳2,500
Pro2,500৳5,500
Business10,500৳10,000

The block is anchored to your billing reset date and runs 30 days from there. It is not a calendar month and not the 30 days before the renewal date. When a block is exhausted the order stays confirmed and its purchase event is held, not discarded, and an explicit retry in a later block revives the same record under the same event identifier.

Data handling

What is stored, and for how long

Retention is bounded

COD order records carry a default 180-day retention window, configurable per account between 1 and 3,650 days. The purge is a scheduled job with a fixed window, not indefinite storage.

Payloads are sealed at rest

The stored order payload is encrypted, and the encrypted copy written when the order is reserved is not rewritten by a later retry. What you sent is what the retry sends.

Credentials are scoped per container

The hold key and the webhook secret are separate credentials for a single container. Rotating one does not disturb the other, and neither is reused as a general API token.

Logs are metadata-only

Request logs record route, container, outcome and timing. Full URLs, which could carry a credential, and raw request bodies are not logged.

Setup

Wiring it up

1

Start a container

Sign up and pick a plan. COD Order Protection is included on every paid plan; the trial covers 50 confirmed orders so you can test the full path.

2

Read the credentials

Copy the hold key and the webhook secret from the panel. They are separate values and both belong in a server-side environment variable, never in page source.

3

Set your status mapping

If your panel uses its own status vocabulary, map it once. Unmapped statuses are ignored rather than guessed, which is the safe default for a sale.

4

Fire the hold at checkout

Post the order from your server at checkout: order id, value, currency, payment_method: cod, and hashed user data if you have it.

5

Forward status changes

Whatever records the confirmation posts to the webhook, whether that is panel, ERP or courier, to the webhook. A spreadsheet can do this with a scheduled script.

6

Watch one order end to end

Place a small test order, confirm it, and follow the record from held to sent in the dashboard before you trust the reporting.

Questions

What teams ask before switching

It holds first and dispatches only when an order-status webhook reports a confirming status. Cancelled, failed, refunded, returned and trash close the order without a purchase. Any status on neither list is ignored — never counted as a sale.

It waits and no purchase is sent. Nothing is inferred from a checkout or from elapsed time. Only a status transition moves it forward.

No. Browser tracking can still cover page views and add-to-cart. What changes is the purchase: fire it once, from the confirmation, rather than at checkout. Running both purchase paths without a shared identifier is how duplicate purchases appear in Events Manager.

Not required. The user_data object accepts SHA-256 hashed email, phone, name, city, region, postal code and country, plus an external_id. Sending it improves matching; leaving it out does not block the event.

The order stays confirmed and its purchase event is held with a quota-exceeded marker. An explicit retry in a later 30-day block revives the same record under the same event identifier. It is not silently dropped and it is not billed as overage.

Send type: order.returned with a return_id. A refund event goes out under its own identifier, so it never collides with the purchase. Omitting return_id on a return is rejected.

180 days by default, configurable per account between 1 and 3,650 days. The purge runs on a fixed window.

Whatever your server container forwards to: Meta Conversions API, TikTok Events API, GA4 Measurement Protocol, Google Ads enhanced conversions, LinkedIn, or a custom webhook. The destination configuration lives in your container.

Run one test order first

The free trial includes 50 confirmed COD orders, enough to move a real product line through hold, confirm and send before you commit to a plan.