PENDING status and returns it immediately — the session transitions to PAID only after the subscriber completes payment.
Request Body
The ID of the service the subscriber is signing up for.
The ID of the payment plan to attach to this checkout session. The plan must belong to the specified service; a mismatch returns a
404.The ID of an existing Retempo user to pre-associate with this session. If omitted, the user is identified during the checkout flow.
An ISO 8601 datetime string specifying when the session expires. If omitted, the session does not expire automatically.
Response
A successful request returns HTTP201 Created with the new checkout session object. The status is always PENDING.
The newly created checkout session.
201 — Checkout session created
Example Request
Error Codes
| Status | Message | Condition |
|---|---|---|
400 Bad Request | serviceId is required. | serviceId was omitted. |
400 Bad Request | paymentPlanId is required. | paymentPlanId was omitted. |
400 Bad Request | Checkout sessions can only be created with PENDING status. | A non-PENDING value was passed for status. |
404 Not Found | Payment plan was not found for the service. | The plan does not exist or does not belong to the specified service. |
404 Not Found | Referenced database record was not found. | The userId was not found. |
Checkout sessions are always created with status
PENDING. The session transitions to PAID when the subscriber completes payment. Attempting to create a session with any other initial status returns a 400 error.