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.
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). Must be unique and different from authenticated user's phone. See Phone Numbers. |
firstName string | Client's first name (max 255 chars). |
lastName string | Client's last name (max 255 chars). |
billingAddress object, Address | Billing address for the payment. |
shippingAddress object, Address, optional | Shipping address. If omitted, billing address is used. |
company object, CheckoutCompany, optional | Company information for business purchases. |
Address Object
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | No | Contact's first name (for shipping addresses only). |
lastName | string | No | Contact's last name (for shipping addresses only). |
line1 | string | Yes | Street address (e.g., "Trieda Andreja Hlinku"). Max 255 characters. |
line2 | string | No | Additional address info (e.g., unit number). 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"). 2 chars. |
Address Types
- Billing Address: Contains core address fields only (no name fields)
- Shipping Address: Includes optional
firstNameandlastNamefields for delivery contact - Checkout Address: All fields have a maximum length of 255 characters
Example (Shipping Address):
json
{
"firstName": "Anton",
"lastName": "Čomáš",
"line1": "Trieda Andreja Hlinku",
"line2": "1/14A",
"city": "Nitra",
"postalCode": "949 01",
"country": "SK"
}Example (Billing Address):
json
{
"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). |
taxId string | Company tax ID (max 255 chars). |
vatId string, optional | VAT ID if applicable (max 255 chars). |
Response
200 OK
Returns a JSON object with the Stripe checkout URL.
json
{
"data": {
"url": "https://checkout.stripe.com/c/pay/cs_test_a1..."
}
}Next Steps:
- Redirect user to
urlto complete payment on Stripe - After successful payment, Stripe redirects back with
sessionId - Call Accept Offer with the session ID to complete the process
Error Handling
Validation Errors
422 Unprocessable Content
json
{
"message": "The phone has already been taken.",
"errors": {
"phone": [
"The phone has already been taken."
]
}
}Returned when:
- Phone number is already in use
- Phone number matches authenticated user's phone
- Phone number is not a valid international number
- Required fields are missing or invalid
Payment Initialization Failed
500 Internal Server Error
json
{
"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.
401 Unauthorized
json
{
"message": "Unauthenticated."
}Requirements
- Authentication: Bearer token required
- Role: Client only
- Testimony State: Must be in
offeredstate - Phone: Must be unique and different from authenticated user's phone
Notes
- Creates a Stripe checkout session for the offer amount plus platform commission (21%)
- Phone number must be unique across all users
- If no shipping address is provided, billing address is used for both