Payments Endpoint
The Payments endpoint allows you to manage payment methods, process credit purchases, and view payment history within the Clipron AI platform.Add Payment Method
Add a new payment method (e.g., credit card) to your account. This typically involves securely tokenizing card details via a payment gateway.Request
POST /api/v1/payments/methods
Headers
Authorization: Bearer YOUR_JWT_TOKENContent-Type: application/json
Body
Response
201 Created
Errors
400 Bad Request: If payment token or billing details are invalid.401 Unauthorized: If no valid authentication token is provided.403 Forbidden: If the token is valid but does not have access.
Get Payment Methods
Retrieve a list of payment methods associated with your account.Request
GET /api/v1/payments/methods
Headers
Authorization: Bearer YOUR_JWT_TOKEN
Response
200 OK
Errors
401 Unauthorized: If no valid authentication token is provided.
Purchase Credits
Initiate a purchase of credits using a specified payment method.Request
POST /api/v1/payments/purchase-credits
Headers
Authorization: Bearer YOUR_JWT_TOKENContent-Type: application/json
Body
Response
200 OK
Errors
400 Bad Request: If amount, currency, or payment method is invalid.401 Unauthorized: If no valid authentication token is provided.402 Payment Required: If the payment fails (e.g., insufficient funds, declined card).403 Forbidden: If the token is valid but does not have access.
Get Payment History
Retrieve a history of all payment transactions (purchases, refunds).Request
GET /api/v1/payments/history
Headers
Authorization: Bearer YOUR_JWT_TOKEN
Query Parameters
limit(optional): Maximum number of transactions to return (default: 100).offset(optional): Number of transactions to skip (for pagination).start_date(optional): Filter transactions from this date (ISO 8601 format).end_date(optional): Filter transactions up to this date (ISO 8601 format).
Response
200 OK
Errors
401 Unauthorized: If no valid authentication token is provided.403 Forbidden: If the token is valid but does not have access.400 Bad Request: If query parameters are invalid.