Use this guide to upload and schedule your feed.
To upload a feed, you need catalog_management
permission. See Marketing API, Permissions. After you create a catalog, use catalog id
to create and schedule a Product Feed:
curl -X POST \
-F 'name="Test Feed"' \
-F 'schedule={
"interval": "DAILY",
"url": "http://www.example.com/sample_feed.tsv",
"hour": "22"
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/{product-catalog-id}/product_feeds
The schedule
parameter enables you to schedule your feed upload. Options include interval
, url
, hour
. It can also include day_of_week
, minute
, username
, and password
.
Note: For username
and password
, we support basic auth on HTTP and FTP.
Example — Schedule Your Feed Upload
schedule: {"day_of_week":"FRIDAY","hour":17,"interval_count":1,"interval":"DAILY","minute":42,"next_scheduled_upload_time":"","password":pwd123,"status":"active","timezone":"Atlantic/Canary","url":"https://www.abc.com","username":aname}
Update an individual item's data in real time. Include the updated fields in an HTTP POST
, where retailer_id
is the item ID from your feed. It must be base64url-encoded.
https://graph.facebook.com/catalog:{CATALOG_ID}:{base64urlencode(retailer_id)}
See mutable fields in Products, Reference.
Do not provide item feeds with individual item updates, creation, or deletion with the API. This can disrupt any updates or deletes of items you created with the API because we don't track these with the feed.
Scheduled feeds don't support uploads more frequently than once per hour. If you need to update inventory faster, we recommend to use the Direct Upload API.
If you're using our API to create and manage your feeds, you need to send us an API request with details for the update schedule you want to create:
curl \ -F 'name=Test Feed' \ -F 'update_schedule={ "interval": "HOURLY", "url": "http:\/\/www.example.com\/sample_feed_updates.tsv", "hour": 22 }' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/<CATALOG_ID>/product_feeds
We fetch item feeds from your system on a schedule you define. There are two types of schedules you can define:
update_schedule
— The uploads create new items or update existing ones with the information provided in the data feed file.schedule
— The uploads result in a complete refresh operation on your data feed. We delete items not present in the file, update existing ones, and create new ones. You can use either of the schedules, or both, depending on your needs.For example: update_schedule
with frequency HOURLY
and a replace schedule
with frequency DAILY
.
We recommend setting up an update_schedule
with only changed data in the data feed file for faster processing of feed. This is particularly better for holiday sales and faster price and availability updates. It's also recommended to mark items as "out of stock" rather than deleting from the feed so that we can retarget the user with similar available items.
curl \ -F 'name=Test Feed' \ -F 'schedule={ "interval": "DAILY", "url": "http:\/\/www.example.com\/sample_feed.tsv" }' \ -F 'update_schedule={ "interval": "HOURLY", "url": "http:\/\/www.example.com\/sample_feed_updates.tsv", "hour": 22 }' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/<CATALOG_ID>/product_feeds
Response:
{ "id" : {FEED_ID} }