# Cards

Stored and saved card management

## GET /users/saved-cards/

> List saved cards

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Cards","description":"Stored and saved card management"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"security":[{"SessionCookie":[]}],"components":{"securitySchemes":{"SessionCookie":{"type":"apiKey","in":"header","name":"Cookie","description":"Session cookie (e.g., `sessionid=abc123`)"}},"parameters":{"SessionCookieHeader":{"name":"Cookie","in":"header","required":true,"description":"Session cookie header (e.g. `sessionid=abc123`)","schema":{"type":"string"}}},"schemas":{"SavedCard":{"type":"object","description":"Saved card resource returned by saved-cards endpoints. Fields mirror `omnishop.payments.models.SavedCard`.","required":["pk","masked_card_number","token","user"],"properties":{"pk":{"type":"integer","description":"Saved card identifier"},"name":{"type":["string","null"],"description":"User-defined card label"},"token":{"type":"string","description":"Gateway token for the saved card (opaque)"},"user":{"type":"integer","description":"Owner user ID"},"masked_card_number":{"type":"string","description":"Masked PAN (e.g., **** **** **** 1234)"},"pos":{"type":["integer","null"],"description":"POS identifier associated with the card"},"created_date":{"type":"string","format":"date-time","description":"Creation timestamp"},"modified_date":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}},"paths":{"/users/saved-cards/":{"get":{"tags":["Cards"],"operationId":"listSavedCards","summary":"List saved cards","parameters":[{"$ref":"#/components/parameters/SessionCookieHeader"}],"responses":{"200":{"description":"Saved cards listed","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SavedCard"}}}}},"401":{"description":"Authentication required"}}}}}}
```

## GET /users/saved-cards/{pk}/

> Retrieve saved card

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Cards","description":"Stored and saved card management"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"security":[{"SessionCookie":[]}],"components":{"securitySchemes":{"SessionCookie":{"type":"apiKey","in":"header","name":"Cookie","description":"Session cookie (e.g., `sessionid=abc123`)"}},"parameters":{"SessionCookieHeader":{"name":"Cookie","in":"header","required":true,"description":"Session cookie header (e.g. `sessionid=abc123`)","schema":{"type":"string"}}},"schemas":{"SavedCard":{"type":"object","description":"Saved card resource returned by saved-cards endpoints. Fields mirror `omnishop.payments.models.SavedCard`.","required":["pk","masked_card_number","token","user"],"properties":{"pk":{"type":"integer","description":"Saved card identifier"},"name":{"type":["string","null"],"description":"User-defined card label"},"token":{"type":"string","description":"Gateway token for the saved card (opaque)"},"user":{"type":"integer","description":"Owner user ID"},"masked_card_number":{"type":"string","description":"Masked PAN (e.g., **** **** **** 1234)"},"pos":{"type":["integer","null"],"description":"POS identifier associated with the card"},"created_date":{"type":"string","format":"date-time","description":"Creation timestamp"},"modified_date":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}},"paths":{"/users/saved-cards/{pk}/":{"get":{"tags":["Cards"],"operationId":"retrieveSavedCard","summary":"Retrieve saved card","parameters":[{"$ref":"#/components/parameters/SessionCookieHeader"},{"in":"path","name":"pk","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Saved card retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedCard"}}}},"401":{"description":"Authentication required"},"404":{"description":"Card not found"}}}}}}
```

## DELETE /users/saved-cards/{pk}/

