Skip to main content

Non-Shopify Ordering — Developer Guide

What is this?

Bik lets your customers shop directly inside WhatsApp. They browse products, add items to a cart, pick shipping, apply a coupon, and place an order — all without leaving the chat.

For Shopify stores, Bik talks to Shopify directly. If your store does not run on Shopify, Bik holds the draft order state on its own side and only calls two endpoints on your backend at the very end of the flow:

  • placeOrder — when the customer confirms the purchase
  • getOrder — when Bik later needs to look up the placed order

You don't have to manage the draft, the cart math, the shipping line, or the coupon stacking — Bik does all of that internally. You just receive a fully-priced order, persist it, and return what you'd return for any normal order lookup.


Where to start — the sample server

The fastest way to understand the contract is to look at our reference implementation:

BikDotAiDev/non-shopify-examples

The non-shopify-order/ folder contains a minimal Node.js (no-deps) echo server implementing both endpoints. Use it as a smoke test target while wiring things up — point Bik at it, run a checkout, see the request body Bik sends, then port the logic to your real backend.


The checkout flow

Here is what happens end-to-end when a customer places an order through a Bik WhatsApp flow:

1. Customer picks items in WhatsApp


Bik holds a draft order in its own database
(cart, shipping line, discount, totals — all computed in-house)


2. Customer picks a shipping option
3. Customer enters a coupon code (optional)
→ Both update Bik's draft state. No call to your backend.


4. Customer confirms the order


Bik calls: POST <your placeOrder URL>
Body: { draftOrderId, paymentPending, order: BikOrder }
→ Your backend persists the order, returns { order: BikOrder }
→ Bik forwards the `invoiceUrl` to the customer on WhatsApp


5. Bik needs to look up the order later (status checks, etc.)


Bik calls: POST <your getOrder URL>
Body: { orderId }
→ Your backend returns { order: BikOrder }

Steps 1–3 don't touch your backend at all. Only steps 4 and 5 do.


What you need to build

You need to implement these two HTTP endpoints on your backend:

EndpointWhen Bik calls itDocs
placeOrderCustomer confirms the purchase→ View
getOrderBik fetches a placed order→ View

Each endpoint receives a JSON body from Bik and must return a JSON response in a fixed shape. The exact request fields and response shape are on each endpoint's page.


Before you start

Step 1 — Sync your product catalog

Bik needs to know your products before any order can be created. Product names, images, prices, and variant IDs all come from the catalog you sync into Bik.

The variantId values you sync are the exact IDs Bik will send in order.items[].variantId when calling placeOrder. If the IDs don't match, your backend won't be able to resolve the line items.

How to sync products

Step 2 — Register your endpoints with Bik

Once your endpoints are live, open the Non‑Shopify Onboarding screen in BIK Labs and configure the endpoint URLs (root) along with the auth scheme for each endpoint.

You need to register both placeOrder and getOrder. Configuring just one will leave half the flow non-functional.


Authentication

Bik supports four ways to authenticate requests to your endpoints:

SchemeWhat Bik sends
NoneNo auth header
Bearer tokenAuthorization: Bearer <token>
API key<your-chosen-header>: <token>
Basic authAuthorization: Basic base64(username:password)

Pick the scheme for each endpoint and enter the credentials in the Non‑Shopify Onboarding screen. Bik stores them securely.


Response format

Both endpoints return an order field wrapping a BikOrder object:

{ "order": { "...BikOrder": "..." } }

BikOrder

FieldTypeDescription
idstringOrder ID in your system (your assigned id, not Bik's draft id)
namestringDisplay name, e.g. "#1001"
statusstringe.g. "ORDERED", "IN PROGRESS", "DELIVERED", "CANCELLED"
paymentStatusstringe.g. "pending", "paid"
itemsBikOrderItem[]Items in the order
totalnumberFinal total
subTotalnumberTotal before shipping and discounts
shippingChargenumberShipping cost
discountnumberTotal discount applied
currencystringISO currency code, e.g. "INR"
addressBikAddress \| nullDelivery address
phoneNumberstringCustomer phone
emailstringCustomer email (lowercased)
invoiceUrlstring \| nullPayment or order confirmation URL

BikOrderItem

FieldTypeDescription
namestringProduct name
variantNamestringVariant label, e.g. "Red / L"
variantIdnumberMust match the ID synced via the Product API
productIdnumberProduct ID in your catalog
quantitynumberQuantity
pricenumberUnit price
imagestring \| nullProduct image URL

BikAddress

FieldTypeDescription
firstNamestring
lastNamestring
address1stringStreet line 1
address2string \| nullStreet line 2
citystring
statestring \| nullState or region
countrystring
zipstringPostal code
phoneNumberstring \| null