# Discover Payment Cards v2.0Beta

The Discover Payment Cards endpoint retrieves payment cards for a customer from our payment processor.

These payment cards can be used to add payments for the cart using the Add Card Payment endpoint.

Whilst the List Payment Cards endpoint may return all payment cards linked to the customers profile, including expired ones, the list of cards returned from this endpoint will only return cards that can be used for payment. Expired cards will not be returned and no cards could be returned if the customer does not have any saved cards or if the cards they have saved have all expired.

# Request

POST /v2.0/customers/{profileKey}/carts/{cartId}/discovery/payments/cards

# Authorization

An OAuth 2.0 Bearer token with the Payment.Read scope is required. For more information, see Authentication.

# Path Parameters

A list of the supported path parameters is described below.

Name Required Type Description
profileKey true guid The profile key for the customer.
cartId true guid The cart id for the cart.

# Response

200
OK
Returns an ApiListResponse envelope.

# Response Body

The endpoint returns our ApiListResponse envelope. The data property of the response will contain an array of PaymentCard resources.

# Sample

{
  "message": "The operation succeeded! 2 records returned.",
  "notifications": [],
  "numberOfRecords": 2,
  "totalRecords": 0,
  "data": [
    {
			"cardId": "30bc84be-7481-4b2a-9c4e-c7dfed6f7e05",
			"instrumentType": "Bank Card",
			"cardHolderName": "Mr C Holder",
			"label": null,
			"acceptanceBrand": "Visa",
			"last4Digits": "0002",
			"status": "Active",
			"createdOn": "2022-02-08T00:00:00"
		},
		{
			"cardId": "daf1536b-403e-44e2-8811-332332bc7714",
			"instrumentType": "Bank Card",
			"cardHolderName": "Mr C Holder",
			"label": null,
			"acceptanceBrand": "Visa",
			"last4Digits": "0002",
			"status": "Active",
			"createdOn": "2022-02-07T00:00:00"
		}
  ]
}

# Errors

The standard error responses apply.

400
Bad Request
When the request fails validation.
401
Unauthorized
When authentication fails.
403
Forbidden
When authorisation fails.
404
Not Found
When the cart cannot be found.