Skip to main content

Create a schedule

POST 

https://euwest.api.elasticpath.com/v2/subscriptions/schedules

Create a schedule

Request

Query Parameters

    filter string

Body

    data ScheduleCreaterequired
    typeSubscriptionScheduleType (string)required

    Possible values: [subscription_schedule]

    Example: subscription_schedule
    attributes ScheduleAttributesrequired
    external_refExternalRef (string)

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    Possible values: <= 2048 characters

    Example: abc123
    namestring

    The name of the schedule.

    Possible values: >= 3 characters and <= 1024 characters

    Example: Daily billing run.
    specificationstringrequired

    A cron-style specification of when the jobs should be created. See Schedules.

    Possible values: <= 1024 characters

    Example: 30 0 * * *
    locationstringrequired

    The location of the time zone that the schedule operates in. Subscriptions runs on Coordinated Universal Time (UTC) time and conforms to RFC 3339.

    Possible values: <= 1024 characters

    Example: Europe/London
    job ScheduleJobrequired
    job_typeJobType (string)required

    The type of job. One of the following:

    • billing_run - a billing run job.
    • payment_run - a payment run job.
    • tax_run - a tax run job.

    Possible values: [billing-run, tax-run, payment-run, import]

    Example: billing-run

Responses

Success. The schedule is created.

Schema
    data Schedule
    idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionScheduleType (string)required

    Possible values: [subscription_schedule]

    Example: subscription_schedule
    attributes ScheduleResponseAttributes
    external_refExternalRef (string)

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    Possible values: <= 2048 characters

    Example: abc123
    namestring

    The name of the schedule.

    Possible values: >= 3 characters and <= 1024 characters

    Example: Daily billing run.
    specificationstringrequired

    A cron-style specification of when the jobs should be created. See Schedules.

    Possible values: <= 1024 characters

    Example: 30 0 * * *
    locationstringrequired

    The location of the time zone that the schedule operates in. Subscriptions runs on Coordinated Universal Time (UTC) time and conforms to RFC 3339.

    Possible values: <= 1024 characters

    Example: Europe/London
    job ScheduleJobrequired
    job_typeJobType (string)required

    The type of job. One of the following:

    • billing_run - a billing run job.
    • payment_run - a payment run job.
    • tax_run - a tax run job.

    Possible values: [billing-run, tax-run, payment-run, import]

    Example: billing-run
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    meta ScheduleMetarequired
    scheduled_forstring<date-time>
    Example: 2017-07-21T17:32:28Z
    ownerstring<string>required

    The owner of a resource, either store or organization.

    Example: store
    timestamps Timestampsrequired
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/subscriptions/schedules");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"subscription_schedule\",\n \"attributes\": {\n \"external_ref\": \"abc123\",\n \"name\": \"Daily billing run.\",\n \"specification\": \"30 0 * * *\",\n \"location\": \"Europe/London\",\n \"job\": {\n \"job_type\": \"billing-run\"\n }\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Parameters
— query
Body
{
  "data": {
    "type": "subscription_schedule",
    "attributes": {
      "external_ref": "abc123",
      "name": "Daily billing run.",
      "specification": "30 0 * * *",
      "location": "Europe/London",
      "job": {
        "job_type": "billing-run"
      }
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!