Skip to main content

POST/schedule

This method creates a schedule, which is a subscription to the specified schedule template. A schedule periodically generates a report for the feedType specified by the template. Specify the same feedType as the feedType of the associated schedule template. When creating the schedule, if available from the template, you can specify a preferred trigger hour, day of the week, or day of the month. These and other fields are conditionally available as specified by the template.

Note: Make sure to include all fields required by the schedule template (scheduleTemplateId). Call the getScheduleTemplate method (or the getScheduleTemplates method), to find out which fields are required or optional. If a field is optional and a default value is provided by the template, the default value will be used if omitted from the payload.

A successful call returns the location response header containing the getSchedule call URI to retrieve the schedule you just created. The URL includes the eBay-assigned schedule ID, which you can use to reference the schedule task.

To retrieve the details of the create schedule task, use the getSchedule method for a single schedule ID or the getSchedules method to retrieve all schedule details for the specified feed_type. The number of schedules for each feedType is limited. Error code 160031 is returned when you have reached this maximum.

Note: Except for schedules with a HALF-HOUR frequency, all schedules will ideally run at the start of each hour ('00' minutes). Actual start time may vary time may vary due to load and other factors.

Input

Resource URI

POST https://api.ebay.com/sell/feed/v1/schedule

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

This method has no URI parameters.

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

The table below shows additional HTTP request headers that are either required, conditionally required, or strongly recommended for this method. Other standard HTTP request headers- opens rest request components page (not in this table) can also be used, but they are optional.

HeaderTypeDescription
Content-TypestringThis header indicates the format of the request body provided by the client. Its value should be set to application/json.

For more information, refer to HTTP request headers.

Occurrence: Required

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/api_scope/sell.inventory

https://api.ebay.com/oauth/api_scope/sell.fulfillment

https://api.ebay.com/oauth/api_scope/sell.marketing

https://api.ebay.com/oauth/api_scope/commerce.catalog.readonly

https://api.ebay.com/oauth/api_scope/sell.analytics.readonly

See OAuth access tokens for more information.

Request payload

Copy complete valid JSON to clipboard

Request fields

Input container/fieldTypeDescription
feedTypestring

The name of the feed type for the created schedule.

Use the getScheduleTemplates method to retrieve the feed type of a schedule template.

Note: Schedules are currently only available for LMS_ORDER_REPORT.

Occurrence: Required

preferredTriggerDayOfMonthinteger

The preferred day of the month to trigger the schedule. This field can be used with preferredTriggerHour for monthly schedules. The last day of the month is used for numbers larger than the actual number of days in the month.

This field is available as specified by the template (scheduleTemplateId). The template can specify this field as optional or required, and optionally provides a default value.

Minimum: 1

Maximum: 31

Occurrence: Conditional

preferredTriggerDayOfWeekDayOfWeekEnum

The preferred day of the week to trigger the schedule. This field can be used with preferredTriggerHour for weekly schedules.

This field is available as specified by the template (scheduleTemplateId). The template can specify this field as optional or required, and optionally provides a default value.

Occurrence: Conditional

preferredTriggerHourstring

The preferred two-digit hour of the day to trigger the schedule.

This field is available as specified by the template (scheduleTemplateId). The template can specify this field as optional or required, and optionally provides a default value.

Format: UTC hhZ

For example, the following represents 11:00 am UTC: 11Z

Occurrence: Conditional

scheduleEndDatestring

The timestamp on which the report generation (subscription) ends. After this date, the schedule status becomes INACTIVE.

Use this field, if available, to end the schedule in the future. This value must be later than scheduleStartDate (if supplied). This field is available as specified by the template (scheduleTemplateId). The template can specify this field as optional or required, and optionally provides a default value.

Format: UTC yyyy-MM-ddTHHZ

For example, the following represents UTC October 10, 2021 at 10:00 AM:
2021-10-10T10Z

Occurrence: Conditional

scheduleNamestring

The schedule name assigned by the user for the created schedule.

Occurrence: Optional

scheduleStartDatestring

The timestamp to start generating the report. After this timestamp, the schedule status becomes active until either the scheduleEndDate occurs or the scheduleTemplateId becomes inactive.

Use this field, if available, to start the schedule in the future but before the scheduleEndDate (if supplied). This field is available as specified by the template (scheduleTemplateId). The template can specify this field as optional or required, and optionally provides a default value.

Format: UTC yyyy-MM-ddTHHZ

For example, the following represents a schedule start date of UTC October 01, 2020 at 12:00 PM:
2020-01-01T12Z

Occurrence: Conditional

scheduleTemplateIdstring

The unique identifier of the template to be used for this schedule.

Use the getScheduleTemplates method to retrieve the schedule template ID. This method requires a schedule template ID that is ACTIVE.

Note: Schedules are currently only available for LMS_ORDER_REPORT.

Occurrence: Required

schemaVersionstring

The schema version of a schedule.

Occurrence: Required

Output

HTTP response headers

See HTTP response headers for details.

HeaderMeaning
LocationThe URL of the schedule, which includes the id.

Response payload

This call has no payload.

Response fields

This call has no field definitions.

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
201Created
400Bad Request
403Forbidden
409Conflict
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
160001API_FEEDAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance.
160002API_FEEDREQUESTThe authentication scope {scope} is incorrect for 'feed_type' {feedType}. Refer to documentation for details about the scopes.
160017API_FEEDREQUESTThe 'feedType' is missing or invalid.
160022API_FEEDREQUESTYou are not allowed to access this resource. Contact eBay Developer Technical Support for assistance.
160031API_FEEDBUSINESSYou have reached the maximum number of subscribed schedules for the 'feedType' {feedType}. To subscribe to another schedule, you must delete one.
160032API_FEEDREQUESTThe 'scheduleTemplateId' is invalid. Call the getScheduleTemplates method to get the available schedule templates.
160033API_FEEDREQUESTThe 'feedType' is not associated with the 'scheduleTemplateId'. Please provide a 'feedType' that matches the 'scheduleTemplateId'. Call the getScheduleTemplates method to get the available schedule templates.
160034API_FEEDREQUESTThe '{fieldName}' is invalid, missing, or not allowed.
160035API_FEEDBUSINESSDuplicate schedule (a matching schedule already exists). Use the getSchedules method to see the existing schedules.
160036API_FEEDREQUESTThe '{fieldName}' is in the past.
160037API_FEEDREQUESTThe 'scheduleEndDate' is before 'scheduleStartDate'.
160040API_FEEDBUSINESSThe 'scheduleTemplateId' is inactive. You cannot create or modify a schedule with an inactive 'scheduleTemplateId'.

Warnings

This call has no warnings.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Create a Schedule

This call creates a subscription to the specified schedule template. A schedule returns results for a specified date range at the frequency specified by the template. When creating the schedule, you can also specify a preferred trigger hour, day of the week, or day of the month.

Input

The input is the feedType and scheduleTemplateId, in addition to other parameters required by the configuration (see the specific schedule template for configuration). The following example creates a schedule with the following payload:

  • Name of the schedule for user reference: My schedule
  • The schedule template ID (the template the schedule is based off): 1*********1
  • The feed type (matches the one specified by the schedule template): LMS_ORDER_REPORT
  • A preferred trigger hour of 10:00 AM UTC: 10Z
  • An end date of January 1, 2021 at 12:00 PM UTC: 2021-01-01T12Z
  • The schema version of the feed type: 123

POSThttps://api.ebay.com/sell/feed/v1/schedule

Output

The output is an HTTP status. If the call is successful, the schedule ID is returned in the Location response header.