http://api.cratejoy.com/v1/hooks/
Hook Definition
event
(string): name of a cratejoy event that will trigger this hookrequest_type
(string): eitherPOST
orGET
, which http method cratejoy should use to talk to your endpoint- When using a
POST
, cratejoy will post a json object with all data associated with the event to your endpoint - When using a
GET
, since there are length limitations on querystrings you must specify the query and values you want cratejoy to send
- When using a
target
(string): the URI of your endpointname
(string): For your own use in managing your hooksquerystring
(string): Optional use for GET type targets
Payload
We currently deliver payloads as escaped JSON strings. Please be aware that this can confuse some parsers and cause errors if the parsers are only setup to accept valid JSON.
Available Events
These events fire near real time as their triggers occur on the platform. They are one callback to one event, and the payloads are the models that are triggering the event.
Event Name | Description | Available Payload |
---|---|---|
checkout_failed | One of your customers attempted to checkout but failed due to invalid input, or payment | Customer and Order Model |
customer_new | A new user has registered on your store. This can happen as part of a checkout, or independently. | Customer model |
address_updated | A customer address has been updated | Customer indicating new sub models |
billing_updated | A customer billing record has been updated | Customer indicating new sub models |
design_updated | You or one of your team have updated a design entry on your store | {'theme_name': 'mytheme', 'file_changed': 'html/index.html' } |
inventory_updated | Inventory on a product was updated | Inventory and Product model |
order_updated | You cancelled or changed the status of an order | Order model |
order_new | An order has been successfully placed on your store. | |
shipment_cancelled | You cancelled a shipment | Shipment model |
shipment_shipped | You marked a package as shipped | Shipment model |
subscription_cancelled | You or your customer cancelled a subscription | Subscription model |
subscription_new | A subscription has been created on your store. | Subscription model |
subscription_renew_failed | A subscription did not successfully charge on its renewal date | Subscription model |
subscription_renewed | A subscription has successfully paid for a new cycle and generated new shipments | Subscription model |
subscription_updated | One of your customers updated their subscription variants, terms, or products for their next renewal | Subscription model indicating new subscription state |
transaction_new | A new transaction was created | Transaction and Order models |
shipment_address_updated | The address associated with a shipment is changed. | Shipment model. |