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 register for your shop. To post new customer information to Beans just use an HTTP POST request like this one:

Customer data

{
"id": 1847,
"created_at": "2015-03-06T15:42:35.792568+00:00",
"updated_at": "2018-10-16T19:43:23.495353+00:00",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"shop_newsletter": true,
"tags": ["loyal", "paying"],
"addresses": [
{
"id": 1234,
"type": "billing",
"first_name": "John",
"last_name": "Doe",
"company": null,
"address_1": "Chestnut Street 92",
"address_2": "Apartment 2",
"zip": "40202",
"state": "Louisville",
"country": "united states",
"created_at": "2015-03-06T15:42:35.792568+00:00",
"updated_at": "2018-10-16T19:43:23.495353+00:00",
}
]
}

Create or update a customer

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

Delete a customer

curl https://hook.radix.trybeans.com/v3/hook/radix/vanilla/customer/hook_deleted \
--request POST \
--user key_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.

{
'id': 13207,
"created_at": "2018-03-06T15:42:35.792568+00:00",
"updated_at": "2018-10-16T19:43:23.495353+00:00",
"customer": {
"id": 1847,
"created_at": "2015-03-06T15:42:35.792568+00:00",
"updated_at": "2018-10-16T19:43:23.495353+00:00",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"shop_newsletter": true,
"tags": ["loyal", "paying"],
"addresses": [
{
"id": 1234,
"type": "billing",
"first_name": "John",
"last_name": "Doe",
"company": null,
"address_1": "Chestnut Street 92",
"address_2": "Apartment 2",
"zip": "40202",
"state": "Louisville",
"country": "united states",
"created_at": "2015-03-06T15:42:35.792568+00:00",
"updated_at": "2018-10-16T19:43:23.495353+00:00",
},
]
},
"currency": "USD",
"email": "[email protected]",
"name": '13207',
"landing_url": "https://shop.example.com/shop/",
"financial_status": 'paid',
"source": {},
"total": '53.00',
"subtotal": '33.00',
"amount_shipping": '20.00',
"amount_giftcard": "0.00",
"amount_tax": "0.00",
"cancelled": null,
"processed": "2018-03-06T15:42:35.792568+00:00",
"is_fulfilled": true,
"is_refunded": false,
"is_paid": true,
}

Create or update an order

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