Update user payment
POST
/api/v1/usersUpdates the saved payment method and shipping address for an existing user.
cv-api-key
Production
https://api.care360-next.carevalidate.com/api/v1/usersStaging
https://api-staging.care360-next.carevalidate.com/api/v1/usersHeaders
Headers
cv-api-keystringrequiredYour unique API key for authentication.
Content-TypestringrequiredMust be application/json.
Example:
application/jsonRequest Body
Body Parameters
actionstringrequiredThe action to be performed. Must be UPDATE_PAYMENT_INFO.
Values:UPDATE_PAYMENT_INFO
emailstringrequiredThe user's email address.
Example:
john@example.comdataobjectrequiredAn object containing the payment details.
Show 3 child properties
stripeSetupIdstringrequiredThe Stripe setup ID.
nmiPaymentTokenstringrequiredThe NMI payment token.
shippingAddressobjectrequiredThe shipping address.
Show 6 child properties
addressLine1stringrequiredStreet address line 1
Example:
1600 Pennsylvania Avenue NWaddressLine2stringrequiredStreet address line 2 (e.g., apartment or suite number)
citystringrequiredCity
Example:
WashingtonstatestringrequiredUS state abbreviation (e.g., DC, NY)
Example:
DCcountrystringrequiredCountry code (e.g., US)
Example:
USpostalCodestringrequiredPostal or ZIP code
Example:
20500Example Request
- cURL
- JavaScript
- Python
curl --location '<BASE_URL>/api/v1/users' \
--header 'cv-api-key: <redacted>' \
--header 'Content-Type: application/json' \
--data-raw '{
"action": "UPDATE_PAYMENT_INFO",
"email": "john@example.com",
"data": {
"stripeSetupId": "<redacted>",
"nmiPaymentToken": "<redacted>",
"shippingAddress": {
"addressLine1": "1600 Pennsylvania Avenue NW",
"addressLine2": "",
"city": "Washington",
"state": "DC",
"country": "US",
"postalCode": "20500"
}
}
}'
const response = await fetch('<BASE_URL>/api/v1/users', {
method: 'POST',
headers: {
'cv-api-key': '<redacted>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'UPDATE_PAYMENT_INFO',
email: 'john@example.com',
data: {
stripeSetupId: '<redacted>',
nmiPaymentToken: '<redacted>',
shippingAddress: {
addressLine1: '1600 Pennsylvania Avenue NW',
addressLine2: '',
city: 'Washington',
state: 'DC',
country: 'US',
postalCode: '20500',
},
},
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'<BASE_URL>/api/v1/users',
headers={
'cv-api-key': '<redacted>',
'Content-Type': 'application/json',
},
json={
'action': 'UPDATE_PAYMENT_INFO',
'email': 'john@example.com',
'data': {
'stripeSetupId': '<redacted>',
'nmiPaymentToken': '<redacted>',
'shippingAddress': {
'addressLine1': '1600 Pennsylvania Avenue NW',
'addressLine2': '',
'city': 'Washington',
'state': 'DC',
'country': 'US',
'postalCode': '20500',
},
},
},
)
print(response.json())
Responses
▶200Payment updated successfullyThe payment details were updated successfully.
{
"status": 200,
"success": true,
"data": {
"code": "PAYMENT_SETUP_UPDATED"
}
}
▶400User does not existThe email provided does not match an existing user.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "User {email} does not exist"
}
▶400Invalid Stripe setup IDThe stripeSetupId does not match an existing setup intent.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "No such setupintent: 'seti_1SNZDLKAXrtjbq2duGldHsHf'"
}
Try It Out
Try itAPI Playground
▶