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

1
{
2
"id": 1847,
3
"first_name": "John",
4
"last_name": "Doe",
5
"email": "[email protected]",
6
"is_newsletter": True,
7
"tags": ["loyal", "paying"],
8
"created_at": "2020-02-06T12:49:47-05:00",
9
"updated_at": "2022-02-06T12:49:47-05:00",
10
}
Copied!

Create or update a customer

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

Delete a customer

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

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.
1
order_data = {
2
"id": 13207,
3
"currency": "USD",
4
"email": "[email protected]",
5
"ref": "13207",
6
"total": "53.00",
7
"subtotal": "33.00",
8
"amount_shipping": "20.00",
9
"amount_giftcard": "0.00",
10
"amount_tax": "0.00",
11
"cancelled_at": None,
12
"processed_at": "2022-02-06T12:49:47-05:00",
13
"is_fulfilled": False,
14
"is_refunded": True,
15
"is_paid": True,
16
"customer": {
17
"id": 1847,
18
"first_name": "John",
19
"last_name": "Doe",
20
"email": "[email protected]",
21
"is_newsletter": True,
22
"tags": ["loyal", "paying"],
23
"created_at": "2020-02-06T12:49:47-05:00",
24
"updated_at": "2022-02-06T12:49:47-05:00",
25
}
26
}
Copied!

Create or update an order

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