Intent
Overview
The /api/v1/payments/intent endpoint allows third-party applications to initiate payment intents for processing payments. This endpoint creates a payment intent with the specified amount and supported payment method types, returning a payment intent secret for client-side payment processing.
Base URLs
- Production:
https://api.care360-next.carevalidate.com/api/v1/payments/intent - Staging:
https://api-staging.care360-next.carevalidate.com/api/v1/payments/intent
Method: POST
Authentication
Required Headers
cv-api-key: your-secret-api-key
Content-Type: application/json
The cv-api-key is your organization's secret API key provided by CareValidate.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Payment amount (e.g: 1.15 equals $1.15) |
paymentMethodTypes | array | No | Array of supported payment method types |
Payment Method Types
The paymentMethodTypes array can include any of the payment method types supported by Stripe. For a comprehensive list of supported payment methods, refer to Stripe's Payment Methods documentation.
Common payment method types include:
"card"- Credit/debit card payments"klarna"- Klarna buy now, pay later"affirm"- Affirm buy now, pay later
Request Examples
Basic Payment Intent
{
"amount": 100
}
Payment Intent with Multiple Payment Methods
{
"amount": 100,
"paymentMethodTypes": ["affirm", "klarna", "card"]
}
Response Format
Success Response
HTTP Status: 200 OK
{
"status": 200,
"success": true,
"message": "payment Intent initiated successfully",
"data": {
"paymentIntentSecret": "pi_3SG0o8GkkQS2eXzh0BKpSaq0_secret_CBrwqmT726jzfcnvCt0qBcS9e"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
status | number | HTTP status code |
success | boolean | Indicates if the payment intent was created successfully |
message | string | Success message describing the operation |
data | object | Contains the payment intent information |
data.paymentIntentSecret | string | Secret key for client-side payment processing |
cURL Examples
Create Payment Intent
curl -X POST "https://api.care360-next.carevalidate.com/api/v1/payments/intent" \
-H "cv-api-key: YOUR_SECRET_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"paymentMethodTypes": ["affirm", "klarna", "card"]
}'
Create Payment Intent (Minimal)
curl -X POST "https://api.care360-next.carevalidate.com/api/v1/payments/intent" \
-H "cv-api-key: YOUR_SECRET_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500
}'
Error Responses
Missing Required Parameters
HTTP Status: 400 Bad Request
{
"success": false,
"message": "Amount is required"
}
Invalid Amount
HTTP Status: 400 Bad Request
{
"success": false,
"message": "Amount must be a positive number"
}
Invalid Payment Method Types
HTTP Status: 400 Bad Request
{
"success": false,
"message": "Invalid payment method types"
}
Authentication Errors
HTTP Status: 401 Unauthorized
{
"status": 401,
"error": "Invalid API key"
}
Internal Server Error
HTTP Status: 500 Internal Server Error
{
"success": false,
"message": "Internal server error"
}
Changelog
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2025-01-27 | Initial Payment Intent API documentation |