Skip to content

Checkout credit card payment

POST
/api/v1/payments/credit_card

Initiate a credit card payment session.

StartPaymentRequest

Request model for initiating a Stripe payment session.

object
organization_id
Any of:
integer
credit_plan_id
required
Credit Plan Id

The ID of the credit plan being purchased.

integer
quantity
Quantity

The quantity of the credit plan being purchased.

integer
default: 1
success_url
required
Success Url

The URL to redirect to after a successful payment (e.g., https://staging.gen.pro/success-payment).

string
cancel_url
required
Cancel Url

The URL to redirect to if the payment is cancelled (e.g., https://staging.gen.pro/cancel-payment).

string
agent_id
Any of:
string
social_account_identifier
Any of:
string

Successful Response

StartPaymentResponse

Response model containing the generated payment link.

object
payment_link
required
Payment Link

The Stripe checkout session URL for the user to complete the payment.

string

Bad Request

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string

Not Found

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string

Invalid redirect URLs, organization not found/not owner, plan already active, or invalid payment option.

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string
Example
{
"error": "Plan already active for this organization",
"error_code": "plan_already_active"
}

Internal Server Error

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string