Skip to main content

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

ParameterTypeRequiredDescription
amountnumberYesPayment amount (e.g: 1.15 equals $1.15)
paymentMethodTypesarrayNoArray of supported payment method types
metadataobjectNoOptional metadata to be stored with the payment intent

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"],
"metadata": { // optional
"email": "testemail@example.com", // optional
"phone": "+1404567890" // optional
}
}

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

FieldTypeDescription
statusnumberHTTP status code
successbooleanIndicates if the payment intent was created successfully
messagestringSuccess message describing the operation
dataobjectContains the payment intent information
data.paymentIntentSecretstringSecret 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"],
"metadata": { // optional
"email": "testemail@example.com", // optional
"phone": "+1404567890" // optional
}
}'

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

VersionDateChanges
1.02025-01-27Initial Payment Intent API documentation