Create a job
POSThttps://euwest.api.elasticpath.com/v2/subscriptions/jobs
Create a job
Request
Query Parameters
filter string
- application/json
Body
data JobCreaterequired
Responses
- 201
- 400
- 409
- 500
Success. The job was created.
- application/json
- Schema
- Example (auto)
Schema
data Job
{
"data": {
"id": "11111111-2222-3333-4444-555555555555",
"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"
}
]
}
],
"status": "pending",
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
},
"relationships": {
"plans": {
"links": {
"related": "/offerings/:offering-id/plans",
"self": "/offerings/:offering-id"
},
"data": {
"type": "offering-plan",
"id": "625fe958-7b4b-40a0-a2c0-dbb8f31eec0d"
}
}
},
"meta": {
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z",
"started_at": "2017-01-10T11:41:19.244842Z",
"finished_at": "2017-01-10T11:41:19.244842Z"
},
"report": {
"invoices_ready_for_payment": 100,
"invoices_tax_required": 100,
"invoice_failures": 0,
"total_ready_for_payment": {
"USD": {
"amount": 100,
"includes_tax": false
},
"GBP": {
"amount": 90,
"includes_tax": true
}
},
"total_tax_required": {
"USD": {
"amount": 100,
"includes_tax": false
},
"GBP": {
"amount": 90,
"includes_tax": true
}
}
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- missing-name
Schema
errors Error[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Validation Error",
"status": "400",
"detail": "data.attributes.name: \"name\" is required"
}
]
}
Write conflict. Unable to perform the operation at this time.
- application/json
- Schema
- Example (auto)
- Example
Schema
errors Error[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Write Conflict",
"status": "409"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (auto)
- internal-server-error
Schema
errors Error[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Internal Server Error",
"status": "500"
}
]
}
Authorization: http
name: BearerTokentype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
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());
ResponseClear