Developer docs

IotaBot Commerce

Attribute paid orders from your own storefront back to the chat that sold them.

Get an API key

Attribute a paid order from Python

Same webhook from a Django / Flask / FastAPI payment hook.

order_paid.py
# pip install requests
import os
import requests

SECRET = os.environ["IOTABOT_STORE_SECRET"]

def notify_iotabot_order_paid(*, conversation_id, order_id, order_number, total, currency):
    r = requests.post(
        "https://api.iotabot.com/api/v1/webhooks/store/order",
        headers={"x-iotabot-secret": SECRET},
        json={
            "conversation_id": conversation_id,
            "order_id": order_id,
            "order_number": order_number,
            "total": total,
            "currency": currency,
            "status": "paid",
            "platform": "custom",
        },
        timeout=15,
    )
    r.raise_for_status()
    return r.json()  # {"ok": True}