Kaiten

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.

POST
/public/checkout-sessions/{sessionId}/confirm

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

application/problem+json

application/problem+json

curl -X POST "https://app.kaiten.sh/api/public/checkout-sessions/string/confirm"
{
  "session": {
    "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"
  },
  "setupExpiresAt": "2019-08-24T14:15:22Z",
  "setupUrl": "string",
  "status": "requires_payment_method"
}
{
  "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"
}
{
  "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"
}