Create a job
POST/subscriptions/jobs
Create a job
Request
Query Parameters
- application/json
Body
billing_run
- a billing run job.payment_run
- a payment run job.tax_run
- a tax run job.- Array [
- Array [
- ]
- ]
data JobCreaterequired
Possible values: [subscription_job
]
attributes JobCreateAttributesrequired
Possible values: <= 2048 characters
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
Possible values: [billing-run
, tax-run
, payment-run
, import
]
The type of job. One of the following:
taxes InvoiceTaxItems[]
Possible values: >= 1
The unique identifier.
tax_items TaxItem[]required
Possible values: [tax_item
]
This represents the type of resource object being returned. Always tax_item
.
Possible values: <= 1024 characters
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
The unique identifier assigned to goods and services for taxation purposes.
The tax rate is the percentage of the subscription amount that is required to be paid as tax.
Possible values: <= 1024 characters
The geographic area or political entity that has authority to levy and collect taxes.
Responses
- 201
- 400
- 409
- 500
Success. The job was created.
- application/json
- Schema
- Example (from schema)
Schema
billing_run
- a billing run job.payment_run
- a payment run job.tax_run
- a tax run job.- Array [
- Array [
- ]
- ]
- BillingRunReport
- TaxRunReport
- PaymentRunReport
data Job
The unique identifier.
Possible values: [subscription_job
]
attributes JobCreateAttributesrequired
Possible values: <= 2048 characters
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
Possible values: [billing-run
, tax-run
, payment-run
, import
]
The type of job. One of the following:
taxes InvoiceTaxItems[]
Possible values: >= 1
The unique identifier.
tax_items TaxItem[]required
Possible values: [tax_item
]
This represents the type of resource object being returned. Always tax_item
.
Possible values: <= 1024 characters
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
The unique identifier assigned to goods and services for taxation purposes.
The tax rate is the percentage of the subscription amount that is required to be paid as tax.
Possible values: <= 1024 characters
The geographic area or political entity that has authority to levy and collect taxes.
Possible values: [pending
, started
, success
, failed
]
The status of job.
The date and time a resource was updated.
The date and time a resource was created.
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.
meta JobMetarequired
The owner of a resource, either store
or organization
.
timestamps Timestampsrequired
The date and time a resource was updated.
The date and time a resource was created.
The date and time a job is started.
The date and time a job finished.
report object
You can track your Subscriptions billing, tax, and payment operations using reports.
The total number of invoices created that are ready for payment.
The total number of invoices created that need taxes to be applied before payment can be made.
The total number of invoices that were scheduled but creation failed.
total_ready_for_payment Pricerequired
The total amount ready for payment invoiced in the billing run, segmented by currency.
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
total_tax_required Pricerequired
The total amount (excluding tax) invoiced in the billing run but still requiring taxes, segmented by currency.
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
The total number of invoices to which tax was successfully added.
The total number of invoices to which tax could not be added.
The total number of invoices for which payment was attempted.
The number of failed payment attempts.
total_collected Pricerequired
The total amount collected by the payment run, segmented by currency.
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_job",
"attributes": {
"external_ref": "abc123",
"job_type": "billing-run",
"taxes": [
{
"invoice_id": "00000000-0000-0000-0000-000000000000",
"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"
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- missing-name
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"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 (from schema)
- Example
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"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 (from schema)
- internal-server-error
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"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"
}
]
}