Start saving a card for a patient
/care/v1/patient/{patient_id}/payment-method/setup/create/documentpatient:writeBAA requiredStarts saving a card to the patient's Nurish'd account. A visit cannot be booked for a patient until a card is saved, because the visit, a late-cancellation fee and a no-show fee are charged later to the patient's default card. The order of calls is: connect the patient, save a card, book.
The card number never reaches your server or ours. Your page loads Stripe.js with the answered
stripe_publishable_key and confirms the card with the answered client_secret: the patient
types the card into Stripe's own form on your page. Then call the confirm route with
the answered id. Never log the client secret.
The card is saved to the patient's Nurish'd account and may be charged for visits, late- cancellation fees and no-show fees. Tell the patient so before they type the card in.
Calling it again returns the same open setup while it is less than a day old. The patient must
have an active connection with your company that allows bookings. Answers 404 when the
patient has no connection with your company that allows care, 403 connection_scope_not_granted when the patient did not allow bookings, and 409 connection_not_active when the connection is pending or was revoked.
Needs the patient:write scope.
Path parameters
patient_idstring (uuid)requiredThe ID of the patient, as the create-patient route answered it.
Response 200
client_secretstringrequiredThe secret the card form confirms the card with. Give it to Stripe.js on your page, never to anything else, and never log it.
idstringrequiredThe ID of the setup. Send it back to the confirm route once the card form has confirmed the card.
statusstringrequiredWhere the setup is, for example
requires_payment_methoduntil a card is typed in.stripe_publishable_keystringnullableThe Stripe publishable key to load Stripe.js with, or
nullwhen none is configured.
Errors
Every error has this shape. Branch on code, not on message. request_id equals the X-Request-Id response header.
{
"error": {
"code": "not_found",
"message": "The object does not exist.",
"request_id": "req_0123456789abcdef0123456789abcdef"
}
}| Status | Code | Meaning |
|---|---|---|
401 | invalid_api_key | The API key is missing or not valid. |
403 | company_archived | This company is archived. |
403 | company_not_live | The company must be live to use prod keys. |
403 | company_suspended | This company is suspended. |
403 | connection_scope_not_granted | The connection does not hold the care.bookings scope. |
403 | scope_not_granted | This API key does not have the patient:write scope. |
404 | not_found | The requested resource was not found. |
409 | connection_not_active | The connection is not active. |
422 | validation_error | path.patient_id: Input should be a valid UUID, invalid character: found n at 0 |
429 | rate_limited | Too many requests. Wait before calling again. |
500 | internal_error | Something went wrong on our side. Please try again later. |
502 | upstream_error | A Nurish'd service could not complete the request. |
503 | upstream_unavailable | A Nurish'd service is unavailable. Please try again later. |
504 | upstream_timeout | A Nurish'd service did not answer in time. Please try again. |