====== The Subscription XML Datafeed ======
The FoxyCart subscription XML datafeed runs once a day, and sends data to the same location configured for your [[.:transaction_xml_datafeed|regular data feed]]. It contains:
* transaction information for subscriptions that are either past due,
* subscriptions that were canceled (on the day of the datafeed),
* subscriptions that have a subscription end date set, and
* customer information for customers whose payment methods are about to expire.
The transaction details included in the XML are obtained 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 the transactions occur in the [[.:transaction_xml_datafeed|transaction XML datafeed]].
A few things worth noting:
* The subscription XML datafeed comes with a ''POST'' ''name'' of ''FoxySubscriptionData''. This is different than the [[.:transaction_xml_datafeed|transaction XML datafeed]], which has a ''POST'' ''name'' of ''FoxyData''.
* The subscription XML datafeeds are set to run once a day, about 19:00 GMT (12:00 noon PST). The exact time you receive your subscription XML datafeed depends on a variety of factors, but if you want to request it to be sent on-demand you can do so with [[.:api|the API]].
* Subscriptions themselves are set to run about 12:00 noon GMT (05:00 PST). As with the subscription XML datafeed, the exact time depends on a variety of factors including store version.
* Customers will be included in the ''payment_methods_soon_to_expire'' node if their credit card expiration month is the current month, or the next month. So if the expiration month is 05, the customer will be included if the current month is 04 or 05.
For a working example script for how you can use this feed, check the integrations page for a [[:integration:subscription_datafeed|Subscription Datafeed]] integration example.
===== Example Subscription XML Datafeed =====
200
2009-03-24
2009-03-04
0.00
1m
https://example.foxycart.com/cart?sub_token=9c7ac0cadc73f93e126b6d97893cad3f
1
44
2397
2009-02-24 23:00:33
10.00
John
Doe
1234 Any Street
Any City
TN
12345
US
email@example.com
123.123.123.123
https://example.foxycart.com/receipt?id=fe376559e8f76a2fafa8c707c73cda2a
monthly subscription
10.00
1
0.000
Default for all products
DEFAULT
notshipped
196
2009-03-25
0000-00-00
50.00
1m
Error: There was an error processing your payment: Credit card number is required. (Response Reason Code: 33)
https://example.foxycart.com/cart?sub_token=3076ca2af366d8a2647b60484a9fbefc
2009-03-24
1
60
2380
2009-02-24 21:06:31
25.00
Test
Test
12345 any city
Any City
TN
12345
US
email2@example.com
123.123.123.123
https://example.foxycart.com/receipt?id=962aafde40dbc187abbd420e13548529
monthly product
25.00
1
0.000
610
Default for all products
DEFAULT
notshipped
4
Test
Test
test.test@example.com
02
2009
10
Test2
Test2
test2.test2@example.com
02
2009