List a customer's saved cards
/meals/v1/customer/{customer_id}/payment-method/query/documentsorder:readReturns the cards saved to the customer's Nurish'd account, at most 10, in one page. Each card
has id, card (brand, exp_month, exp_year and last4) and is_default, which is true
for the customer's default card. The customer can also add, remove and choose cards in their
own account, so the list can change without you. A customer with no card gets an empty list.
Answers 404 when the customer has no connection with your company that allows meals, 403 connection_scope_not_granted when the customer did not allow orders, and 409 connection_not_active when the connection is pending or was revoked.
Needs the order:read scope.
Path parameters
customer_idstring (uuid)requiredThe ID of the customer, as the create-customer route answered it.
Response 200
dataarray of PaymentMethodrequiredThe saved cards. At most 10.
Show child attributesHide child attributes
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.
has_nextbooleanrequiredWhether the data has a next page or not
has_previousbooleanrequiredWhether the data has a previous page or not
pageintegerrequiredThe page number of the data
sizeintegerrequiredThe size of the data
totalintegerrequiredThe total number of data
total_pagesintegerrequiredThe total number of pages
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 | scope_not_granted | This API key does not have the order:read scope. |
404 | not_found | The requested resource was not found. |
409 | connection_not_active | The connection is not active. |
422 | validation_error | path.customer_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. |