http://api.cratejoy.com/v1/hooks/

Hook Definition

  • event (string): name of a cratejoy event that will trigger this hook
  • request_type (string): either POST or GET, 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
  • target (string): the URI of your endpoint
  • name (string): For your own use in managing your hooks
  • querystring (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 NameDescriptionAvailable Payload
checkout_failedOne of your customers attempted to checkout but failed due to invalid input, or paymentCustomer and Order Model
customer_newA new user has registered on your store. This can happen as part of a checkout, or independently.Customer model
address_updatedA customer address has been updatedCustomer indicating new sub models
billing_updatedA customer billing record has been updatedCustomer indicating new sub models
design_updatedYou or one of your team have updated a design entry on your store{'theme_name': 'mytheme', 'file_changed': 'html/index.html' }
inventory_updatedInventory on a product was updatedInventory and Product model
order_updatedYou cancelled or changed the status of an orderOrder model
order_newAn order has been successfully placed on your store.
shipment_cancelledYou cancelled a shipmentShipment model
shipment_shippedYou marked a package as shippedShipment model
subscription_cancelledYou or your customer cancelled a subscriptionSubscription model
subscription_newA subscription has been created on your store.Subscription model
subscription_renew_failedA subscription did not successfully charge on its renewal dateSubscription model
subscription_renewedA subscription has successfully paid for a new cycle and generated new shipmentsSubscription model
subscription_updatedOne of your customers updated their subscription variants, terms, or products for their next renewalSubscription model indicating new subscription state
transaction_newA new transaction was createdTransaction and Order models
shipment_address_updatedThe address associated with a shipment is changed.Shipment model.