Cards
List and delete a customer's saved cards
These endpoints manage the Visa / Mastercard cards saved to a customer's account. They are called in a user-authenticated context (the customer's access token), not with your service client credentials.
Cards are saved automatically
A card is saved to the customer's account automatically when they pay with a new card on the hosted card page — you do not save it yourself. See the Card Payments guide. Saved cards also appear inline in the Payment Methods list.
List Cards#
Returns the cards saved to the customer's account.
GET
/api/v1/cardsBearer Token
List the customer's saved cards.
Query Parameters#
pmCodestringoptionalFilter by payment method code (the card method's
code).Required Headers#
AuthorizationstringrequiredBearer authentication.
x-client-tokenstringrequiredThe customer's access token.
x-servicestringrequiredYour service code.
x-platformstringrequiredThe platform making the request.
Allowed values:
APIWEBANDROIDIOSOrdering#
Ordering is owned by the backend, not the client. Cards are returned most recently used first, then most recently saved first. Render them in the order received so every surface shows the buyer the same default card.
Response Fields#
data[].idstringrequiredThe saved card's ID. Use this as
cardId when proceeding with a payment.data[].brandstringrequiredThe card brand. Example:
visadata[].last4stringrequiredThe last four digits of the card. Example:
3456data[].numberstringoptionalDeprecated alias of
last4, kept for existing clients. Use last4.data[].expMonthnumberoptionalExpiry month, 1–12.
null when the provider did not return one.data[].expYearnumberoptionalExpiry year, four digits.
null when the provider did not return one.data[].paymentMethodIdstringrequiredThe payment method that owns this card.
data[].paymentMethodCodestringoptionalCode of the owning payment method. Example:
STRIPEdata[].isMostRecentlyUsedbooleanoptionalWhether this is the card the buyer used most recently. Exactly one saved card carries
true, and it is returned first.data[].createdAtstringoptionalWhen the card was saved, ISO 8601.
List Cards
curl "https://api.payment.yassir.io/api/v1/cards" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-client-token: CUSTOMER_ACCESS_TOKEN" \
-H "x-service: YOUR_SERVICE" \
-H "x-platform: API"curl "https://api.payment.yassir.io/api/v1/cards" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-client-token: CUSTOMER_ACCESS_TOKEN" \
-H "x-service: YOUR_SERVICE" \
-H "x-platform: API"200 OK
{
"data": [
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"brand": "visa",
"last4": "3456",
"number": "3456",
"expMonth": 4,
"expYear": 2028,
"paymentMethodId": "1330fa89-4115-43b1-b34d-0e3df2e6a5ba",
"paymentMethodCode": "STRIPE",
"isMostRecentlyUsed": true,
"createdAt": "2026-03-20T10:00:00.000Z"
}
],
"message": "card listed successfully"
}{
"data": [
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"brand": "visa",
"last4": "3456",
"number": "3456",
"expMonth": 4,
"expYear": 2028,
"paymentMethodId": "1330fa89-4115-43b1-b34d-0e3df2e6a5ba",
"paymentMethodCode": "STRIPE",
"isMostRecentlyUsed": true,
"createdAt": "2026-03-20T10:00:00.000Z"
}
],
"message": "card listed successfully"
}Delete a Card#
Removes a saved card from the customer's account.
DELETE
/api/v1/cards/:idBearer Token
Delete a saved card.
URL Parameters#
idstringrequiredThe card ID (the
data[].id from List Cards).Required Headers#
AuthorizationstringrequiredBearer authentication.
x-client-tokenstringrequiredThe customer's access token.
x-country-codestringrequiredISO 3166-1 alpha-3 country code.
Delete a Card
curl -X DELETE "https://api.payment.yassir.io/api/v1/cards/d290f1ee-6c54-4b01-90e6-d701748f0851" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-client-token: CUSTOMER_ACCESS_TOKEN" \
-H "x-country-code: DZA"curl -X DELETE "https://api.payment.yassir.io/api/v1/cards/d290f1ee-6c54-4b01-90e6-d701748f0851" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-client-token: CUSTOMER_ACCESS_TOKEN" \
-H "x-country-code: DZA"200 OK
{
"data": null,
"message": "card deleted successfully"
}{
"data": null,
"message": "card deleted successfully"
}