Kaiten

Read an anonymous checkout session

The session its ksc_ was minted for: its status, what it bought and what is due, and, once completed, the customer and instance created. A session still OPEN after expiresAt reads ABANDONED. The token keeps reading it for 24 h after it closed, then answers 401 PublicAuth.InvalidCredential.

GET
/public/checkout-sessions/{sessionId}

Authorization

checkoutSession
AuthorizationBearer <token>

An anonymous checkout session (ksc_...), returned once by POST /public/checkout-sessions and sent as Authorization: Bearer ksc_.... It reads and confirms that one session, at /public/checkout-sessions/{sessionId}, and nothing else; another session's id answers 401. A browser request must come from an origin of the publishable key that started the session.

In: header

Path Parameters

sessionId*string

The session the ksc_ was minted for; another one answers 401

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://app.kaiten.sh/api/public/checkout-sessions/string"
{
  "activationInvoice": {
    "currency": "EUR",
    "discountTotal": 0,
    "dueAt": "2019-08-24T14:15:22Z",
    "externalReference": "string",
    "hostedInvoiceUrl": "string",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "invoicePdfUrl": "string",
    "issuedAt": "2019-08-24T14:15:22Z",
    "kind": "ACTIVATION",
    "lines": [
      {
        "amount": 0,
        "description": "string",
        "label": "string",
        "quantity": "string",
        "seq": 0,
        "serviceFrom": "2019-08-24T14:15:22Z",
        "serviceTo": "2019-08-24T14:15:22Z",
        "type": "BASE",
        "unitAmountDecimal": "string"
      }
    ],
    "paidAt": "2019-08-24T14:15:22Z",
    "providerInvoiceNumber": "string",
    "serviceFrom": "2019-08-24T14:15:22Z",
    "serviceTo": "2019-08-24T14:15:22Z",
    "status": "MANUAL",
    "subtotal": 0,
    "total": 0
  },
  "addOns": [
    {
      "addonSlug": "string",
      "quantity": 0
    }
  ],
  "billingPeriod": "string",
  "clientReferenceId": "string",
  "completedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "customerSlug": "string",
  "dueToday": {
    "currency": "EUR",
    "discountTotal": 0,
    "lines": [
      {
        "amount": 0,
        "description": "string",
        "label": "string",
        "quantity": "string",
        "seq": 0,
        "serviceFrom": "2019-08-24T14:15:22Z",
        "serviceTo": "2019-08-24T14:15:22Z",
        "type": "BASE",
        "unitAmountDecimal": "string"
      }
    ],
    "subtotal": 0,
    "total": 0
  },
  "email": "string",
  "expiresAt": "2019-08-24T14:15:22Z",
  "instanceSlug": "string",
  "licenseSlug": "string",
  "payment": {
    "hostedInvoiceUrl": "string",
    "status": "paid"
  },
  "priceId": "string",
  "requiresPaymentMethod": true,
  "sessionId": "string",
  "status": "OPEN",
  "trialEndsAt": "2019-08-24T14:15:22Z",
  "trialRefusedReason": "string"
}
{
  "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"
}

Start an anonymous checkout

Starts a checkout for a visitor the vendor's backend does not know yet, with the publishable key and a Turnstile token. Writes one checkout session and nothing else: the customer, the instance and the subscription are created by the completion. Answers 201 status=open with the session's ksc_ token, returned once; with dryRun, 200 status=preview, writing and emitting nothing. dueToday is computed by the server. 403 .AnonymousCheckoutDisabled; 422 .TurnstileNotConfigured, .TurnstileFailed, .InvalidPriceSelection, .PriceNotPublic, .AddonNotPublic, .PriceNotFlatFee, .NotSelfServe, .ProviderCannotCapturePayment, .QuantityExceedsMax, .CurrencyMismatch, .InvalidEmail, .InvalidReturnUrl, .VoucherInvalid, .FallbackRequired; 429 .RateLimited (Retry-After): 10 starts per 10 minutes and 30 an hour per visitor address, dryRun included, 1,000 an hour per key; 503 .TurnstileUnavailable (Retry-After).

Confirm an anonymous checkout

Completes the session when nothing has to be captured -- a FREE plan, a trial on a plan that needs no payment method, nothing due -- creating the customer, the instance and the subscription in one transaction: status=completed. Otherwise answers status=requires_payment_method with a hosted setup page, keeps the ksc_ across its redirect, and completes on the next confirm: awaiting_payment while the first invoice is charged, completed once paid. No body. 403 .AnonymousCheckoutDisabled; 409 .SessionClosed (errors[0].value.status), .DueTodayChanged, .EntitlementLimitReached; 422 .PriceNotPublic, .AddonNotPublic, .FallbackRequired, .ProviderCannotCapturePayment, .VoucherInvalid; 429 .RateLimited (Retry-After): 30 confirms per 10 minutes per visitor address, 1,000 an hour per key; 503 .ProviderUnavailable (Retry-After), Entitlement.VerificationUnavailable.