Links

Webhooks

Setting up Beans Webhooks for your online shop
Incoming webhooks are a simple way to let Beans know about new events in your shop, such as when a customer completes an order so that they can be rewarded for their loyalty. They are simple URLs to which you send a JSON payload with the message text and some options.

Customer Webhook

Customer Webhook is to let Beans know when a new customer registers in your shop. To post new customer information to Beans just use an HTTP POST request like this one:

Customer data

{
"id": 1847,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"is_newsletter": True,
"tags": ["loyal", "paying"],
"created_at": "2020-02-06T12:49:47-05:00",
"updated_at": "2022-02-06T12:49:47-05:00",
}

Create or update a customer

curl https://hooks.radix.trybeans.com/v3/hook/radix/vanilla/customer/hook_created \
--request POST \
--user :sk_xxxxxxxxxxxxxxxxx \
--header "Content-Type: application/json" \
--data '<<customer_data>>'

Delete a customer

curl https://hooks.radix.trybeans.com/v3/hook/radix/vanilla/customer/hook_deleted \
--request POST \
--user :sk_xxxxxxxxxxxxxxxxx \
--header "Content-Type: application/json" \
--data '<<customer_data>>'

Order Webhook

Order Webhook is to let Beans know when a new order is placed in your shop. To post new order information to Beans just use an HTTP POST request like this one:

Order data

An order can contain a customer object.
order_data = {
"id": 13207,
"currency": "USD",
"email": "[email protected]",
"ref": "13207",
"total": "53.00",
"subtotal": "33.00",
"amount_shipping": "20.00",
"amount_giftcard": "0.00",
"amount_tax": "0.00",
"cancelled_at": None,
"processed_at": "2022-02-06T12:49:47-05:00",
"is_fulfilled": False,
"is_refunded": True,
"is_paid": True,
"customer": {
"id": 1847,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"is_newsletter": True,
"tags": ["loyal", "paying"],
"created_at": "2020-02-06T12:49:47-05:00",
"updated_at": "2022-02-06T12:49:47-05:00",
}
}

Create or update an order

curl https://hooks.radix.trybeans.com/v3/hook/radix/vanilla/order/hook_created \
--request POST \
--user :sk_xxxxxxxxxxxxxxxxx \
--header "Content-Type: application/json" \
--data '<<order_data>>'