Both sides previous revisionPrevious revisionNext revision | Previous revision |
v:2.0:webhooks [2024/12/11 15:54] – [Subscribed resources] marija | v:2.0:webhooks [2025/06/27 16:46] (current) – [Example Payload] adam |
---|
The event that triggered the webhook still completed successfully. If it was a transaction webhook, the customer was charged and you'll receive payment for the transaction as your chosen payment gateway processes it. | The event that triggered the webhook still completed successfully. If it was a transaction webhook, the customer was charged and you'll receive payment for the transaction as your chosen payment gateway processes it. |
| |
| ==== Automatic deactivation of failing webhooks ==== |
| |
| If a single webhook endpoint continues to fail 12 times in a row (whether that is all from one single trigger, or from multiple triggers for the resource happening at the same time), then to prevent unnecessary attempts, the webhook will be deactivated, and the store will be notified by email. An inactive webhook will no longer send any payloads to the endpoint, giving the store time to correct the error that is happening before reactivating the webhook. |
| |
| An inactive webhook can be reactivated by editing it in the administration. When reactivating an inactive webhook, any resources that would have triggered the webhook while it was inactive are not automatically sent. These will need to be manually resent to your webhook endpoint as detailed below. |
==== Troubleshooting Webhook Errors ==== | ==== Troubleshooting Webhook Errors ==== |
| |
=== Subscriptions === | === Subscriptions === |
| |
Triggered whenever a subscription resource is created or updated. Subscriptions are created when first purchased as part of a transaction, and an update could include a change to it's next or end date, or the past due amount. If a change is made to a customer who has an associated subscription and you have the subscription webhook enabled, you will receive 2 webhooks, one for the customer and another for the subscription. | Triggered whenever a subscription resource is created or updated. Subscriptions are created when first purchased as part of a transaction, and an update could include a change to it's next or end date, or the past due amount. If a change is made to a customer who has an associated subscription and you have the subscription webhook enabled, we will send two webhooks, one for the customer and another for the subscription. |
| |
Events: ''subscription/created'', ''subscription/modified'' | Events: ''subscription/created'', ''subscription/modified'', ''subscription/cancelled'', ''subscription/refeed'' |
| |
| Note that the ''cancelled'' event is triggered when the subscription //actually ends//, on the subscription end date, not when a customer uses a subtoken to set their subscription to cancel (this would be a ''modified'' event instead). |
| |
=== Customers === | === Customers === |
| |
Triggered whenever a customer resource is created or updated. If a change is made to a customer who has an associated subscription and you have the subscription webhook enabled, you will receive 2 webhooks, one for the customer and another for the subscription. | Triggered whenever a customer resource is created or updated. If a change is made to a customer who has an associated subscription and you have the subscription webhook enabled, we will send two webhooks, one for the customer and another for the subscription. |
| |
Events: ''customer/created'', ''customer/modified'' | Events: ''customer/created'', ''customer/modified'', ''customer/refeed'' |
| |
| === Transaction Log === |
| |
| Triggered whenever a transaction resource is updated in some way, causing an additional log to be added to the transaction log. This can include a transaction or transaction item being edited, captured, refunded, or a transaction being added, moved or removed from a transaction folder. |
| |
| Events: ''transaction_log/created'', ''transaction_log/refeed'' |
| |
<WRAP center round important 95%> | <WRAP center round important 95%> |
| |
* Provide all data related to the customer (default)\\ <code>zoom=default_billing_address,default_shipping_address,default_payment_method,customer_addresses</code> | * Provide all data related to the customer (default)\\ <code>zoom=default_billing_address,default_shipping_address,default_payment_method,customer_addresses</code> |
| |
| === Transaction Logs === |
| |
| * Provide all data related to the log (default)\\ <code>zoom=transaction_log_details,transactions</code> |
| |
==== Saving The Webhook ==== | ==== Saving The Webhook ==== |
}</code> | }</code> |
| |
| === Transaction Log === |
| <code javascript> |
| { |
| "_links": { |
| |
| }, |
| "_embedded": { |
| "fx:transaction_log_details": [ |
| { |
| "_links": { |
| |
| }, |
| "request_type": "transaction_folder_added", |
| "reference": "2296720403", |
| "log": "{\"rel\":\"transaction\",\"id\":2296720403,\"old_values\":{\"folder_id\":null},\"new_values\":{\"folder_id\":6}}" |
| } |
| ], |
| "fx:transactions": { |
| "_links": { |
| |
| }, |
| "folder_uri": "https://api.foxycart.com/store_transaction_folders/6", |
| "id": 2296720403, |
| "display_id": "foo12345", |
| "is_test": true, |
| "hide_transaction": false, |
| "data_is_fed": true, |
| "type": "transaction", |
| "source": "", |
| "transaction_date": "2025-01-01T01:01:01-0700", |
| "locale_code": "en_US", |
| "customer_first_name": "John", |
| "customer_last_name": "Person", |
| "customer_tax_id": "", |
| "customer_email": "john@example.com", |
| "customer_ip": "11.22.123.456", |
| "ip_country": "United States", |
| "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15", |
| "total_item_price": 20, |
| "total_tax": 0, |
| "total_shipping": 7, |
| "total_future_shipping": 0, |
| "total_order": 27, |
| "status": "approved", |
| "folder_id": 6, |
| "date_created": "2025-01-01T01:01:01-0700", |
| "date_modified": "2025-01-01T01:01:01-0700", |
| "currency_code": "USD", |
| "currency_symbol": "$" |
| } |
| }, |
| "snapshot": "{\"_links\":{ },\"_embedded\":{\"fx:customer\":{\"_links\":{ },\"_embedded\":{\"fx:attributes\":[{\"_links\":{ },\"name\":\"Loyalty Points\",\"value\":\"100\",\"visibility\":\"private\",\"date_created\":\"2020-09-18T08:39:22-0700\",\"date_modified\":\"2020-09-18T08:39:22-0700\"},{\"_links\":{ },\"name\":\"Level\",\"value\":\"Bronze\",\"visibility\":\"public\",\"date_created\":\"2020-09-18T08:40:53-0700\",\"date_modified\":\"2020-09-18T08:40:53-0700\"}]},\"id\":12345678,\"last_login_date\":\"2025-06-25T06:48:10-0700\",\"first_name\":\"John\",\"last_name\":\"Person\",\"email\":\"john@example.com\",\"tax_id\":\"\",\"password_salt\":\"\",\"password_hash\":\"$P$Bfo4kbFOqal4gqR9RcE/xg2lK75zK1\",\"password_hash_type\":\"phpass\",\"password_hash_config\":\"8\",\"forgot_password\":\"\",\"forgot_password_timestamp\":null,\"is_anonymous\":false,\"date_created\":null,\"date_modified\":\"2025-06-25T06:48:10-0700\"},\"fx:payments\":[{\"_links\":{ },\"type\":\"plastic\",\"gateway_type\":\"authorize\",\"processor_response\":\"Authorize.net Transaction ID:123456789\",\"processor_response_details\":\"\",\"purchase_order\":\"\",\"cc_number_masked\":\"xxxxxxxxx4242\",\"cc_type\":\"Visa\",\"cc_exp_month\":\"01\",\"cc_exp_year\":\"2023\",\"fraud_protection_score\":0,\"paypal_payer_id\":\"\",\"third_party_id\":\"\",\"amount\":27,\"date_created\":\"2025-01-01T01:01:01-0700\",\"date_modified\":\"2025-01-01T01:01:01-0700\"}],\"fx:items\":[{\"_links\":{ },\"item_category_uri\":\"https:\\/\\/api.foxycart.com\\/item_categories\\/60511\",\"name\":\"Test\",\"price\":20,\"quantity\":1,\"quantity_min\":0,\"quantity_max\":0,\"weight\":0,\"code\":\"\",\" |