Get an instance's subscription
The instance's subscription, live or CANCELED; 404 when it was never subscribed. Requires billing to be enabled for the organization.
Authorization
bearerAuth read:billingA JWT verified by the proxy in front of this API, or a Kaiten access token (ksh_...) — send either as Authorization: Bearer <token>. The scopes listed on each operation are checked server-side against current stored user assignments or stored service-token permissions, never JWT claims; write:<module> implies read:<module>, and read:* / write:* are wildcards over every module. x-kaiten-scopes lists every scope such a token can carry, including those enforced by a service in front of this API rather than by one of its operations.
In: header
Scope: read:billing
Path Parameters
Instance slug
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X GET "https://app.kaiten.sh/api/instances/acme-prod/billing"{
"anchorAt": "2019-08-24T14:15:22Z",
"basePrice": {
"billingModel": "FLAT_FEE",
"billingPeriod": "MONTHLY",
"billingTiming": "ADVANCE",
"createdAt": "2019-08-24T14:15:22Z",
"currency": "EUR",
"deprecatedAt": "2019-08-24T14:15:22Z",
"displayLabel": "Pro plan",
"displayOrder": 0,
"id": "string",
"isDefault": true,
"metered": {
"entitlementSlug": "tokens",
"saleUnitFactor": "10000",
"saleUnitPlural": "10k tokens",
"saleUnitSingular": "10k tokens"
},
"status": "ACTIVE",
"unitAmount": 2900,
"unitAmountDecimal": "2900",
"updatedAt": "2019-08-24T14:15:22Z"
},
"billingPeriod": "MONTHLY",
"cancelAtPeriodEnd": true,
"cancelRequestedAt": "2019-08-24T14:15:22Z",
"canceledAt": "2019-08-24T14:15:22Z",
"cancellationReason": "string",
"collectionMethod": "SEND_INVOICE",
"collectionMethodOverride": "string",
"createdAt": "2019-08-24T14:15:22Z",
"currency": "EUR",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"customerName": "string",
"customerSlug": "string",
"daysUntilDue": 0,
"daysUntilDueOverride": 0,
"id": "string",
"incompleteExpiresAt": "2019-08-24T14:15:22Z",
"instanceName": "string",
"instanceSlug": "string",
"pastDueSince": "2019-08-24T14:15:22Z",
"pendingLicenseSlug": "string",
"providerKind": "NOOP",
"reminderAt": "2019-08-24T14:15:22Z",
"scheduledChange": {
"effectiveAt": "2019-08-24T14:15:22Z",
"licenseSlug": "string",
"price": {
"billingModel": "FLAT_FEE",
"billingPeriod": "MONTHLY",
"billingTiming": "ADVANCE",
"createdAt": "2019-08-24T14:15:22Z",
"currency": "EUR",
"deprecatedAt": "2019-08-24T14:15:22Z",
"displayLabel": "Pro plan",
"displayOrder": 0,
"id": "string",
"isDefault": true,
"metered": {
"entitlementSlug": "tokens",
"saleUnitFactor": "10000",
"saleUnitPlural": "10k tokens",
"saleUnitSingular": "10k tokens"
},
"status": "ACTIVE",
"unitAmount": 2900,
"unitAmountDecimal": "2900",
"updatedAt": "2019-08-24T14:15:22Z"
},
"scheduledAt": "2019-08-24T14:15:22Z"
},
"startedAt": "2019-08-24T14:15:22Z",
"status": "INCOMPLETE",
"trialEndsAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "License.NotFound",
"detail": "license not found",
"errorId": "3f6b1a2c-7c1e-4d0b-9d5f-2b0a1c4e8d31",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "/api/licenses/enterprise",
"status": 404,
"title": "Not Found",
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4"
}{
"code": "License.NotFound",
"detail": "license not found",
"errorId": "3f6b1a2c-7c1e-4d0b-9d5f-2b0a1c4e8d31",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "/api/licenses/enterprise",
"status": 404,
"title": "Not Found",
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4"
}{
"code": "License.NotFound",
"detail": "license not found",
"errorId": "3f6b1a2c-7c1e-4d0b-9d5f-2b0a1c4e8d31",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "/api/licenses/enterprise",
"status": 404,
"title": "Not Found",
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4"
}{
"code": "License.NotFound",
"detail": "license not found",
"errorId": "3f6b1a2c-7c1e-4d0b-9d5f-2b0a1c4e8d31",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "/api/licenses/enterprise",
"status": 404,
"title": "Not Found",
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4"
}{
"code": "License.NotFound",
"detail": "license not found",
"errorId": "3f6b1a2c-7c1e-4d0b-9d5f-2b0a1c4e8d31",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "/api/licenses/enterprise",
"status": 404,
"title": "Not Found",
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4"
}{
"code": "License.NotFound",
"detail": "license not found",
"errorId": "3f6b1a2c-7c1e-4d0b-9d5f-2b0a1c4e8d31",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "/api/licenses/enterprise",
"status": 404,
"title": "Not Found",
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4"
}Open a customer's billing portal
Opens the payment provider's hosted portal for the customer, where it manages payment methods and invoices; changes reach Kaiten through sync. 422 .ProviderNotConnected, .CustomerNotOnProvider, .InvalidReturnUrl; 503 .ProviderUnavailable. Requires billing to be enabled for the organization.
Subscribe an instance
Starts billing an instance on a FLAT_FEE price of its licence version. A base price that bills in advance issues the first period's invoice (ACTIVATION) at once; charged automatically, it is pushed and charged before the answer when the provider answers within 20 seconds. Each period then closes into a RENEWAL. Add-ons and a voucher can be started with it, in the same transaction. A CANCELED subscription is subscribed again. While the subscription is live the instance's customer and licence cannot change. Requires billing to be enabled for the organization.