Both sides previous revisionPrevious revisionNext revision | Previous revision |
v:2.0:webhooks [2025/03/26 08:30] – [This item can't be published / CollectionSchemaChangedError] adam | v:2.0:webhooks [2025/06/27 16:46] (current) – [Example Payload] adam |
---|
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. | 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'', ''subscription/cancelled'' | 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). | 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). |
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. | 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\":\"\",\" |