POST
/v1/checkoutsCreates a new checkout with a selected product variant and lease term. Use this endpoint when a customer initiates a lease for a product. If an optional customer object is provided, the system will lookup an existing customer by email or create a new customer. If no customer information is provided, the checkout is created for the authenticated user. Creates a checkout in Unpaid state. If a checkout already exists for this user/product/term combination, returns the existing checkout instead of creating a duplicate. When customer information is provided, requires CheckoutCreateWithCustomer permission; otherwise requires CheckoutWrite permission.
Request Body
Fields in the request body
| Name | Type | Required | Description |
|---|---|---|---|
arbitraryFees | Optional | Optional arbitrary fees to apply to this checkout | |
cancelUrl | string | Optional | URL to redirect to when checkout is cancelled |
customer | Optional | - | |
failureUrl | string | Optional | URL to redirect to when checkout fails |
productVariantId | ProductVariantPubId | Required | Public ID of the product variant to include in the checkout |
selectedTermInMonths | LeaseTermPubId | Optional | - |
successUrl | string | Optional | URL to redirect to on successful checkout completion |
Response Data
Fields returned in the response
| Name | Type | Required | Description |
|---|---|---|---|
arbitraryFees | Optional | Arbitrary fees applied to this checkout | |
cancelUrl | string | Optional | URL to redirect to when checkout is cancelled |
checkoutFlowState | string | Optional | Current state in the checkout flow state machine |
checkoutSessionId | string | Required | Stripe checkout session ID for payment processing |
createdAt | string (date-time) | Required | Timestamp when the checkout was created |
depositInvoiceId | string | Optional | Stripe invoice ID for the deposit payment |
depositTimestamp | string | Optional | Timestamp when the deposit was paid |
externalOrderId | string | Optional | External order ID from integrated systems |
failureUrl | string | Optional | URL to redirect to when checkout fails |
id | CheckoutPubId | Required | Public-facing unique identifier for the checkout |
insuranceStatus | Required | Status of insurance approval (pending, approved, denied) | |
lastPaymentError | string | Optional | Last payment error message (if payment failed) |
lastPaymentErrorAt | string | Optional | Timestamp of last payment error |
lastPaymentErrorCode | string | Optional | Last payment error code (if payment failed) |
leaseDocumentId | string | Optional | ID of the lease document in PandaDoc |
leaseEndDate | string | Optional | End date of the lease term |
leaseStartDate | string | Optional | Start date of the lease term |
leaseTermId | LeaseTermId | Optional | - |
offtakePartnerId | OftakePartnerId | Required | Offtake partner handling this checkout |
paymentFailureCount | integer (int32) | Required | Count of payment failures |
pickupLocationId | integer | Optional | ID of the pickup location (if using pickup instead of shipping) |
recurringPaymentStatus | Required | Status of recurring payments (pending, active, cancelled) | |
shippingAddress | Optional | - | |
state | Required | Current state of the checkout (unpaid, pendingDeposit, waitlisted, deposited, fulfilled) | |
stripeSubscriptionId | string | Optional | Stripe subscription ID for recurring payments |
successUrl | string | Optional | URL to redirect to on successful checkout completion |
updatedAt | string (date-time) | Required | Timestamp when the checkout was last updated |
checkoutUrl | string | Required | URL to access the checkout page |
customerId | UserPubId | Required | Public ID of the customer (resolved from internal customer_id) |
POST
/v1/checkoutsRequest
curl https://api.thesweetspot.com/v1/checkouts \
-X POST \
-H "Content-Type: application/json" \
-d '{
"arbitraryFees": null,
"cancelUrl": null,
"customer": null,
"failureUrl": null,
"productVariantId": "string",
"selectedTermInMonths": null,
"successUrl": null
}'Response
{
"checkoutSessionId": "string",
"createdAt": "2025-12-10T18:00:53.241Z",
"id": null,
"insuranceStatus": null,
"offtakePartnerId": null,
"paymentFailureCount": 0,
"recurringPaymentStatus": null,
"state": null,
"updatedAt": "2025-12-10T18:00:53.242Z",
"checkoutUrl": "string",
"customerId": "string"
}