Finish saving a card for a patient
/care/v1/patient/{patient_id}/payment-method/setup/{setup_id}/confirm/documentpatient:writeBAA requiredCall it after Stripe.js confirmed the card on your page. It checks the setup, makes sure the
card is recorded on the patient's Nurish'd account, and answers the card. When the patient had
no default card, the card becomes their default card, the one visits and fees are charged to.
A patient who already has a default card keeps it, and the answer says is_default: false.
Calling it again for the same setup is safe, and it does not wait for any notification, so call
it right after the card form says it worked. Answers 409 payment_method_setup_incomplete when
the card form has not confirmed the card yet, 404 for a setup that is not this patient's, and
the same 404, 403 and 409 as the start route for the patient's connection.
Needs the patient:write scope.
Path parameters
patient_idstring (uuid)requiredThe ID of the patient, as the create-patient route answered it.
setup_idstringrequiredThe ID of the setup, as the start route answered it.
Min length 1 · Max length 200 · Pattern ^[A-Za-z0-9_-][A-Za-z0-9._-]{0,199}$
Response 200
cardPaymentMethodCardrequiredThe card details: brand, expiry month and year, and the last four digits.
Show child attributesHide child attributes
brandstringrequiredThe card brand, for example
visaormastercard.exp_monthintegerrequiredThe month the card expires, 1 to 12.
exp_yearintegerrequiredThe four-digit year the card expires.
last4stringrequiredThe last four digits of the card.
idstringrequiredThe ID of the card.
is_defaultbooleanrequiredWhether this is the person's default card, the one later charges use.
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. |
409 | payment_method_setup_incomplete | The card has not been confirmed with the card form yet. Confirm it on your page, then call this route again. |
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. |