less than a minute read • Updated 20 hours ago
What is the subscription XML datafeed?
What the daily subscription XML datafeed sends, what it doesn't, and how its timing and POST name differ from the regular transaction datafeed.
The subscription datafeed does not send a list of your subscriptions. If you want to be notified every time a subscription runs, use the regular transaction datafeed instead — see the notes below for what this feed actually contains.
The subscription XML datafeed runs once a day and sends data to the same location configured for your regular datafeed. It contains:
Transaction information for subscriptions that are past due
Subscriptions that were canceled (on the day of the datafeed)
Subscriptions that have a subscription end date set
Customer information for customers whose payment methods are about to expire
The transaction details included in the XML come from the last successful transaction. This is not the datafeed that tracks new or recurring subscription transactions that process normally — that data is sent as it occurs, in the transaction XML datafeed.
The subscription datafeed won’t send if it’s empty — if none of the criteria above are met on a given day, no datafeed is sent that day.
Notes
The subscription XML datafeed comes with a POST name of
FoxySubscriptionData, different from the transaction XML datafeed’s POST name ofFoxyData.Subscription XML datafeeds are set to run once a day, around 19:00 GMT (12:00 noon PST). The exact time depends on a variety of factors — if you need it sent on demand, you can request that through the API.
Subscriptions themselves are set to run around 12:00 noon GMT (05:00 PST). As with the datafeed, exact timing depends on several factors, including store version.
Customers are included in the
payment_methods_soon_to_expirenode if their card’s expiration month is the current month or the next month. For example, if the expiration month is 05, the customer is included if the current month is 04 or 05.If your endpoint returns any HTTP status code other than 200, it’s logged in your store’s error log.
For a working example script using this feed, see the Subscription Datafeed integration example on the integrations page.
Example subscription XML datafeed
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<foxysubscriptiondata>
<subscriptions>
<subscription>
<subscription_id>200</subscription_id>
<next_transaction_date>2009-03-24</next_transaction_date>
<end_date>2009-03-04</end_date>
<past_due_amount>0.00</past_due_amount>
<frequency>1m</frequency>
<error_message></error_message>
<sub_token_url>https://example.foxycart.com/cart?sub_token=9c7ac0cadc73f93e126b6d97893cad3f</sub_token_url>
<first_failed_transaction_date></first_failed_transaction_date>
<store_id>1</store_id>
<customer_id>44</customer_id>
<transaction_id>2397</transaction_id>
<transaction_date>2009-02-24 23:00:33</transaction_date>
<order_total>10.00</order_total>
<customer_first_name>John</customer_first_name>
<customer_last_name>Doe</customer_last_name>
<customer_address1>1234 Any Street</customer_address1>
<customer_address2></customer_address2>
<customer_city>Any City</customer_city>
<customer_state>TN</customer_state>
<customer_postal_code>12345</customer_postal_code>
<customer_country>US</customer_country>
<customer_phone></customer_phone>
<customer_email>email@example.com</customer_email>
<customer_ip>123.123.123.123</customer_ip>
<receipt_url>https://example.foxycart.com/receipt?id=fe376559e8f76a2fafa8c707c73cda2a</receipt_url>
<transaction_details>
<transaction_detail>
<product_name>monthly subscription</product_name>
<product_price>10.00</product_price>
<product_quantity>1</product_quantity>
<product_weight>0.000</product_weight>
<product_code></product_code>
<category_description>Default for all products</category_description>
<category_code>DEFAULT</category_code>
<product_delivery_type>notshipped</product_delivery_type>
<product_options>
</product_options>
</transaction_detail>
</transaction_details>
</subscription>
<subscription>
<subscription_id>196</subscription_id>
<next_transaction_date>2009-03-25</next_transaction_date>
<end_date>0000-00-00</end_date>
<past_due_amount>50.00</past_due_amount>
<frequency>1m</frequency>
<error_message>Error: There was an error processing your payment: Credit card number is required. (Response Reason Code: 33)</error_message>
<sub_token_url>https://example.foxycart.com/cart?sub_token=3076ca2af366d8a2647b60484a9fbefc</sub_token_url>
<first_failed_transaction_date>2009-03-24</first_failed_transaction_date>
<store_id>1</store_id>
<customer_id>60</customer_id>
<transaction_id>2380</transaction_id>
<transaction_date>2009-02-24 21:06:31</transaction_date>
<order_total>25.00</order_total>
<customer_first_name>Test</customer_first_name>
<customer_last_name>Test</customer_last_name>
<customer_address1>12345 any city</customer_address1>
<customer_address2></customer_address2>
<customer_city>Any City</customer_city>
<customer_state>TN</customer_state>
<customer_postal_code>12345</customer_postal_code>
<customer_country>US</customer_country>
<customer_phone></customer_phone>
<customer_email>email2@example.com</customer_email>
<customer_ip>123.123.123.123</customer_ip>
<receipt_url>https://example.foxycart.com/receipt?id=962aafde40dbc187abbd420e13548529</receipt_url>
<transaction_details>
<transaction_detail>
<product_name>monthly product</product_name>
<product_price>25.00</product_price>
<product_quantity>1</product_quantity>
<product_weight>0.000</product_weight>
<product_code>610</product_code>
<category_description>Default for all products</category_description>
<category_code>DEFAULT</category_code>
<product_delivery_type>notshipped</product_delivery_type>
<product_options>
</product_options>
</transaction_detail>
</transaction_details>
</subscription>
</subscriptions>
<payment_methods_soon_to_expire>
<customer>
<customer_id>4</customer_id>
<customer_first_name>Test</customer_first_name>
<customer_last_name>Test</customer_last_name>
<customer_email>test.test@example.com</customer_email>
<cc_exp_month>02</cc_exp_month>
<cc_exp_year>2009</cc_exp_year>
</customer>
<customer>
<customer_id>10</customer_id>
<customer_first_name>Test2</customer_first_name>
<customer_last_name>Test2</customer_last_name>
<customer_email>test2.test2@example.com</customer_email>
<cc_exp_month>02</cc_exp_month>
<cc_exp_year>2009</cc_exp_year>
</customer>
</payment_methods_soon_to_expire>
</foxysubscriptiondata>