Quickstart
Create an escrow checkout session and put Buy with Bruce on your site in minutes.
Prerequisites
- Bruce account with a Business organization.
- API key (
bk_live_…) withcheckout:write. - HTTPS merchant site (for webhooks and redirect URLs).
1. Create a checkout session
curl -X POST https://api.bruce.money/api/v1/checkout-sessions \
-H "X-Api-Key: bk_live_…" \
-H "Content-Type: application/json" \
-d '{
"amount": "25.00",
"description": "Logo package",
"orderId": "order_1001",
"shopDomain": "store.example.com",
"redirectUrl": "https://store.example.com/thanks",
"webhookUrl": "https://store.example.com/webhooks/bruce",
"escrowTemplateId": "freelance",
"metadata": { "platform": "custom", "pluginVersion": "1.0.0" }
}'
Response includes payUrl like https://bruce.money/checkout/{id} and settlement: "escrow".
2. Add the Buy with Bruce button
<a
class="bruce-pay-button"
href="PAY_URL_FROM_API"
data-bruce-amount="25.00"
data-bruce-label="Buy with Bruce"
>Buy with Bruce</a>
<script async src="https://bruce.money/embed/pay-button.js"></script>
Never put your API key in the browser
Create sessions on your server. The embed script only styles the link.
3. Handle webhooks
Verify X-Bruce-Signature: sha256=… (HMAC-SHA256 of the raw body with your signing secret). Listen for:
checkout.funded— start fulfillmentcheckout.released— mark paid (also aliased ascheckout.paid)
Test checklist
- Buyer not logged in → login with
?next=/checkout/…returns to the same session - Mobile Safari / Chrome → Universal Link opens Bruce app when installed
- Webhook retries deliver after a temporary 500