> Delete saved card

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Cards","description":"Stored and saved card management"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"security":[{"SessionCookie":[]}],"components":{"securitySchemes":{"SessionCookie":{"type":"apiKey","in":"header","name":"Cookie","description":"Session cookie (e.g., `sessionid=abc123`)"}},"parameters":{"SessionCookieHeader":{"name":"Cookie","in":"header","required":true,"description":"Session cookie header (e.g. `sessionid=abc123`)","schema":{"type":"string"}},"CSRFTokenHeader":{"name":"X-CSRFToken","in":"header","required":true,"description":"CSRF token header for unsafe methods (POST/PUT/PATCH/DELETE)","schema":{"type":"string"}}}},"paths":{"/users/saved-cards/{pk}/":{"delete":{"tags":["Cards"],"operationId":"deleteSavedCard","summary":"Delete saved card","parameters":[{"$ref":"#/components/parameters/SessionCookieHeader"},{"$ref":"#/components/parameters/CSRFTokenHeader"},{"in":"path","name":"pk","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Saved card deleted"},"401":{"description":"Authentication required"},"404":{"description":"Card not found"}}}}}}
```

## PATCH /users/saved-cards/{pk}/

> Update saved card

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Cards","description":"Stored and saved card management"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"security":[{"SessionCookie":[]}],"components":{"securitySchemes":{"SessionCookie":{"type":"apiKey","in":"header","name":"Cookie","description":"Session cookie (e.g., `sessionid=abc123`)"}},"parameters":{"SessionCookieHeader":{"name":"Cookie","in":"header","required":true,"description":"Session cookie header (e.g. `sessionid=abc123`)","schema":{"type":"string"}},"CSRFTokenHeader":{"name":"X-CSRFToken","in":"header","required":true,"description":"CSRF token header for unsafe methods (POST/PUT/PATCH/DELETE)","schema":{"type":"string"}}},"schemas":{"SavedCardUpdate":{"type":"object","description":"Fields allowed for saved card update","properties":{"name":{"type":["string","null"],"description":"User-defined card label"}}},"SavedCard":{"type":"object","description":"Saved card resource returned by saved-cards endpoints. Fields mirror `omnishop.payments.models.SavedCard`.","required":["pk","masked_card_number","token","user"],"properties":{"pk":{"type":"integer","description":"Saved card identifier"},"name":{"type":["string","null"],"description":"User-defined card label"},"token":{"type":"string","description":"Gateway token for the saved card (opaque)"},"user":{"type":"integer","description":"Owner user ID"},"masked_card_number":{"type":"string","description":"Masked PAN (e.g., **** **** **** 1234)"},"pos":{"type":["integer","null"],"description":"POS identifier associated with the card"},"created_date":{"type":"string","format":"date-time","description":"Creation timestamp"},"modified_date":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}},"paths":{"/users/saved-cards/{pk}/":{"patch":{"tags":["Cards"],"operationId":"updateSavedCard","summary":"Update saved card","parameters":[{"$ref":"#/components/parameters/SessionCookieHeader"},{"$ref":"#/components/parameters/CSRFTokenHeader"},{"in":"path","name":"pk","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedCardUpdate"}}}},"responses":{"200":{"description":"Saved card updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedCard"}}}},"401":{"description":"Authentication required"},"404":{"description":"Card not found"}}}}}}
```

## List stored cards

> Returns stored cards for the authenticated user.

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Cards","description":"Stored and saved card management"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"security":[{"SessionCookie":[]}],"components":{"securitySchemes":{"SessionCookie":{"type":"apiKey","in":"header","name":"Cookie","description":"Session cookie (e.g., `sessionid=abc123`)"}},"parameters":{"SessionCookieHeader":{"name":"Cookie","in":"header","required":true,"description":"Session cookie header (e.g. `sessionid=abc123`)","schema":{"type":"string"}}},"schemas":{"StoredCard":{"type":"object","description":"Stored card resource returned by stored-cards endpoint","additionalProperties":true}}},"paths":{"/users/stored-cards/":{"get":{"tags":["Cards"],"operationId":"listStoredCards","summary":"List stored cards","parameters":[{"$ref":"#/components/parameters/SessionCookieHeader"}],"description":"Returns stored cards for the authenticated user.","responses":{"200":{"description":"Stored cards listed","content":{"application/json":{"schema":{"type":"object","properties":{"cards":{"type":"array","items":{"$ref":"#/components/schemas/StoredCard"}}}}}}},"401":{"description":"Authentication required"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/users/module-4/cards.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
