Skip to main content

Create a job

POST 

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

Create a job

Request

Query Parameters

    filter string

Body

    data JobCreaterequired
    typeSubscriptionJobType (string)required

    Possible values: [subscription_job]

    Example: subscription_job
    attributes JobCreateAttributesrequired
    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
    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
    taxes InvoiceTaxItems[]

    Possible values: >= 1

  • Array [
  • invoice_idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    tax_items TaxItem[]required
  • Array [
  • typestringrequired

    This represents the type of resource object being returned. Always tax_item.

    Possible values: [tax_item]

    Example: tax_item
    namestring

    The name that appears on your customer's invoice and usually describes the specific type of tax, for example, Sales, VAT or GST.

    Possible values: <= 1024 characters

    Example: GST
    codestring

    The unique identifier assigned to goods and services for taxation purposes.

    Possible values: <= 1024 characters

    Example: 20.0 % S
    ratedoublerequired

    The tax rate is the percentage of the subscription amount that is required to be paid as tax.

    Example: 0.2
    jurisdictionstring

    The geographic area or political entity that has authority to levy and collect taxes.

    Possible values: <= 1024 characters

    Example: USA
  • ]
  • ]

Responses

Success. The job was created.

Schema
    data Job
    idUUID (string)

    The unique identifier.

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

    Possible values: [subscription_job]

    Example: subscription_job
    attributes JobResponseAttributes
    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
    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
    taxes InvoiceTaxItems[]

    Possible values: >= 1

  • Array [
  • invoice_idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    tax_items TaxItem[]required
  • Array [
  • typestringrequired

    This represents the type of resource object being returned. Always tax_item.

    Possible values: [tax_item]

    Example: tax_item
    namestring

    The name that appears on your customer's invoice and usually describes the specific type of tax, for example, Sales, VAT or GST.

    Possible values: <= 1024 characters

    Example: GST
    codestring

    The unique identifier assigned to goods and services for taxation purposes.

    Possible values: <= 1024 characters

    Example: 20.0 % S
    ratedoublerequired

    The tax rate is the percentage of the subscription amount that is required to be paid as tax.

    Example: 0.2
    jurisdictionstring

    The geographic area or political entity that has authority to levy and collect taxes.

    Possible values: <= 1024 characters

    Example: USA
  • ]
  • ]
  • statusstringrequired

    The status of job.

    Possible values: [pending, started, success, failed]

    Example: pending
    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
    relationships Relationships

    Relationships are established between different subscription entities. For example, a product and a plan are related to an offering, as both are attached to it.

    property name* Relationship
    anyOf
    meta JobMetarequired
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps JobTimestamps
    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
    started_atstring

    The date and time a job is started.

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

    The date and time a job finished.

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

    You can track your Subscriptions billing, tax, and payment operations using reports.

    oneOf

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/subscriptions/jobs");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"subscription_job\",\n \"attributes\": {\n \"external_ref\": \"abc123\",\n \"job_type\": \"billing-run\",\n \"taxes\": [\n {\n \"invoice_id\": \"11111111-2222-3333-4444-555555555555\",\n \"tax_items\": [\n {\n \"type\": \"tax_item\",\n \"name\": \"GST\",\n \"code\": \"20.0 % S\",\n \"rate\": 0.2,\n \"jurisdiction\": \"USA\"\n }\n ]\n }\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_job",
    "attributes": {
      "external_ref": "abc123",
      "job_type": "billing-run",
      "taxes": [
        {
          "invoice_id": "11111111-2222-3333-4444-555555555555",
          "tax_items": [
            {
              "type": "tax_item",
              "name": "GST",
              "code": "20.0 % S",
              "rate": 0.2,
              "jurisdiction": "USA"
            }
          ]
        }
      ]
    }
  }
}
ResponseClear

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

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.