FetchApp API Version 3.0
FetchApp is seamlessly integrated with PayPal, Goodsie, BigCommerce, FoxyCart, and Shopify to handle collection of payments for downloadable products that are stored and delivered through FetchApp. But what if you want to use Fetch with another program? Our API allows developers to integrate FetchApp with any system.
API Documentation
The FetchApp API is implemented as RESTful (using all four verbs GET/POST/PUT/DELETE) XML over HTTP. URIs are given with the RESTful option first, followed by alternative paths.
Every resource, like orders and products, has its own URL and is manipulated in isolation. The API is also usable by non-RESTful platforms as well using GET and POST only by adding on the appropriate command to the URI.
The following open-source libraries are available:
(.NET and Python libraries pending update to be compatible with version 2.0 of our API)
Navigation
Authentication
All requests require basic authentication. To make a proper request, you must set the authorization header of your request and supply the generated string. The string is your personal key and token with a colon ("demokey:demotoken") converted to a base-64 string. For example...
"demokey:demotoken".to_base64 is ZGVtb2tleTpkZW1vdG9rZW4=
Then, place the string into the authorization header of your HTTP requests...
GET /api/v2/orders HTTP/1.1 Host: app.fetchapp.com Authorization: Basic ZGVtb2tleTpkZW1vdG9rZW4= Content-Type: application/xml
** Please make sure to set the Content-Type header to 'application/xml'. **
Connectivity
GET the time to test connectivity...
GET /api/v2/time /api/v2/time.xml
Example result...
Account
GET information about your account...
/api/v2/account /api/v2/account.xml
Example result...
4334 Warner Brothers bugs@bunny.com warner.fetchapp.com daffy@duck.com 240 3 USD 2008-12-28T18:47:56+00:00 bugs carrots
GET a new API token (this replaces your existing one)...
/api/v2/new_token /api/v2/new_token.xml
Example result...
abcdef6fdas
Downloads
GET a list of your downloads...
/api/v2/downloads /api/v2/downloads.xml /api/v2/downloads.xml?per_page=25&page=2
Example result...
433 myfile.txt BILL-WAX 1002 127.0.0.1 2009-04-23T14:03:27-04:00 314559 434 myfile.txt BILL-WAX 127.0.0.1 2009-04-23T14:03:16-04:00 314559
NOTE: A nil order_id indicates that the download was from a permalink.
Files
GET a list of your files...
/api/v2/files /api/v2/files.xml /api/v2/files.xml?per_page=25&page=2
Example result...
101551 ebook_collection.zip 5652920 binary/octet-stream /permalink/abcdef file 148782 Movie Magic Video /permalink/ghikjl http://your.cdn.com/link/to/file url
Orders
GET a list of all your orders...
/api/v2/orders /api/v2/orders.xml /api/v2/orders.xml?status=&per_page=25&page=2
Status can be open or expired. If not specified then all orders (open and expired) will be returned. Example result...
1001 1554898798 Donald Duck donald@duck.com 44.50 USD open 1 1 2008-12-28T18:47:56+00:00 3 2008-11-28T18:47:56+00:00 /get/tydjdjehttps://demo.fetchapp.com/api/v2/orders/1001/order_items https://demo.fetchapp.com/api/v2/orders/1001/downloads 1002 1554898799 Bugs Bunny bugs@bunny.com 12.99 GBP open 2 5 3 2008-11-28T18:47:56+00:00 /get/tydjdjehttps://demo.fetchapp.com/api/v2/orders/1002/order_items https://demo.fetchapp.com/api/v2/orders/1002/downloads
GET details of the specified order...
/api/v2/orders/:id /api/v2/orders/:id.xml
Example result...
1001 1554898798 Donald Duck donald@duck.com 44.50 USD open 1 1 2008-12-28T18:47:56+00:00 3 2008-11-28T18:47:56+00:00 /get/tydjdjehttps://demo.fetchapp.com/api/v2/orders/1001/order_items https://demo.fetchapp.com/api/v2/orders/1001/downloads
POST to create an order...
/api/v2/orders
/api/v2/orders/create /api/v2/orders/create.xml
For example...
1 1554898798 Bugs Bunny bugs@bunny.com USD Optional Custom Values 2010-09-07T15:08:02+00:00 5 true 1 4 4.99
NOTE: price is optional and defaults to the price set in the UI if not present. send_email is optional and defaults to true if not present. expiration_date is optional and the default is the setting in Settings → General if not present. download_limit is optional and the default is the setting in Settings → General if not present. downloads_remaining is optional and serves as an override. If not present the default is whatever the order's download_limit is set to.
PUT to update the specified order...
/api/v2/orders/:id
/api/v2/orders/:id/update /api/v2/orders/:id/update.xml
For example...
1 Bugs Bunny bugs@bunny.com USD Optional Custom Values 2010-09-07T15:08:02+00:00 5 false 1 4 4.99
NOTE: price is optional and defaults to the price set in the UI if not present. send_email is optional and defaults to false if not present. All fields can be changed including the order ID.
DELETE the specified order...
/api/v2/orders/:id
/api/v2/orders/:id/delete /api/v2/orders/:id/delete.xml
Example result...
Ok.
GET to list all downloads for the specified order...
/api/v2/orders/:id/downloads /api/v2/orders/:id/downloads.xml
Example result...
233 photo.jpg BILL-WAX 1001 127.0.0.1 2009-04-27T04:13:09+00:00 87088 433 ebook.pdf BILL-WAX 127.0.0.1 2009-04-28T10:33:09+00:00 332088
GET to expire the specified order...
/api/v2/orders/:id/expire /api/v2/orders/:id/expire.xml
Example result...
Ok.
POST to send download email for the specified order...
/api/v2/orders/:id/send_email?reset_expiration=false
/api/v2/orders/:id/send_email?expiration_date=2011-03-07T15:08:02+00:00&download_limit=10
/api/v2/orders/:id/send_email.xml?expiration_date=2011-03-07T15:08:02+00:00&download_limit=10
Example result...
Ok.
NOTE: reset_expiration is an optional boolean, and defaults to true if not present. If true, the expiration date will be set to whatever is selected in Settings → General or provided by the param expiration_date and the download limit will be set to whatever is selected in Settings → General or download_limit if present. Both expiration_date and download_limit are optional and if present override the default values option.
GET statistics about an order...
/api/v2/orders/:id/stats /api/v2/orders/:id/stats.xml
For example...
1001 1554898798 1 1 44.50 USD
Order Items
GET a list of all order items for the specified order...
/api/v2/orders/:id/order_items /api/v2/orders/:id/order_items.xml
Example result...
821431 BILL-WAX 1001 Quality Bill Wax 5.00 2 2012-08-01T15:54:06Z https://demo.fetchapp.com/api/v2/orders/1001/order_items/821431/files https://demo.fetchapp.com/api/v2/orders/1001/order_items/821431/downloads
GET details of the specified order item...
/api/v2/orders/:order_id/order_items/:id /api/v2/orders/:order_id/order_items/:id.xml
Example result...
821431 BILL-WAX 1001 Quality Bill Wax 5.00 2 2012-08-01T15:54:06Z https://demo.fetchapp.com/api/v2/orders/1001/order_items/821431/files https://demo.fetchapp.com/api/v2/orders/1001/order_items/821431/downloads
GET to list all files for the specified order item...
/api/v2/orders/:order_id/order_items/:id/files /api/v2/orders/:order_id/order_items/:id/files.xml
Example result...
123 Part1.zip 9774173559 binary/octet-stream /permalink/yuurud 432 External File Name /permalink/werwa http://your.cdn.com/link/to/file
For files stored in FetchApp, the url will be nil. For files stored externally the size_bytes and content_type will be nil since this information isn't available.
GET to list all downloads for the specified order item...
/api/v2/orders/:order_id/order_items/:id/downloads /api/v2/orders/:order_id/order_items/:id/downloads.xml
Example result...
233 photo.jpg BILL-WAX 1001 821431 127.0.0.1 2009-04-27T04:13:09+00:00 87088 433 ebook.pdf BILL-WAX 1001 821431 127.0.0.1 2009-04-28T10:33:09+00:00 332088
GET to expire the specified order item...
/api/v2/orders/:order_id/order_items/:id/expire /api/v2/orders/:order_id/order_items/:id/expire.xml
Example result...
Ok.
Products
GET a list all your products...
/api/v2/products /api/v2/products.xml /api/v2/products.xml?per_page=25&page=2
Example result...
BILL-WAX BILL-WAX Quality Bill Wax 5.00 4 5 /sell/abcdef/ppc /sell/abcdef /cart/pp 2008-11-10T22:54:32+00:00 https://demo.fetchapp.com/api/v2/products/BILL-WAX/files https://demo.fetchapp.com/api/v2/products/BILL-WAX/downloads FEATHER-DUSTER FEATHER-DUSTER Duck Feather Duster 3.00 2 2 /sell/jklmno/ppc /sell/jklmno /cart/pp 2008-11-10T22:54:32+00:00 https://demo.fetchapp.com/api/v2/products/FEATHER-DUSTER/files https://demo.fetchapp.com/api/v2/products/FEATHER-DUSTER/downloads
GET details of the specified product...
/api/v2/products/:sku /api/v2/products/:sku.xml
Example result...
BILL-WAX BILL-WAX Quality Bill Wax 5.00 4 5 /sell/abcdef/ppc /sell/abcdef /cart/pp 2008-11-10T22:54:32+00:00 https://demo.fetchapp.com/api/v2/products/BILL-WAX/files https://demo.fetchapp.com/api/v2/products/BILL-WAX/downloads
POST to create the specified product...
/api/v2/products
/api/v2/products/create /api/v2/products/create.xml
For example...
1 Carrot Juice 10.00 4443443 4443444
PUT to update the specified product...
/api/v2/products/:sku
/api/v2/products/:sku/update /api/v2/products/:sku/update.xml
For example...
2 Tomato Juice 10.0 4443443 4443444
The SKU can be changed if necessary.
Delete the specified product...
/api/v2/products/:sku
/api/v2/products/:sku/delete /api/v2/products/:sku/delete.xml
This will also remove the product from any existing orders.
Example result...
Ok.
GET statistics about a product...
/api/v2/products/:sku/stats /api/v2/products/:sku/stats.xml
For example...
0001 0001 0.01 USD 14 14
GET to list all files for the specified product...
/api/v2/products/:sku/files /api/v2/products/:sku/files.xml
Example result...
123 Part1.zip 9774173559 binary/octet-stream /permalink/yuurud 432 External File Name /permalink/werwa http://your.cdn.com/link/to/file
For files stored in FetchApp, the url will be nil. For files stored externally the size_bytes and content_type will be nil since this information isn't available.
GET to list all downloads for the specified product...
/api/v2/products/:sku/downloads /api/v2/products/:sku/downloads.xml
Example result...
233 photo.jpg BILL-WAX 1001 821431 127.0.0.1 2009-04-27T04:13:09+00:00 87088 433 ebook.pdf BILL-WAX 127.0.0.1 2009-04-28T10:33:09+00:00 332088
A nil order_id or order_item_id indicates a direct download of the product via the permalink.