> 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/api-reference/merchant-api/payments/checkout-sessions/bank-checkout-sessions.md).

# Bank Checkout Sessions

## Create bank checkout session

> Starts a new bank 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"},"tags":[{"name":"Bank Checkout Sessions"}],"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":{"CreateBankCheckoutSessionRequest":{"type":"object","description":"Request to start a new bank checkout session for a customer-initiated payment","properties":{"bank":{"$ref":"#/components/schemas/CreateBankCheckoutSessionRequest.Bank"},"browserIp":{"type":"string","description":"User's browser IP address","maxLength":45,"minLength":0},"browserUserAgent":{"type":"string","description":"Exact content of the HTTP user-agent header","minLength":1},"preferredLocale":{"type":"string","description":"Preferred locale for the checkout page, defaults to the locale sent in payment initiation request"}},"required":["bank","browserIp","browserUserAgent"],"title":"Create bank checkout session request"},"CreateBankCheckoutSessionRequest.Bank":{"type":"object","description":"Bank selected by the customer for the payment","properties":{"bankId":{"type":"string","description":"ID of the chosen bank","maxLength":255,"minLength":0}},"required":["bankId"]},"CreateBankCheckoutSessionResponse":{"type":"object","description":"Response with Strong Customer Authentication redirect URL for starting the bank checkout session","properties":{"action":{"$ref":"#/components/schemas/RedirectToScaAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"$ref":"#/components/schemas/CheckoutSessionStatus"}}},"RedirectToScaAction":{"allOf":[{"$ref":"#/components/schemas/BankAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToScaAction.Links"}}}],"description":"Action requiring the customer to be redirected to the bank to complete Strong Customer Authentication"},"BankAction":{"type":"object","description":"Next action required to continue the bank checkout flow","discriminator":{"mapping":{"REDIRECT_TO_SCA":"#/components/schemas/RedirectToScaAction","REDIRECT_TO_SHOP":"#/components/schemas/RedirectToShopAction","SELECT_ACCOUNT":"#/components/schemas/SelectAccountAction"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BankActionType"}},"required":["type"]},"BankActionType":{"type":"string","description":"Next action required to continue the bank checkout flow:\n* REDIRECT_TO_SCA - the customer must be redirected to the bank to complete Strong Customer Authentication\n* SELECT_ACCOUNT - the customer must select a bank account to use for the payment\n* REDIRECT_TO_SHOP - the customer must be redirected back to the shop\n","enum":["REDIRECT_TO_SCA","REDIRECT_TO_SHOP","SELECT_ACCOUNT"]},"RedirectToScaAction.Links":{"type":"object","description":"Redirect links for completing Strong Customer Authentication","properties":{"scaRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"CheckoutSessionStatus":{"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"},"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}/payments/{paymentId}/sessions/bank":{"post":{"description":"Starts a new bank checkout session for the payment.\n\nThis endpoint is available only for customer-initiated payments.\n","operationId":"createBankCheckoutSession","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/CreateBankCheckoutSessionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankCheckoutSessionResponse"}}},"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 bank checkout session","tags":["Bank Checkout Sessions"]}}}}
```

## Complete payment

> Check the status of the payment and mark as completed

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"name":"Bank Checkout Sessions"}],"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":{"CompletePaymentResponse":{"type":"object","description":"Response containing the status of the payment","properties":{"action":{"$ref":"#/components/schemas/RedirectToShopAction"},"completionStatus":{"$ref":"#/components/schemas/CompletionStatus","description":"Status of the payment"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"$ref":"#/components/schemas/CheckoutSessionStatus"}},"title":"Complete payment response"},"RedirectToShopAction":{"allOf":[{"$ref":"#/components/schemas/BankAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToShopAction.Links"}}}],"description":"Action requiring the customer to be redirected back to the shop"},"BankAction":{"type":"object","description":"Next action required to continue the bank checkout flow","discriminator":{"mapping":{"REDIRECT_TO_SCA":"#/components/schemas/RedirectToScaAction","REDIRECT_TO_SHOP":"#/components/schemas/RedirectToShopAction","SELECT_ACCOUNT":"#/components/schemas/SelectAccountAction"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BankActionType"}},"required":["type"]},"BankActionType":{"type":"string","description":"Next action required to continue the bank checkout flow:\n* REDIRECT_TO_SCA - the customer must be redirected to the bank to complete Strong Customer Authentication\n* SELECT_ACCOUNT - the customer must select a bank account to use for the payment\n* REDIRECT_TO_SHOP - the customer must be redirected back to the shop\n","enum":["REDIRECT_TO_SCA","REDIRECT_TO_SHOP","SELECT_ACCOUNT"]},"RedirectToShopAction.Links":{"type":"object","description":"Redirect link back to the shop","properties":{"shopRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"CompletionStatus":{"type":"string","description":"Status of the payment completion process","enum":["SUCCESS","FAILED","PROCESSING"]},"CheckoutSessionStatus":{"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"},"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}/payments/{paymentId}/sessions/{sessionId}/bank/complete":{"patch":{"description":"Check the status of the payment and mark as completed","operationId":"completeBankPayment","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/CompletePaymentResponse"}}},"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 payment","tags":["Bank Checkout Sessions"]}}}}
```

