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/cards
Bearer Token
List the customer's saved cards.

Query Parameters#

pmCodestringoptional
Filter by payment method code (the card method's code).

Required Headers#

Authorizationstringrequired
Bearer authentication.
x-client-tokenstringrequired
The customer's access token.
x-servicestringrequired
Your service code.
x-platformstringrequired
The platform making the request.
Allowed values:
APIWEBANDROIDIOS

Response Fields#

data[].idstringrequired
The saved card's ID. Use this as cardId when proceeding with a payment.
data[].brandstringrequired
The card brand. Example: visa
data[].numberstringrequired
The last four digits of the card. Example: 3456
data[].expMonthnumberoptional
The card expiration month.
data[].expYearnumberoptional
The card expiration year.
data[].isMostRecentlyUsedbooleanoptional
Whether this is the most recently used card.
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"
200 OK
{
  "data": [
    {
      "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "paymentMethodId": "1330fa89-4115-43b1-b34d-0e3df2e6a5ba",
      "customerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "brand": "visa",
      "number": "3456",
      "expMonth": 4,
      "expYear": 2028,
      "isMostRecentlyUsed": true
    }
  ],
  "message": "card listed successfully"
}

Delete a Card#

Removes a saved card from the customer's account.

DELETE/api/v1/cards/:id
Bearer Token
Delete a saved card.

URL Parameters#

idstringrequired
The card ID (the data[].id from List Cards).

Required Headers#

Authorizationstringrequired
Bearer authentication.
x-client-tokenstringrequired
The customer's access token.
x-country-codestringrequired
ISO 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"
200 OK
{
  "data": null,
  "message": "card deleted successfully"
}