Checkout Testimony Offer
Initiate Stripe checkout for a testimony offer. This endpoint creates a Stripe checkout session and returns a URL where the client can complete payment. The client pays the offer price, which already contains the platform commission on top of the expert's amount.
Complete Payment Guide
See Payment Integration for the complete payment flow guide.
HTTP Request
POST /api/v1/testimonies/offers/:offerId/checkout
Parameters
| Parameter | Description |
|---|---|
phone string | Phone number in international format with country code (e.g., +421901234567, max 255 chars). Must not be used by another user; the client's own current number is accepted. See Phone Numbers. |
firstName string | Client's first name (max 255 chars; letters, combining marks, spaces and ' ’ . , - only). |
lastName string | Client's last name. Same rules as firstName. |
billingAddress object, Address | Billing address for the payment. |
shippingAddress object, Address, optional | Delivery address with its recipient — when sent, all of firstName, lastName, line1, line2, city, postalCode and country are required. Leave it out when the appraisal goes to the billing address. Not sent to Stripe (the billing address is). |
company object, CheckoutCompany, optional | Company information for business purchases. Leave it out for an order placed as a private person. |
The request is the full set of details for this order:
- The order keeps them. Both invoices name the customer from this request (
firstName+lastName,billingAddress,company), and the assigned expert is shown where to deliver the appraisal (the testimony'sshippingAddress: the one sent here, or the billing address and the payer's name when none was sent). A later profile change or another order does not alter them. Checking out again before paying replaces them. - The profile is overwritten with them, so that Show Current User can prefill the next order. A
shippingAddressorcompanyleft out is removed from the profile, not kept from an earlier order; an empty object counts as left out.
Address Object
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | No | Recipient's first name (shipping addresses only; required at checkout). Max 255 characters; letters, combining marks, spaces and ' ’ . , - only. |
lastName | string | No | Recipient's last name (shipping addresses only). Same rules as firstName. |
line1 | string | Yes | Street address (e.g., "Trieda Andreja Hlinku"). Max 255 characters. |
line2 | string | Yes | Additional address info (e.g., unit number). Must be a non-empty string — "" and null are rejected. Max 255 characters. |
city | string | Yes | City name. Max 255 characters. |
postalCode | string | Yes | Postal code. Max 255 characters. |
country | string | Yes | ISO 3166-1 Alpha-2 country code (e.g., SK, CZ, HU). |
Address Types
- Billing Address: Contains core address fields only (no name fields)
- Shipping Address: Clients only. Responses always carry
firstNameandlastName(nullwhen unset). Checkout Offer requires both whenever a shipping address is sent; Update Client Profile takes them as optional - Partial updates: the profile update endpoints accept a subset of the fields once the address exists — see Update Current User
Example (Shipping Address):
{
"firstName": "Anton",
"lastName": "Čomáš",
"line1": "Trieda Andreja Hlinku",
"line2": "1/14A",
"city": "Nitra",
"postalCode": "949 01",
"country": "SK"
}Example (Billing Address):
{
"line1": "Trieda Andreja Hlinku",
"line2": "1/14A",
"city": "Nitra",
"postalCode": "949 01",
"country": "SK"
}CheckoutCompany Object
| Attribute | Description |
|---|---|
businessId string | Company business ID (max 255 chars). Required when company is sent. |
taxId string | Company tax ID (max 255 chars). Required when company is sent. |
vatId string, nullable, optional | VAT ID if applicable (max 255 chars). |
Response
200 OK
Returns a JSON object with the Stripe checkout URL.
{
"data": {
"url": "https://checkout.stripe.com/c/pay/cs_test_a1..."
}
}Next Steps:
- Redirect user to
urlto complete payment on Stripe - After payment, Stripe redirects back to the success page configured on the backend with
?testimonyId={testimonyId}&offerId={offerId}&sessionId={sessionId}appended (the cancel page receives the same parameters) - Call Accept Offer with the offer ID and the session ID to complete the process
Calling this endpoint again for the same testimony (for any of its offers) returns a new URL and expires the previously issued, still-open Stripe session — always use the most recent URL.
Error Handling
Validation Errors
422 Unprocessable Content
{
"message": "Telefónne číslo už existuje.",
"errors": {
"phone": [
"Telefónne číslo už existuje."
]
}
}Returned when:
- Phone number is used by another user
- Phone number is not a valid international number
- Required fields are missing or invalid (
line2must be a non-empty string) firstNameorlastNamecontains characters outside the allowed set
Business Errors
422 Unprocessable Content with a plain message:
Pri spracovaní platby nastala chyba. Skúste to znova.— Stripe rejected the request
502 Bad Gateway with the same message — Stripe could not be reached, rate-limited the request or answered with a server error; retry later.
409 Conflict with a plain message:
Platbu je možné začať len pri posudku s aktívnou ponukou.— the testimony is no longeroffered(cancelled, or another offer was already paid)Táto ponuka už nie je dostupná.— the offer was withdrawn by its expert, or the expert is not approved or is suspended. Nothing is saved and no session is created; offer the client another offerPre váš účet sa ešte pripravuje iná platba. Skúste to o chvíľu znova.— a concurrent checkout for this client is still syncing its Stripe customer account; retry in a momentTento znalec momentálne nemôže prijímať platby. Vyberte inú ponuku alebo to skúste neskôr.— the expert's Stripe account cannot receive payments right now (no account yet, or Stripe restricted itscard_payments/stripe_transferscapability). Checked before anything else happens: the client profile is not updated, no checkout attempt is recorded, and a previously issued checkout URL for the testimony stays valid. Retrying does not help until the expert's account is fixed — offer the client another offer.
Rate Limit
429 Too Many Requests — more than 3 checkout attempts per minute for this user.
Payment Initialization Failed
500 Internal Server Error
{
"message": "An unexpected error occurred."
}Returned when the Stripe checkout session cannot be created due to a system error.
Authentication
Requires authentication via Bearer token and a verified email. Only the client who owns the offer's testimony may check it out (403 Forbidden otherwise); an unknown offer ID answers 404 Not Found.
401 Unauthorized
{
"message": "Unauthenticated."
}Requirements
- Authentication: Bearer token required, email verified
- Role: Client only — and the testimony must belong to the client (
403 Forbiddenotherwise) - Testimony State: Must be in
offeredstate - Expert: The offer's expert must be approved, not suspended, and able to receive payments on Stripe
- Phone: Must not belong to another user
Notes
- Creates a Stripe checkout session for the offer
price, which already includes the platform commission — see Offer Object - The session accepts card payments only (Apple Pay and Google Pay included)
- Phone number must be unique across all users