## Confirm payment

> Confirm and initiate the payment

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"name":"Bank Checkout Sessions"}],"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":{"ConfirmPaymentRequest":{"type":"object","description":"Request to confirm and initiate the bank payment","properties":{"iban":{"type":"string","description":"International Bank Account Number of the bank account to be used for the payment","maxLength":34,"minLength":0},"preferredLocale":{"type":"string","description":"Preferred language for the checkout page. Defaults to language sent in one-off or CIT request, if missing"}}},"ConfirmPaymentResponse":{"type":"object","description":"Response with Strong Customer Authentication redirect URL for confirming the payment","properties":{"action":{"$ref":"#/components/schemas/RedirectToScaAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"$ref":"#/components/schemas/CheckoutSessionStatus"}},"title":"Confirm payment response"},"RedirectToScaAction":{"allOf":[{"$ref":"#/components/schemas/BankAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToScaAction.Links"}}}],"description":"Action requiring the customer to be redirected to the bank to complete Strong Customer Authentication"},"BankAction":{"type":"object","description":"Next action required to continue the bank checkout flow","discriminator":{"mapping":{"REDIRECT_TO_SCA":"#/components/schemas/RedirectToScaAction","REDIRECT_TO_SHOP":"#/components/schemas/RedirectToShopAction","SELECT_ACCOUNT":"#/components/schemas/SelectAccountAction"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BankActionType"}},"required":["type"]},"BankActionType":{"type":"string","description":"Next action required to continue the bank checkout flow:\n* REDIRECT_TO_SCA - the customer must be redirected to the bank to complete Strong Customer Authentication\n* SELECT_ACCOUNT - the customer must select a bank account to use for the payment\n* REDIRECT_TO_SHOP - the customer must be redirected back to the shop\n","enum":["REDIRECT_TO_SCA","REDIRECT_TO_SHOP","SELECT_ACCOUNT"]},"RedirectToScaAction.Links":{"type":"object","description":"Redirect links for completing Strong Customer Authentication","properties":{"scaRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"CheckoutSessionStatus":{"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"},"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}/payments/{paymentId}/sessions/{sessionId}/bank/confirm":{"patch":{"description":"Confirm and initiate the payment","operationId":"confirmBankPayment","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/ConfirmPaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPaymentResponse"}}},"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":"Confirm payment","tags":["Bank Checkout Sessions"]}}}}
```

## Create consent

> Creates the PSD2 consent for access to the customer's bank account details.\
> \
> Use this endpoint after the customer completes the pre-step SCA (strong customer authentication).<br>

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"name":"Bank Checkout Sessions"}],"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":{"CreateConsentRequest":{"type":"object","description":"Request to create a consent for the payment after completing pre-step Strong Customer Authentication","properties":{"preferredLocale":{"type":"string","description":"Preferred locale for the checkout page, defaults to the locale sent in payment initiation request"}},"title":"Create consent request"},"CreateConsentResponse":{"type":"object","description":"Response with Strong Customer Authentication redirect URL for creating a consent for the payment","properties":{"action":{"$ref":"#/components/schemas/RedirectToScaAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"$ref":"#/components/schemas/CheckoutSessionStatus"}},"title":"Create consent response"},"RedirectToScaAction":{"allOf":[{"$ref":"#/components/schemas/BankAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToScaAction.Links"}}}],"description":"Action requiring the customer to be redirected to the bank to complete Strong Customer Authentication"},"BankAction":{"type":"object","description":"Next action required to continue the bank checkout flow","discriminator":{"mapping":{"REDIRECT_TO_SCA":"#/components/schemas/RedirectToScaAction","REDIRECT_TO_SHOP":"#/components/schemas/RedirectToShopAction","SELECT_ACCOUNT":"#/components/schemas/SelectAccountAction"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BankActionType"}},"required":["type"]},"BankActionType":{"type":"string","description":"Next action required to continue the bank checkout flow:\n* REDIRECT_TO_SCA - the customer must be redirected to the bank to complete Strong Customer Authentication\n* SELECT_ACCOUNT - the customer must select a bank account to use for the payment\n* REDIRECT_TO_SHOP - the customer must be redirected back to the shop\n","enum":["REDIRECT_TO_SCA","REDIRECT_TO_SHOP","SELECT_ACCOUNT"]},"RedirectToScaAction.Links":{"type":"object","description":"Redirect links for completing Strong Customer Authentication","properties":{"scaRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"CheckoutSessionStatus":{"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"},"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}/payments/{paymentId}/sessions/{sessionId}/bank/consent":{"patch":{"description":"Creates the PSD2 consent for access to the customer's bank account details.\n\nUse this endpoint after the customer completes the pre-step SCA (strong customer authentication).\n","operationId":"createBankConsent","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/CreateConsentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConsentResponse"}}},"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 consent","tags":["Bank Checkout Sessions"]}}}}
```


---

# 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/api-reference/merchant-api/payments/checkout-sessions/bank-checkout-sessions.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.
