# Tarjeta

## Create card checkout session

> Starts a new card checkout session for the payment.\
> \
> This endpoint is available only for customer-initiated payments.<br>

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"CreateCardCheckoutSessionSchema":{"type":"object","properties":{"encryptedCard":{"$ref":"#/components/schemas/EncryptedCard","description":"Encrypted card details"}},"required":["encryptedCard"],"title":"Create card checkout session request"},"EncryptedCard":{"type":"object","properties":{"jweCompact":{"type":"string","description":"Encrypted card details in JWE compact serialization format.\nThe card details must be serialized as JSON before encryption according to the \"CreateCardCheckoutSessionSchema.Card\" schema.\n","minLength":1}},"required":["jweCompact"]},"CheckoutSessionInformationResponse":{"type":"object","properties":{"action":{"oneOf":[{"$ref":"#/components/schemas/AuthenticateWith3DSAction"},{"$ref":"#/components/schemas/RedirectToShopAction"},{"$ref":"#/components/schemas/ShowChallengeAction"}]},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}}},"AuthenticateWith3DSAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/AuthenticateWith3DSAction.Links"},"type":{"type":"string","enum":["AUTHENTICATE_WITH_3DS"]}}}]},"CardAction":{"discriminator":{"propertyName":"type"},"properties":{"type":{"type":"string"}},"required":["type"]},"AuthenticateWith3DSAction.Links":{"type":"object","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"},"threeDsMethod":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"RedirectToShopAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToShopAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SHOP"]}}}]},"RedirectToShopAction.Links":{"type":"object","properties":{"shopRedirect":{"$ref":"#/components/schemas/Link"}}},"ShowChallengeAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"challengeHtml":{"type":"string","description":"3DS challenge HTML content"},"type":{"type":"string","enum":["SHOW_CHALLENGE"]}}}]},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/card":{"post":{"description":"Starts a new card checkout session for the payment.\n\nThis endpoint is available only for customer-initiated payments.\n","operationId":"createCardCheckoutSession","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 payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardCheckoutSessionSchema"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionInformationResponse"}}},"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":"Create card checkout session","tags":["Card Session API"]}}}}
```

## Get payment's checkout session

> Get previously created checkout session

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"CheckoutSessionInformationResponse":{"type":"object","properties":{"action":{"oneOf":[{"$ref":"#/components/schemas/AuthenticateWith3DSAction"},{"$ref":"#/components/schemas/RedirectToShopAction"},{"$ref":"#/components/schemas/ShowChallengeAction"}]},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}}},"AuthenticateWith3DSAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/AuthenticateWith3DSAction.Links"},"type":{"type":"string","enum":["AUTHENTICATE_WITH_3DS"]}}}]},"CardAction":{"discriminator":{"propertyName":"type"},"properties":{"type":{"type":"string"}},"required":["type"]},"AuthenticateWith3DSAction.Links":{"type":"object","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"},"threeDsMethod":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"RedirectToShopAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToShopAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SHOP"]}}}]},"RedirectToShopAction.Links":{"type":"object","properties":{"shopRedirect":{"$ref":"#/components/schemas/Link"}}},"ShowChallengeAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"challengeHtml":{"type":"string","description":"3DS challenge HTML content"},"type":{"type":"string","enum":["SHOW_CHALLENGE"]}}}]},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/card":{"get":{"description":"Get previously created checkout session","operationId":"getCardCheckoutSessionInformation","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 payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionInformationResponse"}}},"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 payment's checkout session","tags":["Card Session API"]}}}}
```

## Initiate 3DS authentication

> Initiate 3DS authentication for the payment

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"InitiateThreeDsAuthenticationRequest":{"type":"object","description":"Request containing payment and 3DS browser data for 3DS authentication","properties":{"browserAcceptHeader":{"type":"string","description":"Exact content of the HTTP accept headers as sent to the 3DS Requestor from the Cardholder's browser","minLength":1},"browserColorDepth":{"type":"string","description":"Value representing the bit depth of the colour palette for displaying images, in bits per pixel","minLength":1},"browserIp":{"type":"string","description":"IP address of the browser as returned by the HTTP headers to the 3DS Requestor","minLength":1},"browserJavaEnabled":{"type":"boolean","description":"Boolean that represents the ability of the cardholder browser to execute Java"},"browserJavascriptEnabled":{"type":"boolean","description":"Boolean that represents the ability of the cardholder browser to execute JavaScript"},"browserLanguage":{"type":"string","description":"Value representing the browser language as defined in IETF BCP47","minLength":1},"browserScreenHeight":{"type":"string","description":"Total height of the Cardholder's screen in pixels","minLength":1},"browserScreenWidth":{"type":"string","description":"Total width of the Cardholder's screen in pixels","minLength":1},"browserTZ":{"type":"string","description":"Time-zone offset in minutes between UTC and the Cardholder browser local time","minLength":1},"browserUserAgent":{"type":"string","description":"Exact content of the HTTP user-agent header","minLength":1}},"required":["browserAcceptHeader","browserColorDepth","browserIp","browserJavaEnabled","browserJavascriptEnabled","browserLanguage","browserScreenHeight","browserScreenWidth","browserTZ","browserUserAgent"],"title":"3DS authentication request"},"InitiateThreeDsAuthenticationResponse":{"type":"object","properties":{"action":{"oneOf":[{"$ref":"#/components/schemas/AuthenticateWith3DSAction"},{"$ref":"#/components/schemas/RedirectToShopAction"},{"$ref":"#/components/schemas/ShowChallengeAction"}]},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}}},"AuthenticateWith3DSAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/AuthenticateWith3DSAction.Links"},"type":{"type":"string","enum":["AUTHENTICATE_WITH_3DS"]}}}]},"CardAction":{"discriminator":{"propertyName":"type"},"properties":{"type":{"type":"string"}},"required":["type"]},"AuthenticateWith3DSAction.Links":{"type":"object","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"},"threeDsMethod":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"RedirectToShopAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToShopAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SHOP"]}}}]},"RedirectToShopAction.Links":{"type":"object","properties":{"shopRedirect":{"$ref":"#/components/schemas/Link"}}},"ShowChallengeAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"challengeHtml":{"type":"string","description":"3DS challenge HTML content"},"type":{"type":"string","enum":["SHOW_CHALLENGE"]}}}]},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/card/three-ds/authentication":{"patch":{"description":"Initiate 3DS authentication for the payment","operationId":"initiateCardThreeDsAuthentication","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 payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateThreeDsAuthenticationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateThreeDsAuthenticationResponse"}}},"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":"Initiate 3DS authentication","tags":["Card Session API"]}}}}
```

## Complete 3DS challenge

> Complete 3DS challenge for the payment

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"CompleteChallengeRequest":{"type":"object","description":"Request to complete the 3DS challenge","properties":{"cres":{"type":"string","description":"Base64-encoded CRes message, as received from the ACS"}},"required":["cres"],"title":"Complete challenge request"},"CompleteChallengeResponse":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/RedirectToShopAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}}},"RedirectToShopAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToShopAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SHOP"]}}}]},"CardAction":{"discriminator":{"propertyName":"type"},"properties":{"type":{"type":"string"}},"required":["type"]},"RedirectToShopAction.Links":{"type":"object","properties":{"shopRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/card/three-ds/challenge-result":{"patch":{"description":"Complete 3DS challenge for the payment","operationId":"completeCardThreeDsChallenge","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 payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteChallengeRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteChallengeResponse"}}},"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":"Complete 3DS challenge","tags":["Card Session API"]}}}}
```


---

# 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://doc.ecomm.api.tietoevry.com/documentation-es/referencias-de-la-api/api-para-comerciantes/pagos/sesiones/tarjeta.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.
