> For the complete documentation index, see [llms.txt](https://docs.ecommerce.seb.ee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecommerce.seb.ee/seb-docs-draft/seb-docs-public-et/api-viide/kaupmehe-api/gateway-tokens.md).

# Gateway Tokens

Retrieve Gateway tokens and update token status

## Get token information

> Retrieve token status and other non-sensitive data.

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"Retrieve Gateway tokens and update token status","name":"Gateway Tokens"}],"servers":[{"description":"Production server for live traffic","url":"https://api.ecommerce.seb.ee"},{"description":"Sandbox testing environment","url":"https://sandbox.api.ecommerce.seb.ee"}],"security":[{"oauth2ClientCredentials":[]}],"components":{"securitySchemes":{"oauth2ClientCredentials":{"flows":{"clientCredentials":{"scopes":{},"tokenUrl":"https://api.ecommerce.seb.ee/auth/realms/participants-seb/protocol/openid-connect/token"}},"type":"oauth2"}},"schemas":{"TokenInformationResponse":{"type":"object","description":"Response containing the token's status and other non-sensitive data","properties":{"card":{"$ref":"#/components/schemas/TokenInformationResponse.Card"},"gatewayTokenId":{"type":"string","description":"Unique ID of the token","maxLength":64},"paymentMethodType":{"type":"string","description":"Type of payment method stored in the token","enum":["CARD"]},"purposes":{"type":"array","description":"The purpose for which the token is intended to be used in subsequent payments:\n\n* ONE_CLICK - cardholder-initiated ad-hoc payments.\n* MERCHANT_INITIATED - merchant-initiated payments.\n","items":{"$ref":"#/components/schemas/TokenPurpose"},"uniqueItems":true},"tokenStatus":{"$ref":"#/components/schemas/TokenStatus"}}},"TokenInformationResponse.Card":{"type":"object","description":"Card details stored in the token","properties":{"bin":{"type":"string","description":"Bank Identification Number (BIN) of the card"},"brand":{"$ref":"#/components/schemas/CardBrand","description":"Card scheme of the card used for the payment"},"cardArtUrl":{"type":"string","description":"URL to an image provided by the card issuer that represents the visual appearance of the physical payment card.\nIf available, the image may be used for presentation purposes in customer-facing experiences.\n"},"cardholderName":{"type":"string","description":"Name of the cardholder"},"expiry":{"$ref":"#/components/schemas/CardExpiry","description":"Expiry date of the card"},"lastFourDigits":{"type":"string","description":"Last four digits of the card number"}}},"CardBrand":{"type":"string","description":"Card scheme of the payment card","enum":["MASTERCARD","VISA"]},"CardExpiry":{"description":"Expiry date of a payment card","properties":{"month":{"type":"string","description":"Month of the expiry date (in format MM)"},"year":{"type":"string","description":"Year of the expiry date (in format YY)"}}},"TokenPurpose":{"type":"string","description":"The purpose for which the token is intended to be used in subsequent payments:\n\n* ONE_CLICK - cardholder-initiated ad-hoc payments\n* MERCHANT_INITIATED - merchant-initiated payments\n","enum":["ONE_CLICK","MERCHANT_INITIATED"]},"TokenStatus":{"type":"string","description":"Status of a saved payment method token:\n\n* ACTIVE - the token can be used for payments\n* SUSPENDED - the token has been deactivated and can no longer be used for payments\n","enum":["ACTIVE","SUSPENDED"]},"ErrorResponse":{"type":"object","description":"Contains details of the error that occurred during an API call","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","description":"A single error message returned for the API call","properties":{"category":{"$ref":"#/components/schemas/ApiClientMessage.Category"},"code":{"type":"string","description":"Error code"},"text":{"type":"string","description":"Description of the error"}}},"ApiClientMessage.Category":{"type":"string","description":"Severity category of the message:\n\n* ERROR - the request could not be processed\n","enum":["ERROR"]}}},"paths":{"/egw/{version}/tokens/{gatewayTokenId}":{"get":{"description":"Retrieve token status and other non-sensitive data.","operationId":"getToken","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the token","in":"path","name":"gatewayTokenId","required":true,"schema":{"type":"string","description":"Unique ID of the token","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenInformationResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Get token information","tags":["Gateway Tokens"]}}}}
```

## Deactivate an existing token

> Deactivates an existing token, preventing its use in future payments

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"Retrieve Gateway tokens and update token status","name":"Gateway Tokens"}],"servers":[{"description":"Production server for live traffic","url":"https://api.ecommerce.seb.ee"},{"description":"Sandbox testing environment","url":"https://sandbox.api.ecommerce.seb.ee"}],"security":[{"oauth2ClientCredentials":[]}],"components":{"securitySchemes":{"oauth2ClientCredentials":{"flows":{"clientCredentials":{"scopes":{},"tokenUrl":"https://api.ecommerce.seb.ee/auth/realms/participants-seb/protocol/openid-connect/token"}},"type":"oauth2"}},"schemas":{"DeactivateTokenResponse":{"type":"object","description":"Response confirming that the token has been deactivated","properties":{"gatewayTokenId":{"type":"string","description":"Unique ID of the token","maxLength":64},"tokenStatus":{"$ref":"#/components/schemas/TokenStatus"}}},"TokenStatus":{"type":"string","description":"Status of a saved payment method token:\n\n* ACTIVE - the token can be used for payments\n* SUSPENDED - the token has been deactivated and can no longer be used for payments\n","enum":["ACTIVE","SUSPENDED"]},"ErrorResponse":{"type":"object","description":"Contains details of the error that occurred during an API call","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","description":"A single error message returned for the API call","properties":{"category":{"$ref":"#/components/schemas/ApiClientMessage.Category"},"code":{"type":"string","description":"Error code"},"text":{"type":"string","description":"Description of the error"}}},"ApiClientMessage.Category":{"type":"string","description":"Severity category of the message:\n\n* ERROR - the request could not be processed\n","enum":["ERROR"]}}},"paths":{"/egw/{version}/tokens/{gatewayTokenId}":{"delete":{"description":"Deactivates an existing token, preventing its use in future payments","operationId":"deactivateToken","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the token","in":"path","name":"gatewayTokenId","required":true,"schema":{"type":"string","description":"Unique ID of the token","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeactivateTokenResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Deactivate an existing token","tags":["Gateway Tokens"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecommerce.seb.ee/seb-docs-draft/seb-docs-public-et/api-viide/kaupmehe-api/gateway-tokens.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
