> 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.md).

# Payments

The Payments APIs cover payment initiation and payment lifecycle operations.

Payment initiation has separate endpoints for **CIT** and **MIT**:

* **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.
* **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.

A payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment. The Checkout Session APIs follow an action-driven workflow, where each response returns the current session status together with any actions required to progress the payment, such as customer authentication or bank account selection. You should process the returned actions and continue the checkout session until a final status is reached, indicating that the payment has either been successfully completed or has failed.

## Create a new customer-initiated payment

> Creates a new customer-initiated payment.\
> \
> After a payment is created a payment method (card, bank, gateway token) must be added to it.\
> The user can attempt adding payment method multiple times until ultimately one is successful.\
> The checkout process is continued by either redirecting the user to the gateway hosted checkout page\
> or integrating directly with the Checkout Session APIs.\
> \
> Additionally, the \`setupToken\` fields can be used to save the used payment method for future payments.\
> \
> If the payment amount is 0, the card authorization is an Account Status Inquiry (ASI).\
> An ASI checks that the card account is valid. No funds are reserved or taken.<br>

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"The Payments APIs cover payment initiation and payment lifecycle operations.\n\nPayment initiation has separate endpoints for **CIT** and **MIT**:\n- **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.\n- **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.\n\nA payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment.\nThe Checkout Session APIs follow an action-driven workflow,\nwhere each response returns the current session status together with any actions required to progress the payment,\nsuch as customer authentication or bank account selection.\nYou should process the returned actions and continue the checkout session until a final status is reached,\nindicating that the payment has either been successfully completed or has failed.\n","name":"Payments"}],"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":{"InitiateCitPaymentRequest":{"type":"object","description":"Initiates a cardholder-initiated payment","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Payment amount. If the amount is 0, the card authorization is an Account Status Inquiry (ASI)."},"basket":{"$ref":"#/components/schemas/Basket"},"billingAddress":{"$ref":"#/components/schemas/Address","description":"Billing address, used for fraud prevention and 3D Secure"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"customer":{"$ref":"#/components/schemas/Customer","description":"Customer details, used for fraud prevention and 3D Secure"},"description":{"type":"string","description":"Description of the payment","maxLength":255,"minLength":0},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems.\n","maxLength":255,"minLength":0,"pattern":"^[a-zA-Z0-9/-?:().,'+\\-]*$"},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order.\n","maxLength":255,"minLength":0,"pattern":"^[a-zA-Z0-9/-?:().,'+\\-]*$"},"preferredCountry":{"type":"string","description":"Default country for bank selection in the gateway hosted checkout page"},"preferredLocale":{"type":"string","description":"The customer's preferred locale in IETF BCP 47 language tag format.\nUsed as the default locale for the Gateway Hosted Checkout page, if such language is available.\n"},"setupToken":{"$ref":"#/components/schemas/SetupToken","description":"Indicates the type of token that will be set up during this payment"},"shippingAddress":{"$ref":"#/components/schemas/Address","description":"Shipping address, used for fraud prevention and 3D Secure"},"shopRedirectUrl":{"type":"string","description":"URL of the shop the customer is redirected back to once the payment flow completes","minLength":1}},"required":["amount","billingModel","orderNumber","shopRedirectUrl"],"title":"Payment Initiation Request"},"Amount":{"type":"object","description":"Monetary amount together with its currency","properties":{"amount":{"type":"string","description":"The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. The decimal separator is a dot.\nCan be 0 for account verification (save payment method for future usage without initial payment).\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n  * 1056\n  * 5768.2\n  * 1.50\n  * 5877.78\n"},"currency":{"type":"string","description":"ISO 4217 alpha-3 currency code"}},"required":["amount","currency"]},"Basket":{"type":"object","description":"Basket containing detailed information about items to be purchased","properties":{"items":{"type":"array","description":"List of items to be purchased","items":{"oneOf":[{"$ref":"#/components/schemas/BasketItem.Discount"},{"$ref":"#/components/schemas/BasketItem.Fee"},{"$ref":"#/components/schemas/BasketItem.Product"},{"$ref":"#/components/schemas/BasketItem.Shipping"},{"$ref":"#/components/schemas/BasketItem.Tax"}]},"minItems":1},"subtotalAmount":{"$ref":"#/components/schemas/Amount","description":"Subtotal amount, excluding taxes, shipping, and coupon discounts (calculated, if missing)"}},"required":["items"]},"BasketItem.Discount":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Discount amount"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Discount amount in percentage"}}}],"description":"Discount item","required":["amount"]},"BasketItem":{"description":"Detailed information about the item in the basket","discriminator":{"mapping":{"DISCOUNT":"#/components/schemas/BasketItem.Discount","FEE":"#/components/schemas/BasketItem.Fee","PRODUCT":"#/components/schemas/BasketItem.Product","SHIPPING":"#/components/schemas/BasketItem.Shipping","TAX":"#/components/schemas/BasketItem.Tax"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BasketItemType"}},"required":["type"]},"BasketItemType":{"type":"string","description":"Type of a basket line item:\n\n* PRODUCT - a product being purchased\n* TAX - a tax charge applied to the basket\n* SHIPPING - a shipping charge applied to the basket\n* FEE - an additional fee applied to the basket\n* DISCOUNT - a discount applied to the basket\n","enum":["DISCOUNT","FEE","PRODUCT","SHIPPING","TAX"]},"BasketItem.Fee":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for fee (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Fee item","required":["amount"]},"BasketItem.Product":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"imageUrl":{"type":"string","description":"URL to the image of the item, to be displayed in the gateway hosted checkout page"},"name":{"type":"string","description":"Name of the item","minLength":1},"price":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item (including taxes)"},"priceBeforeDiscount":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item before discount (including taxes)"},"quantity":{"type":"integer","format":"int32","description":"Quantity of the item","minimum":1},"sku":{"type":"string","description":"The SKU (Stock Keeping Unit) that identifies the item in the merchant's inventory system","maxLength":64,"minLength":0},"taxRate":{"type":"number","description":"Tax rate applied to the item"},"totalPrice":{"$ref":"#/components/schemas/Amount","description":"Total amount of all items (including taxes; calculated, if missing)"}}}],"description":"Product item","required":["name","price","quantity"]},"BasketItem.Shipping":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for shipping (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Shipping item","required":["amount"]},"BasketItem.Tax":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount of tax"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Tax amount in percentage"}}}],"description":"Tax item","required":["amount"]},"Address":{"type":"object","description":"Information about the address","properties":{"addressLine1":{"type":"string","description":"First line of the street address","maxLength":255,"minLength":0},"addressLine2":{"type":"string","description":"Second line of the street address","maxLength":255,"minLength":0},"city":{"type":"string","description":"City","maxLength":255,"minLength":0},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"postalCode":{"type":"string","description":"Postal code","maxLength":255,"minLength":0},"state":{"type":"string","description":"State or province","maxLength":255,"minLength":0}}},"BillingModel":{"type":"string","description":"Describes the commercial billing model under which a payment is collected,\nwhether the payment is one-time, recurring, fulfillment-driven, or part of a predefined payment plan:\n\n* ONE_OFF - A payment that is not part of a predefined recurring, scheduled, or multi-payment billing model.\n    Additional payments may occur in the future, but each payment is initiated independently\n    rather than as part of an agreed payment schedule.\n    For example, regular retail purchases, one-time service fees, unscheduled merchant-initiated charges, ad hoc account top-ups.\n* SUBSCRIPTION - Payments made as part of an ongoing subscription agreement,\n    where charges recur automatically while the subscription remains active.\n    For example, streaming services, software subscriptions, gym memberships.\n* STANDING_ORDER - Recurring payments collected on a predefined schedule,\n    where the amount is typically determined by usage, consumption, or periodic billing rather than a fixed plan.\n    For example, electricity, telecommunications, or other utility bills.\n","enum":["ONE_OFF","SUBSCRIPTION","STANDING_ORDER"]},"Customer":{"type":"object","description":"Information about the customer","properties":{"email":{"type":"string","format":"email","description":"The customer's email address","maxLength":255,"minLength":0},"name":{"type":"string","description":"The customer's full name or business name","maxLength":255,"minLength":0},"phone":{"type":"string","description":"The customer's mobile phone number in international format (with '+' and country code)"}}},"SetupToken":{"type":"object","description":"Controls whether a token is set up during the payment and what it may later be used for","properties":{"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"},"minItems":1,"uniqueItems":true},"required":{"type":"boolean","description":"Indicates whether setting up a token during the payment is required or optional.\n\nWhen `true` (default), setting up a token is mandatory.\nIn this case, only payment methods that support tokenization can be used to complete the payment.\nThis would commonly be used for scenarios like subscriptions, where saving payment method details is essential.\n\nWhen `false`, setting up a token is optional, allowing the customer to also use payment methods that do not support tokenization.\nTypically this would be used to offer customers the option to save their payment method details for faster checkout in future cardholder-initiated payments,\nbut creating a token is not essential to complete the payment.\n"}},"required":["purposes"]},"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"]},"PaymentInformationResponse":{"type":"object","description":"Details of a payment","properties":{"_links":{"$ref":"#/components/schemas/PaymentInformationResponse.Links"},"additionalFields":{"type":"array","description":"Additional fields for the payment","items":{"$ref":"#/components/schemas/PaymentAdditionalField"}},"amount":{"$ref":"#/components/schemas/Amount","description":"Current/actual amount of the payment. Updated as the order amount changes (e.g. incremental authorization); frozen once the customer pays."},"authorizedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount reserved on the customer's account via pre-authorization. Present only for payments with pre-authorization."},"availablePaymentMethods":{"type":"array","description":"Payment methods available for the payment","items":{"oneOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod.ApplePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.Card"},{"$ref":"#/components/schemas/AvailablePaymentMethod.ClickToPay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.GooglePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.OpenBanking"},{"$ref":"#/components/schemas/AvailablePaymentMethod.PayPal"}]}},"basket":{"$ref":"#/components/schemas/Basket"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"channel":{"$ref":"#/components/schemas/PaymentChannel"},"createdAt":{"type":"string","format":"date-time","description":"Date and time the payment was created"},"customer":{"$ref":"#/components/schemas/Customer"},"dynamicCurrencyConversion":{"$ref":"#/components/schemas/DynamicCurrencyConversionDataDto","description":"Dynamic currency conversion data used in last checkout session"},"environment":{"$ref":"#/components/schemas/Environment","description":"Indicates whether the payment belongs to the sandbox or the live environment"},"invoiceNumber":{"type":"string","description":"Merchant's invoice number"},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems."},"netAmount":{"$ref":"#/components/schemas/Amount","description":"Amount effectively retained by the merchant after all refunds have been applied. Present once the customer has paid."},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order."},"participantId":{"type":"string","description":"Unique ID of the participant","maxLength":64},"paymentId":{"type":"string","description":"Unique ID of the payment","maxLength":64},"paymentLinkId":{"type":"string","description":"ID of the payment link that was used to initiate the payment","maxLength":64},"paymentMethod":{"$ref":"#/components/schemas/PaymentInformation.PaymentMethod"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"paymentStatusReason":{"$ref":"#/components/schemas/PaymentStatusReason"},"preferredCountry":{"type":"string","description":"Default country for bank selection in the gateway hosted checkout page"},"refundedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount already refunded. Present only when the payment has refunds."},"shopAgreementId":{"type":"string","description":"Unique ID of the shop","maxLength":64},"shopRedirectUrl":{"type":"string","description":"URL of the shop the customer is redirected back to once the payment flow completes"}}},"PaymentInformationResponse.Links":{"type":"object","description":"Links related to the payment","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"PaymentAdditionalField":{"type":"object","description":"Represents an additional field associated with a payment","properties":{"id":{"type":"string","description":"ID of the additional field","maxLength":64},"name":{"type":"string","description":"Name of the additional field"},"value":{"type":"string","description":"Value of the additional field"}}},"AvailablePaymentMethod.ApplePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true}}}],"description":"Apple Pay payment method available for the payment"},"AvailablePaymentMethod":{"description":"Represents an available payment method for a payment. The specific fields included in the response\ndepend on the type of payment method, as indicated by the 'type' field.\n","discriminator":{"mapping":{"APPLE_PAY":"#/components/schemas/AvailablePaymentMethod.ApplePay","CARD":"#/components/schemas/AvailablePaymentMethod.Card","CLICK_TO_PAY":"#/components/schemas/AvailablePaymentMethod.ClickToPay","GOOGLE_PAY":"#/components/schemas/AvailablePaymentMethod.GooglePay","OPEN_BANKING":"#/components/schemas/AvailablePaymentMethod.OpenBanking","PAYPAL":"#/components/schemas/AvailablePaymentMethod.PayPal"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/PaymentMethodType"}},"required":["type"]},"PaymentMethodType":{"type":"string","description":"Payment method used to complete a payment:\n\n* CARD - payment card\n* OPEN_BANKING - bank transfer initiated via open banking\n* CLICK_TO_PAY - Click to Pay wallet\n* APPLE_PAY - Apple Pay wallet\n* GOOGLE_PAY - Google Pay wallet\n* PAYPAL - PayPal wallet\n","enum":["APPLE_PAY","CARD","CLICK_TO_PAY","GOOGLE_PAY","OPEN_BANKING","PAYPAL"]},"CardBrand":{"type":"string","description":"Card scheme of the payment card","enum":["MASTERCARD","VISA"]},"AvailablePaymentMethod.Card":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nNote: this field is only returned in the sandbox environment.\n"}}}],"description":"Card payment method available for the payment"},"PaymentMethod.Links":{"type":"object","description":"Links for completing the payment using this payment method","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"AvailablePaymentMethod.ClickToPay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"},"srcDpaId":{"type":"string","description":"Digital payment application identifier used to initialize Click to Pay"}}}],"description":"Click to Pay payment method available for the payment"},"AvailablePaymentMethod.GooglePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}}],"description":"Google Pay payment method available for the payment"},"AvailablePaymentMethod.OpenBanking":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"banks":{"type":"array","items":{"$ref":"#/components/schemas/Bank"}}}}],"description":"Open banking payment method available for the payment, including the banks the customer can choose from"},"Bank":{"type":"object","description":"Information about a bank that can be used for payments","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"logo":{"type":"string","description":"SVG markup for the bank's logo"},"name":{"type":"string","description":"Name of the bank"},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this bank is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}},"AvailablePaymentMethod.PayPal":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"}],"description":"PayPal payment method available for the payment"},"PaymentChannel":{"type":"string","description":"Method or channel through which a payment was initiated:\n\n* CHECKOUT - customer actively completes a payment through a merchant (or gateway hosted) checkout experience, e.g. via shops webside or app.\n* MERCHANT_INITIATED - merchant or other backend system initiates a payment without the customer actively participating in that transaction.\n* PAYMENT_LINK - payment initiated by the customer opening a payment link.\n* INVOICE - payment initiated by the customer opening a payment link for an invoice.\n","enum":["CHECKOUT","MERCHANT_INITIATED","PAYMENT_LINK","INVOICE"]},"DynamicCurrencyConversionDataDto":{"type":"object","description":"Dynamic currency conversion data","properties":{"authorizationDetails":{"$ref":"#/components/schemas/DetailsDto"},"captureDetails":{"$ref":"#/components/schemas/DetailsDto"},"cardholderResponse":{"$ref":"#/components/schemas/DccCardholderResponseStatus"}}},"DetailsDto":{"type":"object","description":"Dynamic currency conversion (DCC) details","properties":{"conversionRate":{"type":"string","description":"Conversion rate used to convert amounts"},"markup":{"type":"string","description":"Any additional markup (as percentage) added during conversion"},"transactionAmount":{"$ref":"#/components/schemas/Amount","description":"Transaction amount offered to cardholder after DCC"}}},"DccCardholderResponseStatus":{"type":"string","description":"Cardholder response to DCC details from acquirer.\n\n* ACCEPTED - Accept DCC details\n* REJECTED - Reject DCC details\n\nThis status is available only for DCC enabled payments.\n","enum":["ACCEPTED","REJECTED"]},"Environment":{"type":"string","description":"Environment the payment belongs to:\n\n* SANDBOX - test environment used for integration testing\n* LIVE - production environment\n","enum":["SANDBOX","LIVE"]},"PaymentInformation.PaymentMethod":{"type":"object","description":"Payment method used for the payment","properties":{"card":{"$ref":"#/components/schemas/CardMethod"},"gatewayTokenId":{"type":"string","description":"ID of the gateway token created or used for this payment","maxLength":64},"openBanking":{"$ref":"#/components/schemas/OpenBankingMethod"},"type":{"$ref":"#/components/schemas/PaymentMethodType"}}},"CardMethod":{"type":"object","description":"Card used for the payment","properties":{"brand":{"$ref":"#/components/schemas/CardBrand","description":"Card scheme of the card used for the payment"},"cardArtUrl":{"type":"string","description":"URL of the card image supplied by the card network. Not available for every card."},"cardholderName":{"type":"string","description":"Name of the cardholder"},"expiry":{"$ref":"#/components/schemas/CardExpiry"},"lastFourDigits":{"type":"string","description":"Last four digits of the card number"},"preAuthorization":{"type":"boolean","description":"Whether the payment was authorized only and requires a separate capture request to settle the funds"}}},"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)"}}},"OpenBankingMethod":{"type":"object","description":"Bank used for the payment via open banking","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"iban":{"type":"string","description":"IBAN of the customer's bank account"},"name":{"type":"string","description":"Display name of the bank"}}},"PaymentStatus":{"type":"string","description":"Current lifecycle state of a payment:\n\n* INITIALIZED - the payment has been created but processing has not started yet\n* SENT_FOR_PROCESSING - the payment has been submitted for processing and the outcome is not yet known\n* ABANDONED - the customer did not complete the checkout session\n* AUTHORIZED - funds have been reserved on the customer's payment method but not yet captured\n* CAPTURED - the authorized funds have been captured\n* CANCELLED - the payment was cancelled before it completed\n* SETTLED - the payment has completed and funds have settled\n* FAILED - the payment attempt failed\n* REFUNDED - at least one refund has been completed against this payment\n","enum":["INITIALIZED","SENT_FOR_PROCESSING","ABANDONED","AUTHORIZED","CAPTURED","CANCELLED","SETTLED","FAILED","REFUNDED"]},"PaymentStatusReason":{"type":"string","description":"Business reason that explains why a payment has its current status:\n\n  - THREEDS_REJECTED - The payment could not be authorized because the issuer rejected the 3-D Secure authentication.\n  - THREEDS_FAILED - The customer did not successfully complete the 3-D Secure authentication process.\n  - THREEDS_UNAVAILABLE - 3-D Secure authentication could not be completed due to a technical or service availability issue.\n  - INVALID_ACCOUNT - The provided card or account details are invalid.\n  - INVALID_EXPIRY - The card expiry date is invalid or the card has expired.\n  - INVALID_CSC - The card security code (CSC/CVV/CVC) is invalid.\n  - LOST_OR_STOLEN_CARD - The card has been reported as lost or stolen and cannot be used.\n  - DECLINED - The transaction was declined by the issuer, acquirer, or payment network.\n  - INSUFFICIENT_FUNDS - The account does not have sufficient funds to complete the transaction.\n  - LIMIT_EXCEEDED - A transaction amount, velocity, or payment method usage limit has been exceeded.\n  - SUSPECTED_FRAUD - The transaction was declined due to suspected fraudulent activity.\n  - ABANDONED - The customer did not complete the checkout session and the payment expired.\n  - CANCELLED - The payment was cancelled before it completed.\n  - CUSTOMER_CANCELLED - The customer cancelled the payment before it completed.\n  - ACQUIRER_UNAVAILABLE - The acquiring service was temporarily unavailable and could not process the transaction.\n  - ISSUER_UNAVAILABLE - The card issuer was temporarily unavailable and could not authorize the transaction.\n  - TIMEOUT - The transaction could not be completed because processing exceeded the allowed time limit.\n  - PROCESSING_ERROR - The transaction could not be completed due to a technical processing error. The operation may be retried; if the issue persists, contact the service provider.\n","enum":["THREEDS_REJECTED","THREEDS_FAILED","THREEDS_UNAVAILABLE","INVALID_ACCOUNT","INVALID_EXPIRY","INVALID_CSC","LOST_OR_STOLEN_CARD","DECLINED","INSUFFICIENT_FUNDS","LIMIT_EXCEEDED","SUSPECTED_FRAUD","ABANDONED","CANCELLED","CUSTOMER_CANCELLED","ACQUIRER_UNAVAILABLE","ISSUER_UNAVAILABLE","TIMEOUT","PROCESSING_ERROR"]},"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/cit":{"post":{"description":"Creates a new customer-initiated payment.\n\nAfter a payment is created a payment method (card, bank, gateway token) must be added to it.\nThe user can attempt adding payment method multiple times until ultimately one is successful.\nThe checkout process is continued by either redirecting the user to the gateway hosted checkout page\nor integrating directly with the Checkout Session APIs.\n\nAdditionally, the `setupToken` fields can be used to save the used payment method for future payments.\n\nIf the payment amount is 0, the card authorization is an Account Status Inquiry (ASI).\nAn ASI checks that the card account is valid. No funds are reserved or taken.\n","operationId":"initiateCitPayment","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"}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateCitPaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInformationResponse"}}},"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 a new customer-initiated payment","tags":["Payments"]}}}}
```

## Create a new merchant-initiated payment

> Creates a new merchant-initiated payment - payment without direct involvement of the end user (e.g. subscriptions).\
> \
> Only previously saved payment method token can be used for merchant-initiated payments.\
> Before creating merchant-initiated payments it is necessary to setup a token agreement during an initial customer-initiated payment.\
> The token is provided by calling the Gateway Token Checkout Session APIs.<br>

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"The Payments APIs cover payment initiation and payment lifecycle operations.\n\nPayment initiation has separate endpoints for **CIT** and **MIT**:\n- **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.\n- **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.\n\nA payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment.\nThe Checkout Session APIs follow an action-driven workflow,\nwhere each response returns the current session status together with any actions required to progress the payment,\nsuch as customer authentication or bank account selection.\nYou should process the returned actions and continue the checkout session until a final status is reached,\nindicating that the payment has either been successfully completed or has failed.\n","name":"Payments"}],"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":{"InitiateMitPaymentRequest":{"type":"object","description":"Initiates a merchant-initiated payment","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Payment amount"},"basket":{"$ref":"#/components/schemas/Basket"},"billingAddress":{"$ref":"#/components/schemas/Address","description":"Billing address, used for fraud prevention and 3D Secure"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"customer":{"$ref":"#/components/schemas/Customer","description":"Customer details, used for fraud prevention and 3D Secure"},"description":{"type":"string","description":"Description of the payment","maxLength":255,"minLength":0},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems.\n","maxLength":255,"minLength":0,"pattern":"^[a-zA-Z0-9/-?:().,'+\\-]*$"},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order.\n","maxLength":255,"minLength":0,"pattern":"^[a-zA-Z0-9/-?:().,'+\\-]*$"},"shippingAddress":{"$ref":"#/components/schemas/Address","description":"Shipping address, used for fraud prevention and 3D Secure"}},"required":["amount","billingModel","orderNumber"],"title":"Payment Initiation Request"},"Amount":{"type":"object","description":"Monetary amount together with its currency","properties":{"amount":{"type":"string","description":"The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. The decimal separator is a dot.\nCan be 0 for account verification (save payment method for future usage without initial payment).\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n  * 1056\n  * 5768.2\n  * 1.50\n  * 5877.78\n"},"currency":{"type":"string","description":"ISO 4217 alpha-3 currency code"}},"required":["amount","currency"]},"Basket":{"type":"object","description":"Basket containing detailed information about items to be purchased","properties":{"items":{"type":"array","description":"List of items to be purchased","items":{"oneOf":[{"$ref":"#/components/schemas/BasketItem.Discount"},{"$ref":"#/components/schemas/BasketItem.Fee"},{"$ref":"#/components/schemas/BasketItem.Product"},{"$ref":"#/components/schemas/BasketItem.Shipping"},{"$ref":"#/components/schemas/BasketItem.Tax"}]},"minItems":1},"subtotalAmount":{"$ref":"#/components/schemas/Amount","description":"Subtotal amount, excluding taxes, shipping, and coupon discounts (calculated, if missing)"}},"required":["items"]},"BasketItem.Discount":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Discount amount"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Discount amount in percentage"}}}],"description":"Discount item","required":["amount"]},"BasketItem":{"description":"Detailed information about the item in the basket","discriminator":{"mapping":{"DISCOUNT":"#/components/schemas/BasketItem.Discount","FEE":"#/components/schemas/BasketItem.Fee","PRODUCT":"#/components/schemas/BasketItem.Product","SHIPPING":"#/components/schemas/BasketItem.Shipping","TAX":"#/components/schemas/BasketItem.Tax"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BasketItemType"}},"required":["type"]},"BasketItemType":{"type":"string","description":"Type of a basket line item:\n\n* PRODUCT - a product being purchased\n* TAX - a tax charge applied to the basket\n* SHIPPING - a shipping charge applied to the basket\n* FEE - an additional fee applied to the basket\n* DISCOUNT - a discount applied to the basket\n","enum":["DISCOUNT","FEE","PRODUCT","SHIPPING","TAX"]},"BasketItem.Fee":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for fee (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Fee item","required":["amount"]},"BasketItem.Product":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"imageUrl":{"type":"string","description":"URL to the image of the item, to be displayed in the gateway hosted checkout page"},"name":{"type":"string","description":"Name of the item","minLength":1},"price":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item (including taxes)"},"priceBeforeDiscount":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item before discount (including taxes)"},"quantity":{"type":"integer","format":"int32","description":"Quantity of the item","minimum":1},"sku":{"type":"string","description":"The SKU (Stock Keeping Unit) that identifies the item in the merchant's inventory system","maxLength":64,"minLength":0},"taxRate":{"type":"number","description":"Tax rate applied to the item"},"totalPrice":{"$ref":"#/components/schemas/Amount","description":"Total amount of all items (including taxes; calculated, if missing)"}}}],"description":"Product item","required":["name","price","quantity"]},"BasketItem.Shipping":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for shipping (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Shipping item","required":["amount"]},"BasketItem.Tax":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount of tax"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Tax amount in percentage"}}}],"description":"Tax item","required":["amount"]},"Address":{"type":"object","description":"Information about the address","properties":{"addressLine1":{"type":"string","description":"First line of the street address","maxLength":255,"minLength":0},"addressLine2":{"type":"string","description":"Second line of the street address","maxLength":255,"minLength":0},"city":{"type":"string","description":"City","maxLength":255,"minLength":0},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"postalCode":{"type":"string","description":"Postal code","maxLength":255,"minLength":0},"state":{"type":"string","description":"State or province","maxLength":255,"minLength":0}}},"BillingModel":{"type":"string","description":"Describes the commercial billing model under which a payment is collected,\nwhether the payment is one-time, recurring, fulfillment-driven, or part of a predefined payment plan:\n\n* ONE_OFF - A payment that is not part of a predefined recurring, scheduled, or multi-payment billing model.\n    Additional payments may occur in the future, but each payment is initiated independently\n    rather than as part of an agreed payment schedule.\n    For example, regular retail purchases, one-time service fees, unscheduled merchant-initiated charges, ad hoc account top-ups.\n* SUBSCRIPTION - Payments made as part of an ongoing subscription agreement,\n    where charges recur automatically while the subscription remains active.\n    For example, streaming services, software subscriptions, gym memberships.\n* STANDING_ORDER - Recurring payments collected on a predefined schedule,\n    where the amount is typically determined by usage, consumption, or periodic billing rather than a fixed plan.\n    For example, electricity, telecommunications, or other utility bills.\n","enum":["ONE_OFF","SUBSCRIPTION","STANDING_ORDER"]},"Customer":{"type":"object","description":"Information about the customer","properties":{"email":{"type":"string","format":"email","description":"The customer's email address","maxLength":255,"minLength":0},"name":{"type":"string","description":"The customer's full name or business name","maxLength":255,"minLength":0},"phone":{"type":"string","description":"The customer's mobile phone number in international format (with '+' and country code)"}}},"PaymentInformationResponse":{"type":"object","description":"Details of a payment","properties":{"_links":{"$ref":"#/components/schemas/PaymentInformationResponse.Links"},"additionalFields":{"type":"array","description":"Additional fields for the payment","items":{"$ref":"#/components/schemas/PaymentAdditionalField"}},"amount":{"$ref":"#/components/schemas/Amount","description":"Current/actual amount of the payment. Updated as the order amount changes (e.g. incremental authorization); frozen once the customer pays."},"authorizedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount reserved on the customer's account via pre-authorization. Present only for payments with pre-authorization."},"availablePaymentMethods":{"type":"array","description":"Payment methods available for the payment","items":{"oneOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod.ApplePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.Card"},{"$ref":"#/components/schemas/AvailablePaymentMethod.ClickToPay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.GooglePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.OpenBanking"},{"$ref":"#/components/schemas/AvailablePaymentMethod.PayPal"}]}},"basket":{"$ref":"#/components/schemas/Basket"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"channel":{"$ref":"#/components/schemas/PaymentChannel"},"createdAt":{"type":"string","format":"date-time","description":"Date and time the payment was created"},"customer":{"$ref":"#/components/schemas/Customer"},"dynamicCurrencyConversion":{"$ref":"#/components/schemas/DynamicCurrencyConversionDataDto","description":"Dynamic currency conversion data used in last checkout session"},"environment":{"$ref":"#/components/schemas/Environment","description":"Indicates whether the payment belongs to the sandbox or the live environment"},"invoiceNumber":{"type":"string","description":"Merchant's invoice number"},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems."},"netAmount":{"$ref":"#/components/schemas/Amount","description":"Amount effectively retained by the merchant after all refunds have been applied. Present once the customer has paid."},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order."},"participantId":{"type":"string","description":"Unique ID of the participant","maxLength":64},"paymentId":{"type":"string","description":"Unique ID of the payment","maxLength":64},"paymentLinkId":{"type":"string","description":"ID of the payment link that was used to initiate the payment","maxLength":64},"paymentMethod":{"$ref":"#/components/schemas/PaymentInformation.PaymentMethod"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"paymentStatusReason":{"$ref":"#/components/schemas/PaymentStatusReason"},"preferredCountry":{"type":"string","description":"Default country for bank selection in the gateway hosted checkout page"},"refundedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount already refunded. Present only when the payment has refunds."},"shopAgreementId":{"type":"string","description":"Unique ID of the shop","maxLength":64},"shopRedirectUrl":{"type":"string","description":"URL of the shop the customer is redirected back to once the payment flow completes"}}},"PaymentInformationResponse.Links":{"type":"object","description":"Links related to the payment","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"PaymentAdditionalField":{"type":"object","description":"Represents an additional field associated with a payment","properties":{"id":{"type":"string","description":"ID of the additional field","maxLength":64},"name":{"type":"string","description":"Name of the additional field"},"value":{"type":"string","description":"Value of the additional field"}}},"AvailablePaymentMethod.ApplePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true}}}],"description":"Apple Pay payment method available for the payment"},"AvailablePaymentMethod":{"description":"Represents an available payment method for a payment. The specific fields included in the response\ndepend on the type of payment method, as indicated by the 'type' field.\n","discriminator":{"mapping":{"APPLE_PAY":"#/components/schemas/AvailablePaymentMethod.ApplePay","CARD":"#/components/schemas/AvailablePaymentMethod.Card","CLICK_TO_PAY":"#/components/schemas/AvailablePaymentMethod.ClickToPay","GOOGLE_PAY":"#/components/schemas/AvailablePaymentMethod.GooglePay","OPEN_BANKING":"#/components/schemas/AvailablePaymentMethod.OpenBanking","PAYPAL":"#/components/schemas/AvailablePaymentMethod.PayPal"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/PaymentMethodType"}},"required":["type"]},"PaymentMethodType":{"type":"string","description":"Payment method used to complete a payment:\n\n* CARD - payment card\n* OPEN_BANKING - bank transfer initiated via open banking\n* CLICK_TO_PAY - Click to Pay wallet\n* APPLE_PAY - Apple Pay wallet\n* GOOGLE_PAY - Google Pay wallet\n* PAYPAL - PayPal wallet\n","enum":["APPLE_PAY","CARD","CLICK_TO_PAY","GOOGLE_PAY","OPEN_BANKING","PAYPAL"]},"CardBrand":{"type":"string","description":"Card scheme of the payment card","enum":["MASTERCARD","VISA"]},"AvailablePaymentMethod.Card":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nNote: this field is only returned in the sandbox environment.\n"}}}],"description":"Card payment method available for the payment"},"PaymentMethod.Links":{"type":"object","description":"Links for completing the payment using this payment method","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"AvailablePaymentMethod.ClickToPay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"},"srcDpaId":{"type":"string","description":"Digital payment application identifier used to initialize Click to Pay"}}}],"description":"Click to Pay payment method available for the payment"},"AvailablePaymentMethod.GooglePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}}],"description":"Google Pay payment method available for the payment"},"AvailablePaymentMethod.OpenBanking":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"banks":{"type":"array","items":{"$ref":"#/components/schemas/Bank"}}}}],"description":"Open banking payment method available for the payment, including the banks the customer can choose from"},"Bank":{"type":"object","description":"Information about a bank that can be used for payments","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"logo":{"type":"string","description":"SVG markup for the bank's logo"},"name":{"type":"string","description":"Name of the bank"},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this bank is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}},"AvailablePaymentMethod.PayPal":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"}],"description":"PayPal payment method available for the payment"},"PaymentChannel":{"type":"string","description":"Method or channel through which a payment was initiated:\n\n* CHECKOUT - customer actively completes a payment through a merchant (or gateway hosted) checkout experience, e.g. via shops webside or app.\n* MERCHANT_INITIATED - merchant or other backend system initiates a payment without the customer actively participating in that transaction.\n* PAYMENT_LINK - payment initiated by the customer opening a payment link.\n* INVOICE - payment initiated by the customer opening a payment link for an invoice.\n","enum":["CHECKOUT","MERCHANT_INITIATED","PAYMENT_LINK","INVOICE"]},"DynamicCurrencyConversionDataDto":{"type":"object","description":"Dynamic currency conversion data","properties":{"authorizationDetails":{"$ref":"#/components/schemas/DetailsDto"},"captureDetails":{"$ref":"#/components/schemas/DetailsDto"},"cardholderResponse":{"$ref":"#/components/schemas/DccCardholderResponseStatus"}}},"DetailsDto":{"type":"object","description":"Dynamic currency conversion (DCC) details","properties":{"conversionRate":{"type":"string","description":"Conversion rate used to convert amounts"},"markup":{"type":"string","description":"Any additional markup (as percentage) added during conversion"},"transactionAmount":{"$ref":"#/components/schemas/Amount","description":"Transaction amount offered to cardholder after DCC"}}},"DccCardholderResponseStatus":{"type":"string","description":"Cardholder response to DCC details from acquirer.\n\n* ACCEPTED - Accept DCC details\n* REJECTED - Reject DCC details\n\nThis status is available only for DCC enabled payments.\n","enum":["ACCEPTED","REJECTED"]},"Environment":{"type":"string","description":"Environment the payment belongs to:\n\n* SANDBOX - test environment used for integration testing\n* LIVE - production environment\n","enum":["SANDBOX","LIVE"]},"PaymentInformation.PaymentMethod":{"type":"object","description":"Payment method used for the payment","properties":{"card":{"$ref":"#/components/schemas/CardMethod"},"gatewayTokenId":{"type":"string","description":"ID of the gateway token created or used for this payment","maxLength":64},"openBanking":{"$ref":"#/components/schemas/OpenBankingMethod"},"type":{"$ref":"#/components/schemas/PaymentMethodType"}}},"CardMethod":{"type":"object","description":"Card used for the payment","properties":{"brand":{"$ref":"#/components/schemas/CardBrand","description":"Card scheme of the card used for the payment"},"cardArtUrl":{"type":"string","description":"URL of the card image supplied by the card network. Not available for every card."},"cardholderName":{"type":"string","description":"Name of the cardholder"},"expiry":{"$ref":"#/components/schemas/CardExpiry"},"lastFourDigits":{"type":"string","description":"Last four digits of the card number"},"preAuthorization":{"type":"boolean","description":"Whether the payment was authorized only and requires a separate capture request to settle the funds"}}},"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)"}}},"OpenBankingMethod":{"type":"object","description":"Bank used for the payment via open banking","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"iban":{"type":"string","description":"IBAN of the customer's bank account"},"name":{"type":"string","description":"Display name of the bank"}}},"PaymentStatus":{"type":"string","description":"Current lifecycle state of a payment:\n\n* INITIALIZED - the payment has been created but processing has not started yet\n* SENT_FOR_PROCESSING - the payment has been submitted for processing and the outcome is not yet known\n* ABANDONED - the customer did not complete the checkout session\n* AUTHORIZED - funds have been reserved on the customer's payment method but not yet captured\n* CAPTURED - the authorized funds have been captured\n* CANCELLED - the payment was cancelled before it completed\n* SETTLED - the payment has completed and funds have settled\n* FAILED - the payment attempt failed\n* REFUNDED - at least one refund has been completed against this payment\n","enum":["INITIALIZED","SENT_FOR_PROCESSING","ABANDONED","AUTHORIZED","CAPTURED","CANCELLED","SETTLED","FAILED","REFUNDED"]},"PaymentStatusReason":{"type":"string","description":"Business reason that explains why a payment has its current status:\n\n  - THREEDS_REJECTED - The payment could not be authorized because the issuer rejected the 3-D Secure authentication.\n  - THREEDS_FAILED - The customer did not successfully complete the 3-D Secure authentication process.\n  - THREEDS_UNAVAILABLE - 3-D Secure authentication could not be completed due to a technical or service availability issue.\n  - INVALID_ACCOUNT - The provided card or account details are invalid.\n  - INVALID_EXPIRY - The card expiry date is invalid or the card has expired.\n  - INVALID_CSC - The card security code (CSC/CVV/CVC) is invalid.\n  - LOST_OR_STOLEN_CARD - The card has been reported as lost or stolen and cannot be used.\n  - DECLINED - The transaction was declined by the issuer, acquirer, or payment network.\n  - INSUFFICIENT_FUNDS - The account does not have sufficient funds to complete the transaction.\n  - LIMIT_EXCEEDED - A transaction amount, velocity, or payment method usage limit has been exceeded.\n  - SUSPECTED_FRAUD - The transaction was declined due to suspected fraudulent activity.\n  - ABANDONED - The customer did not complete the checkout session and the payment expired.\n  - CANCELLED - The payment was cancelled before it completed.\n  - CUSTOMER_CANCELLED - The customer cancelled the payment before it completed.\n  - ACQUIRER_UNAVAILABLE - The acquiring service was temporarily unavailable and could not process the transaction.\n  - ISSUER_UNAVAILABLE - The card issuer was temporarily unavailable and could not authorize the transaction.\n  - TIMEOUT - The transaction could not be completed because processing exceeded the allowed time limit.\n  - PROCESSING_ERROR - The transaction could not be completed due to a technical processing error. The operation may be retried; if the issue persists, contact the service provider.\n","enum":["THREEDS_REJECTED","THREEDS_FAILED","THREEDS_UNAVAILABLE","INVALID_ACCOUNT","INVALID_EXPIRY","INVALID_CSC","LOST_OR_STOLEN_CARD","DECLINED","INSUFFICIENT_FUNDS","LIMIT_EXCEEDED","SUSPECTED_FRAUD","ABANDONED","CANCELLED","CUSTOMER_CANCELLED","ACQUIRER_UNAVAILABLE","ISSUER_UNAVAILABLE","TIMEOUT","PROCESSING_ERROR"]},"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/mit":{"post":{"description":"Creates a new merchant-initiated payment - payment without direct involvement of the end user (e.g. subscriptions).\n\nOnly previously saved payment method token can be used for merchant-initiated payments.\nBefore creating merchant-initiated payments it is necessary to setup a token agreement during an initial customer-initiated payment.\nThe token is provided by calling the Gateway Token Checkout Session APIs.\n","operationId":"initiateMitPayment","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"}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateMitPaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInformationResponse"}}},"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 a new merchant-initiated payment","tags":["Payments"]}}}}
```

## Get payment information

> Returns the content of a payment object

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"The Payments APIs cover payment initiation and payment lifecycle operations.\n\nPayment initiation has separate endpoints for **CIT** and **MIT**:\n- **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.\n- **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.\n\nA payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment.\nThe Checkout Session APIs follow an action-driven workflow,\nwhere each response returns the current session status together with any actions required to progress the payment,\nsuch as customer authentication or bank account selection.\nYou should process the returned actions and continue the checkout session until a final status is reached,\nindicating that the payment has either been successfully completed or has failed.\n","name":"Payments"}],"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":{"PaymentInformationResponse":{"type":"object","description":"Details of a payment","properties":{"_links":{"$ref":"#/components/schemas/PaymentInformationResponse.Links"},"additionalFields":{"type":"array","description":"Additional fields for the payment","items":{"$ref":"#/components/schemas/PaymentAdditionalField"}},"amount":{"$ref":"#/components/schemas/Amount","description":"Current/actual amount of the payment. Updated as the order amount changes (e.g. incremental authorization); frozen once the customer pays."},"authorizedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount reserved on the customer's account via pre-authorization. Present only for payments with pre-authorization."},"availablePaymentMethods":{"type":"array","description":"Payment methods available for the payment","items":{"oneOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod.ApplePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.Card"},{"$ref":"#/components/schemas/AvailablePaymentMethod.ClickToPay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.GooglePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.OpenBanking"},{"$ref":"#/components/schemas/AvailablePaymentMethod.PayPal"}]}},"basket":{"$ref":"#/components/schemas/Basket"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"channel":{"$ref":"#/components/schemas/PaymentChannel"},"createdAt":{"type":"string","format":"date-time","description":"Date and time the payment was created"},"customer":{"$ref":"#/components/schemas/Customer"},"dynamicCurrencyConversion":{"$ref":"#/components/schemas/DynamicCurrencyConversionDataDto","description":"Dynamic currency conversion data used in last checkout session"},"environment":{"$ref":"#/components/schemas/Environment","description":"Indicates whether the payment belongs to the sandbox or the live environment"},"invoiceNumber":{"type":"string","description":"Merchant's invoice number"},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems."},"netAmount":{"$ref":"#/components/schemas/Amount","description":"Amount effectively retained by the merchant after all refunds have been applied. Present once the customer has paid."},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order."},"participantId":{"type":"string","description":"Unique ID of the participant","maxLength":64},"paymentId":{"type":"string","description":"Unique ID of the payment","maxLength":64},"paymentLinkId":{"type":"string","description":"ID of the payment link that was used to initiate the payment","maxLength":64},"paymentMethod":{"$ref":"#/components/schemas/PaymentInformation.PaymentMethod"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"paymentStatusReason":{"$ref":"#/components/schemas/PaymentStatusReason"},"preferredCountry":{"type":"string","description":"Default country for bank selection in the gateway hosted checkout page"},"refundedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount already refunded. Present only when the payment has refunds."},"shopAgreementId":{"type":"string","description":"Unique ID of the shop","maxLength":64},"shopRedirectUrl":{"type":"string","description":"URL of the shop the customer is redirected back to once the payment flow completes"}}},"PaymentInformationResponse.Links":{"type":"object","description":"Links related to the payment","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"PaymentAdditionalField":{"type":"object","description":"Represents an additional field associated with a payment","properties":{"id":{"type":"string","description":"ID of the additional field","maxLength":64},"name":{"type":"string","description":"Name of the additional field"},"value":{"type":"string","description":"Value of the additional field"}}},"Amount":{"type":"object","description":"Monetary amount together with its currency","properties":{"amount":{"type":"string","description":"The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. The decimal separator is a dot.\nCan be 0 for account verification (save payment method for future usage without initial payment).\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n  * 1056\n  * 5768.2\n  * 1.50\n  * 5877.78\n"},"currency":{"type":"string","description":"ISO 4217 alpha-3 currency code"}},"required":["amount","currency"]},"AvailablePaymentMethod.ApplePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true}}}],"description":"Apple Pay payment method available for the payment"},"AvailablePaymentMethod":{"description":"Represents an available payment method for a payment. The specific fields included in the response\ndepend on the type of payment method, as indicated by the 'type' field.\n","discriminator":{"mapping":{"APPLE_PAY":"#/components/schemas/AvailablePaymentMethod.ApplePay","CARD":"#/components/schemas/AvailablePaymentMethod.Card","CLICK_TO_PAY":"#/components/schemas/AvailablePaymentMethod.ClickToPay","GOOGLE_PAY":"#/components/schemas/AvailablePaymentMethod.GooglePay","OPEN_BANKING":"#/components/schemas/AvailablePaymentMethod.OpenBanking","PAYPAL":"#/components/schemas/AvailablePaymentMethod.PayPal"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/PaymentMethodType"}},"required":["type"]},"PaymentMethodType":{"type":"string","description":"Payment method used to complete a payment:\n\n* CARD - payment card\n* OPEN_BANKING - bank transfer initiated via open banking\n* CLICK_TO_PAY - Click to Pay wallet\n* APPLE_PAY - Apple Pay wallet\n* GOOGLE_PAY - Google Pay wallet\n* PAYPAL - PayPal wallet\n","enum":["APPLE_PAY","CARD","CLICK_TO_PAY","GOOGLE_PAY","OPEN_BANKING","PAYPAL"]},"CardBrand":{"type":"string","description":"Card scheme of the payment card","enum":["MASTERCARD","VISA"]},"AvailablePaymentMethod.Card":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nNote: this field is only returned in the sandbox environment.\n"}}}],"description":"Card payment method available for the payment"},"PaymentMethod.Links":{"type":"object","description":"Links for completing the payment using this payment method","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"AvailablePaymentMethod.ClickToPay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"},"srcDpaId":{"type":"string","description":"Digital payment application identifier used to initialize Click to Pay"}}}],"description":"Click to Pay payment method available for the payment"},"AvailablePaymentMethod.GooglePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}}],"description":"Google Pay payment method available for the payment"},"AvailablePaymentMethod.OpenBanking":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"banks":{"type":"array","items":{"$ref":"#/components/schemas/Bank"}}}}],"description":"Open banking payment method available for the payment, including the banks the customer can choose from"},"Bank":{"type":"object","description":"Information about a bank that can be used for payments","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"logo":{"type":"string","description":"SVG markup for the bank's logo"},"name":{"type":"string","description":"Name of the bank"},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this bank is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}},"AvailablePaymentMethod.PayPal":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"}],"description":"PayPal payment method available for the payment"},"Basket":{"type":"object","description":"Basket containing detailed information about items to be purchased","properties":{"items":{"type":"array","description":"List of items to be purchased","items":{"oneOf":[{"$ref":"#/components/schemas/BasketItem.Discount"},{"$ref":"#/components/schemas/BasketItem.Fee"},{"$ref":"#/components/schemas/BasketItem.Product"},{"$ref":"#/components/schemas/BasketItem.Shipping"},{"$ref":"#/components/schemas/BasketItem.Tax"}]},"minItems":1},"subtotalAmount":{"$ref":"#/components/schemas/Amount","description":"Subtotal amount, excluding taxes, shipping, and coupon discounts (calculated, if missing)"}},"required":["items"]},"BasketItem.Discount":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Discount amount"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Discount amount in percentage"}}}],"description":"Discount item","required":["amount"]},"BasketItem":{"description":"Detailed information about the item in the basket","discriminator":{"mapping":{"DISCOUNT":"#/components/schemas/BasketItem.Discount","FEE":"#/components/schemas/BasketItem.Fee","PRODUCT":"#/components/schemas/BasketItem.Product","SHIPPING":"#/components/schemas/BasketItem.Shipping","TAX":"#/components/schemas/BasketItem.Tax"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BasketItemType"}},"required":["type"]},"BasketItemType":{"type":"string","description":"Type of a basket line item:\n\n* PRODUCT - a product being purchased\n* TAX - a tax charge applied to the basket\n* SHIPPING - a shipping charge applied to the basket\n* FEE - an additional fee applied to the basket\n* DISCOUNT - a discount applied to the basket\n","enum":["DISCOUNT","FEE","PRODUCT","SHIPPING","TAX"]},"BasketItem.Fee":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for fee (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Fee item","required":["amount"]},"BasketItem.Product":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"imageUrl":{"type":"string","description":"URL to the image of the item, to be displayed in the gateway hosted checkout page"},"name":{"type":"string","description":"Name of the item","minLength":1},"price":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item (including taxes)"},"priceBeforeDiscount":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item before discount (including taxes)"},"quantity":{"type":"integer","format":"int32","description":"Quantity of the item","minimum":1},"sku":{"type":"string","description":"The SKU (Stock Keeping Unit) that identifies the item in the merchant's inventory system","maxLength":64,"minLength":0},"taxRate":{"type":"number","description":"Tax rate applied to the item"},"totalPrice":{"$ref":"#/components/schemas/Amount","description":"Total amount of all items (including taxes; calculated, if missing)"}}}],"description":"Product item","required":["name","price","quantity"]},"BasketItem.Shipping":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for shipping (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Shipping item","required":["amount"]},"BasketItem.Tax":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount of tax"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Tax amount in percentage"}}}],"description":"Tax item","required":["amount"]},"BillingModel":{"type":"string","description":"Describes the commercial billing model under which a payment is collected,\nwhether the payment is one-time, recurring, fulfillment-driven, or part of a predefined payment plan:\n\n* ONE_OFF - A payment that is not part of a predefined recurring, scheduled, or multi-payment billing model.\n    Additional payments may occur in the future, but each payment is initiated independently\n    rather than as part of an agreed payment schedule.\n    For example, regular retail purchases, one-time service fees, unscheduled merchant-initiated charges, ad hoc account top-ups.\n* SUBSCRIPTION - Payments made as part of an ongoing subscription agreement,\n    where charges recur automatically while the subscription remains active.\n    For example, streaming services, software subscriptions, gym memberships.\n* STANDING_ORDER - Recurring payments collected on a predefined schedule,\n    where the amount is typically determined by usage, consumption, or periodic billing rather than a fixed plan.\n    For example, electricity, telecommunications, or other utility bills.\n","enum":["ONE_OFF","SUBSCRIPTION","STANDING_ORDER"]},"PaymentChannel":{"type":"string","description":"Method or channel through which a payment was initiated:\n\n* CHECKOUT - customer actively completes a payment through a merchant (or gateway hosted) checkout experience, e.g. via shops webside or app.\n* MERCHANT_INITIATED - merchant or other backend system initiates a payment without the customer actively participating in that transaction.\n* PAYMENT_LINK - payment initiated by the customer opening a payment link.\n* INVOICE - payment initiated by the customer opening a payment link for an invoice.\n","enum":["CHECKOUT","MERCHANT_INITIATED","PAYMENT_LINK","INVOICE"]},"Customer":{"type":"object","description":"Information about the customer","properties":{"email":{"type":"string","format":"email","description":"The customer's email address","maxLength":255,"minLength":0},"name":{"type":"string","description":"The customer's full name or business name","maxLength":255,"minLength":0},"phone":{"type":"string","description":"The customer's mobile phone number in international format (with '+' and country code)"}}},"DynamicCurrencyConversionDataDto":{"type":"object","description":"Dynamic currency conversion data","properties":{"authorizationDetails":{"$ref":"#/components/schemas/DetailsDto"},"captureDetails":{"$ref":"#/components/schemas/DetailsDto"},"cardholderResponse":{"$ref":"#/components/schemas/DccCardholderResponseStatus"}}},"DetailsDto":{"type":"object","description":"Dynamic currency conversion (DCC) details","properties":{"conversionRate":{"type":"string","description":"Conversion rate used to convert amounts"},"markup":{"type":"string","description":"Any additional markup (as percentage) added during conversion"},"transactionAmount":{"$ref":"#/components/schemas/Amount","description":"Transaction amount offered to cardholder after DCC"}}},"DccCardholderResponseStatus":{"type":"string","description":"Cardholder response to DCC details from acquirer.\n\n* ACCEPTED - Accept DCC details\n* REJECTED - Reject DCC details\n\nThis status is available only for DCC enabled payments.\n","enum":["ACCEPTED","REJECTED"]},"Environment":{"type":"string","description":"Environment the payment belongs to:\n\n* SANDBOX - test environment used for integration testing\n* LIVE - production environment\n","enum":["SANDBOX","LIVE"]},"PaymentInformation.PaymentMethod":{"type":"object","description":"Payment method used for the payment","properties":{"card":{"$ref":"#/components/schemas/CardMethod"},"gatewayTokenId":{"type":"string","description":"ID of the gateway token created or used for this payment","maxLength":64},"openBanking":{"$ref":"#/components/schemas/OpenBankingMethod"},"type":{"$ref":"#/components/schemas/PaymentMethodType"}}},"CardMethod":{"type":"object","description":"Card used for the payment","properties":{"brand":{"$ref":"#/components/schemas/CardBrand","description":"Card scheme of the card used for the payment"},"cardArtUrl":{"type":"string","description":"URL of the card image supplied by the card network. Not available for every card."},"cardholderName":{"type":"string","description":"Name of the cardholder"},"expiry":{"$ref":"#/components/schemas/CardExpiry"},"lastFourDigits":{"type":"string","description":"Last four digits of the card number"},"preAuthorization":{"type":"boolean","description":"Whether the payment was authorized only and requires a separate capture request to settle the funds"}}},"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)"}}},"OpenBankingMethod":{"type":"object","description":"Bank used for the payment via open banking","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"iban":{"type":"string","description":"IBAN of the customer's bank account"},"name":{"type":"string","description":"Display name of the bank"}}},"PaymentStatus":{"type":"string","description":"Current lifecycle state of a payment:\n\n* INITIALIZED - the payment has been created but processing has not started yet\n* SENT_FOR_PROCESSING - the payment has been submitted for processing and the outcome is not yet known\n* ABANDONED - the customer did not complete the checkout session\n* AUTHORIZED - funds have been reserved on the customer's payment method but not yet captured\n* CAPTURED - the authorized funds have been captured\n* CANCELLED - the payment was cancelled before it completed\n* SETTLED - the payment has completed and funds have settled\n* FAILED - the payment attempt failed\n* REFUNDED - at least one refund has been completed against this payment\n","enum":["INITIALIZED","SENT_FOR_PROCESSING","ABANDONED","AUTHORIZED","CAPTURED","CANCELLED","SETTLED","FAILED","REFUNDED"]},"PaymentStatusReason":{"type":"string","description":"Business reason that explains why a payment has its current status:\n\n  - THREEDS_REJECTED - The payment could not be authorized because the issuer rejected the 3-D Secure authentication.\n  - THREEDS_FAILED - The customer did not successfully complete the 3-D Secure authentication process.\n  - THREEDS_UNAVAILABLE - 3-D Secure authentication could not be completed due to a technical or service availability issue.\n  - INVALID_ACCOUNT - The provided card or account details are invalid.\n  - INVALID_EXPIRY - The card expiry date is invalid or the card has expired.\n  - INVALID_CSC - The card security code (CSC/CVV/CVC) is invalid.\n  - LOST_OR_STOLEN_CARD - The card has been reported as lost or stolen and cannot be used.\n  - DECLINED - The transaction was declined by the issuer, acquirer, or payment network.\n  - INSUFFICIENT_FUNDS - The account does not have sufficient funds to complete the transaction.\n  - LIMIT_EXCEEDED - A transaction amount, velocity, or payment method usage limit has been exceeded.\n  - SUSPECTED_FRAUD - The transaction was declined due to suspected fraudulent activity.\n  - ABANDONED - The customer did not complete the checkout session and the payment expired.\n  - CANCELLED - The payment was cancelled before it completed.\n  - CUSTOMER_CANCELLED - The customer cancelled the payment before it completed.\n  - ACQUIRER_UNAVAILABLE - The acquiring service was temporarily unavailable and could not process the transaction.\n  - ISSUER_UNAVAILABLE - The card issuer was temporarily unavailable and could not authorize the transaction.\n  - TIMEOUT - The transaction could not be completed because processing exceeded the allowed time limit.\n  - PROCESSING_ERROR - The transaction could not be completed due to a technical processing error. The operation may be retried; if the issue persists, contact the service provider.\n","enum":["THREEDS_REJECTED","THREEDS_FAILED","THREEDS_UNAVAILABLE","INVALID_ACCOUNT","INVALID_EXPIRY","INVALID_CSC","LOST_OR_STOLEN_CARD","DECLINED","INSUFFICIENT_FUNDS","LIMIT_EXCEEDED","SUSPECTED_FRAUD","ABANDONED","CANCELLED","CUSTOMER_CANCELLED","ACQUIRER_UNAVAILABLE","ISSUER_UNAVAILABLE","TIMEOUT","PROCESSING_ERROR"]},"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}":{"get":{"description":"Returns the content of a payment object","operationId":"getPaymentInformation","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"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInformationResponse"}}},"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 information","tags":["Payments"]}}}}
```

## Cancels a payment

> Cancels a payment that is active or authorized.\
> \
> To return funds for a payment that has already been completed, use the refund endpoint.<br>

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"The Payments APIs cover payment initiation and payment lifecycle operations.\n\nPayment initiation has separate endpoints for **CIT** and **MIT**:\n- **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.\n- **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.\n\nA payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment.\nThe Checkout Session APIs follow an action-driven workflow,\nwhere each response returns the current session status together with any actions required to progress the payment,\nsuch as customer authentication or bank account selection.\nYou should process the returned actions and continue the checkout session until a final status is reached,\nindicating that the payment has either been successfully completed or has failed.\n","name":"Payments"}],"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":{"CancelPaymentRequest":{"type":"object","description":"The request for cancelling a payment","properties":{"reason":{"$ref":"#/components/schemas/CancelReason","description":"Reason to cancel the payment"}},"title":"Cancel Payment Request"},"CancelReason":{"type":"string","description":"Reason for cancelling a payment:\n\n* SUSPECTED_FRAUD - the payment is suspected to be fraudulent\n* ABANDONED - the customer did not complete the payment\n* CUSTOMER_CANCELLED - the customer cancelled the payment\n","enum":["SUSPECTED_FRAUD","ABANDONED","CUSTOMER_CANCELLED"]},"PaymentInformationResponse":{"type":"object","description":"Details of a payment","properties":{"_links":{"$ref":"#/components/schemas/PaymentInformationResponse.Links"},"additionalFields":{"type":"array","description":"Additional fields for the payment","items":{"$ref":"#/components/schemas/PaymentAdditionalField"}},"amount":{"$ref":"#/components/schemas/Amount","description":"Current/actual amount of the payment. Updated as the order amount changes (e.g. incremental authorization); frozen once the customer pays."},"authorizedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount reserved on the customer's account via pre-authorization. Present only for payments with pre-authorization."},"availablePaymentMethods":{"type":"array","description":"Payment methods available for the payment","items":{"oneOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod.ApplePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.Card"},{"$ref":"#/components/schemas/AvailablePaymentMethod.ClickToPay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.GooglePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.OpenBanking"},{"$ref":"#/components/schemas/AvailablePaymentMethod.PayPal"}]}},"basket":{"$ref":"#/components/schemas/Basket"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"channel":{"$ref":"#/components/schemas/PaymentChannel"},"createdAt":{"type":"string","format":"date-time","description":"Date and time the payment was created"},"customer":{"$ref":"#/components/schemas/Customer"},"dynamicCurrencyConversion":{"$ref":"#/components/schemas/DynamicCurrencyConversionDataDto","description":"Dynamic currency conversion data used in last checkout session"},"environment":{"$ref":"#/components/schemas/Environment","description":"Indicates whether the payment belongs to the sandbox or the live environment"},"invoiceNumber":{"type":"string","description":"Merchant's invoice number"},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems."},"netAmount":{"$ref":"#/components/schemas/Amount","description":"Amount effectively retained by the merchant after all refunds have been applied. Present once the customer has paid."},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order."},"participantId":{"type":"string","description":"Unique ID of the participant","maxLength":64},"paymentId":{"type":"string","description":"Unique ID of the payment","maxLength":64},"paymentLinkId":{"type":"string","description":"ID of the payment link that was used to initiate the payment","maxLength":64},"paymentMethod":{"$ref":"#/components/schemas/PaymentInformation.PaymentMethod"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"paymentStatusReason":{"$ref":"#/components/schemas/PaymentStatusReason"},"preferredCountry":{"type":"string","description":"Default country for bank selection in the gateway hosted checkout page"},"refundedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount already refunded. Present only when the payment has refunds."},"shopAgreementId":{"type":"string","description":"Unique ID of the shop","maxLength":64},"shopRedirectUrl":{"type":"string","description":"URL of the shop the customer is redirected back to once the payment flow completes"}}},"PaymentInformationResponse.Links":{"type":"object","description":"Links related to the payment","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"PaymentAdditionalField":{"type":"object","description":"Represents an additional field associated with a payment","properties":{"id":{"type":"string","description":"ID of the additional field","maxLength":64},"name":{"type":"string","description":"Name of the additional field"},"value":{"type":"string","description":"Value of the additional field"}}},"Amount":{"type":"object","description":"Monetary amount together with its currency","properties":{"amount":{"type":"string","description":"The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. The decimal separator is a dot.\nCan be 0 for account verification (save payment method for future usage without initial payment).\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n  * 1056\n  * 5768.2\n  * 1.50\n  * 5877.78\n"},"currency":{"type":"string","description":"ISO 4217 alpha-3 currency code"}},"required":["amount","currency"]},"AvailablePaymentMethod.ApplePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true}}}],"description":"Apple Pay payment method available for the payment"},"AvailablePaymentMethod":{"description":"Represents an available payment method for a payment. The specific fields included in the response\ndepend on the type of payment method, as indicated by the 'type' field.\n","discriminator":{"mapping":{"APPLE_PAY":"#/components/schemas/AvailablePaymentMethod.ApplePay","CARD":"#/components/schemas/AvailablePaymentMethod.Card","CLICK_TO_PAY":"#/components/schemas/AvailablePaymentMethod.ClickToPay","GOOGLE_PAY":"#/components/schemas/AvailablePaymentMethod.GooglePay","OPEN_BANKING":"#/components/schemas/AvailablePaymentMethod.OpenBanking","PAYPAL":"#/components/schemas/AvailablePaymentMethod.PayPal"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/PaymentMethodType"}},"required":["type"]},"PaymentMethodType":{"type":"string","description":"Payment method used to complete a payment:\n\n* CARD - payment card\n* OPEN_BANKING - bank transfer initiated via open banking\n* CLICK_TO_PAY - Click to Pay wallet\n* APPLE_PAY - Apple Pay wallet\n* GOOGLE_PAY - Google Pay wallet\n* PAYPAL - PayPal wallet\n","enum":["APPLE_PAY","CARD","CLICK_TO_PAY","GOOGLE_PAY","OPEN_BANKING","PAYPAL"]},"CardBrand":{"type":"string","description":"Card scheme of the payment card","enum":["MASTERCARD","VISA"]},"AvailablePaymentMethod.Card":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nNote: this field is only returned in the sandbox environment.\n"}}}],"description":"Card payment method available for the payment"},"PaymentMethod.Links":{"type":"object","description":"Links for completing the payment using this payment method","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"AvailablePaymentMethod.ClickToPay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"},"srcDpaId":{"type":"string","description":"Digital payment application identifier used to initialize Click to Pay"}}}],"description":"Click to Pay payment method available for the payment"},"AvailablePaymentMethod.GooglePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}}],"description":"Google Pay payment method available for the payment"},"AvailablePaymentMethod.OpenBanking":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"banks":{"type":"array","items":{"$ref":"#/components/schemas/Bank"}}}}],"description":"Open banking payment method available for the payment, including the banks the customer can choose from"},"Bank":{"type":"object","description":"Information about a bank that can be used for payments","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"logo":{"type":"string","description":"SVG markup for the bank's logo"},"name":{"type":"string","description":"Name of the bank"},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this bank is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}},"AvailablePaymentMethod.PayPal":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"}],"description":"PayPal payment method available for the payment"},"Basket":{"type":"object","description":"Basket containing detailed information about items to be purchased","properties":{"items":{"type":"array","description":"List of items to be purchased","items":{"oneOf":[{"$ref":"#/components/schemas/BasketItem.Discount"},{"$ref":"#/components/schemas/BasketItem.Fee"},{"$ref":"#/components/schemas/BasketItem.Product"},{"$ref":"#/components/schemas/BasketItem.Shipping"},{"$ref":"#/components/schemas/BasketItem.Tax"}]},"minItems":1},"subtotalAmount":{"$ref":"#/components/schemas/Amount","description":"Subtotal amount, excluding taxes, shipping, and coupon discounts (calculated, if missing)"}},"required":["items"]},"BasketItem.Discount":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Discount amount"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Discount amount in percentage"}}}],"description":"Discount item","required":["amount"]},"BasketItem":{"description":"Detailed information about the item in the basket","discriminator":{"mapping":{"DISCOUNT":"#/components/schemas/BasketItem.Discount","FEE":"#/components/schemas/BasketItem.Fee","PRODUCT":"#/components/schemas/BasketItem.Product","SHIPPING":"#/components/schemas/BasketItem.Shipping","TAX":"#/components/schemas/BasketItem.Tax"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BasketItemType"}},"required":["type"]},"BasketItemType":{"type":"string","description":"Type of a basket line item:\n\n* PRODUCT - a product being purchased\n* TAX - a tax charge applied to the basket\n* SHIPPING - a shipping charge applied to the basket\n* FEE - an additional fee applied to the basket\n* DISCOUNT - a discount applied to the basket\n","enum":["DISCOUNT","FEE","PRODUCT","SHIPPING","TAX"]},"BasketItem.Fee":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for fee (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Fee item","required":["amount"]},"BasketItem.Product":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"imageUrl":{"type":"string","description":"URL to the image of the item, to be displayed in the gateway hosted checkout page"},"name":{"type":"string","description":"Name of the item","minLength":1},"price":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item (including taxes)"},"priceBeforeDiscount":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item before discount (including taxes)"},"quantity":{"type":"integer","format":"int32","description":"Quantity of the item","minimum":1},"sku":{"type":"string","description":"The SKU (Stock Keeping Unit) that identifies the item in the merchant's inventory system","maxLength":64,"minLength":0},"taxRate":{"type":"number","description":"Tax rate applied to the item"},"totalPrice":{"$ref":"#/components/schemas/Amount","description":"Total amount of all items (including taxes; calculated, if missing)"}}}],"description":"Product item","required":["name","price","quantity"]},"BasketItem.Shipping":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for shipping (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Shipping item","required":["amount"]},"BasketItem.Tax":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount of tax"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Tax amount in percentage"}}}],"description":"Tax item","required":["amount"]},"BillingModel":{"type":"string","description":"Describes the commercial billing model under which a payment is collected,\nwhether the payment is one-time, recurring, fulfillment-driven, or part of a predefined payment plan:\n\n* ONE_OFF - A payment that is not part of a predefined recurring, scheduled, or multi-payment billing model.\n    Additional payments may occur in the future, but each payment is initiated independently\n    rather than as part of an agreed payment schedule.\n    For example, regular retail purchases, one-time service fees, unscheduled merchant-initiated charges, ad hoc account top-ups.\n* SUBSCRIPTION - Payments made as part of an ongoing subscription agreement,\n    where charges recur automatically while the subscription remains active.\n    For example, streaming services, software subscriptions, gym memberships.\n* STANDING_ORDER - Recurring payments collected on a predefined schedule,\n    where the amount is typically determined by usage, consumption, or periodic billing rather than a fixed plan.\n    For example, electricity, telecommunications, or other utility bills.\n","enum":["ONE_OFF","SUBSCRIPTION","STANDING_ORDER"]},"PaymentChannel":{"type":"string","description":"Method or channel through which a payment was initiated:\n\n* CHECKOUT - customer actively completes a payment through a merchant (or gateway hosted) checkout experience, e.g. via shops webside or app.\n* MERCHANT_INITIATED - merchant or other backend system initiates a payment without the customer actively participating in that transaction.\n* PAYMENT_LINK - payment initiated by the customer opening a payment link.\n* INVOICE - payment initiated by the customer opening a payment link for an invoice.\n","enum":["CHECKOUT","MERCHANT_INITIATED","PAYMENT_LINK","INVOICE"]},"Customer":{"type":"object","description":"Information about the customer","properties":{"email":{"type":"string","format":"email","description":"The customer's email address","maxLength":255,"minLength":0},"name":{"type":"string","description":"The customer's full name or business name","maxLength":255,"minLength":0},"phone":{"type":"string","description":"The customer's mobile phone number in international format (with '+' and country code)"}}},"DynamicCurrencyConversionDataDto":{"type":"object","description":"Dynamic currency conversion data","properties":{"authorizationDetails":{"$ref":"#/components/schemas/DetailsDto"},"captureDetails":{"$ref":"#/components/schemas/DetailsDto"},"cardholderResponse":{"$ref":"#/components/schemas/DccCardholderResponseStatus"}}},"DetailsDto":{"type":"object","description":"Dynamic currency conversion (DCC) details","properties":{"conversionRate":{"type":"string","description":"Conversion rate used to convert amounts"},"markup":{"type":"string","description":"Any additional markup (as percentage) added during conversion"},"transactionAmount":{"$ref":"#/components/schemas/Amount","description":"Transaction amount offered to cardholder after DCC"}}},"DccCardholderResponseStatus":{"type":"string","description":"Cardholder response to DCC details from acquirer.\n\n* ACCEPTED - Accept DCC details\n* REJECTED - Reject DCC details\n\nThis status is available only for DCC enabled payments.\n","enum":["ACCEPTED","REJECTED"]},"Environment":{"type":"string","description":"Environment the payment belongs to:\n\n* SANDBOX - test environment used for integration testing\n* LIVE - production environment\n","enum":["SANDBOX","LIVE"]},"PaymentInformation.PaymentMethod":{"type":"object","description":"Payment method used for the payment","properties":{"card":{"$ref":"#/components/schemas/CardMethod"},"gatewayTokenId":{"type":"string","description":"ID of the gateway token created or used for this payment","maxLength":64},"openBanking":{"$ref":"#/components/schemas/OpenBankingMethod"},"type":{"$ref":"#/components/schemas/PaymentMethodType"}}},"CardMethod":{"type":"object","description":"Card used for the payment","properties":{"brand":{"$ref":"#/components/schemas/CardBrand","description":"Card scheme of the card used for the payment"},"cardArtUrl":{"type":"string","description":"URL of the card image supplied by the card network. Not available for every card."},"cardholderName":{"type":"string","description":"Name of the cardholder"},"expiry":{"$ref":"#/components/schemas/CardExpiry"},"lastFourDigits":{"type":"string","description":"Last four digits of the card number"},"preAuthorization":{"type":"boolean","description":"Whether the payment was authorized only and requires a separate capture request to settle the funds"}}},"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)"}}},"OpenBankingMethod":{"type":"object","description":"Bank used for the payment via open banking","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"iban":{"type":"string","description":"IBAN of the customer's bank account"},"name":{"type":"string","description":"Display name of the bank"}}},"PaymentStatus":{"type":"string","description":"Current lifecycle state of a payment:\n\n* INITIALIZED - the payment has been created but processing has not started yet\n* SENT_FOR_PROCESSING - the payment has been submitted for processing and the outcome is not yet known\n* ABANDONED - the customer did not complete the checkout session\n* AUTHORIZED - funds have been reserved on the customer's payment method but not yet captured\n* CAPTURED - the authorized funds have been captured\n* CANCELLED - the payment was cancelled before it completed\n* SETTLED - the payment has completed and funds have settled\n* FAILED - the payment attempt failed\n* REFUNDED - at least one refund has been completed against this payment\n","enum":["INITIALIZED","SENT_FOR_PROCESSING","ABANDONED","AUTHORIZED","CAPTURED","CANCELLED","SETTLED","FAILED","REFUNDED"]},"PaymentStatusReason":{"type":"string","description":"Business reason that explains why a payment has its current status:\n\n  - THREEDS_REJECTED - The payment could not be authorized because the issuer rejected the 3-D Secure authentication.\n  - THREEDS_FAILED - The customer did not successfully complete the 3-D Secure authentication process.\n  - THREEDS_UNAVAILABLE - 3-D Secure authentication could not be completed due to a technical or service availability issue.\n  - INVALID_ACCOUNT - The provided card or account details are invalid.\n  - INVALID_EXPIRY - The card expiry date is invalid or the card has expired.\n  - INVALID_CSC - The card security code (CSC/CVV/CVC) is invalid.\n  - LOST_OR_STOLEN_CARD - The card has been reported as lost or stolen and cannot be used.\n  - DECLINED - The transaction was declined by the issuer, acquirer, or payment network.\n  - INSUFFICIENT_FUNDS - The account does not have sufficient funds to complete the transaction.\n  - LIMIT_EXCEEDED - A transaction amount, velocity, or payment method usage limit has been exceeded.\n  - SUSPECTED_FRAUD - The transaction was declined due to suspected fraudulent activity.\n  - ABANDONED - The customer did not complete the checkout session and the payment expired.\n  - CANCELLED - The payment was cancelled before it completed.\n  - CUSTOMER_CANCELLED - The customer cancelled the payment before it completed.\n  - ACQUIRER_UNAVAILABLE - The acquiring service was temporarily unavailable and could not process the transaction.\n  - ISSUER_UNAVAILABLE - The card issuer was temporarily unavailable and could not authorize the transaction.\n  - TIMEOUT - The transaction could not be completed because processing exceeded the allowed time limit.\n  - PROCESSING_ERROR - The transaction could not be completed due to a technical processing error. The operation may be retried; if the issue persists, contact the service provider.\n","enum":["THREEDS_REJECTED","THREEDS_FAILED","THREEDS_UNAVAILABLE","INVALID_ACCOUNT","INVALID_EXPIRY","INVALID_CSC","LOST_OR_STOLEN_CARD","DECLINED","INSUFFICIENT_FUNDS","LIMIT_EXCEEDED","SUSPECTED_FRAUD","ABANDONED","CANCELLED","CUSTOMER_CANCELLED","ACQUIRER_UNAVAILABLE","ISSUER_UNAVAILABLE","TIMEOUT","PROCESSING_ERROR"]},"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}/cancel":{"patch":{"description":"Cancels a payment that is active or authorized.\n\nTo return funds for a payment that has already been completed, use the refund endpoint.\n","operationId":"cancelPayment","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/CancelPaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInformationResponse"}}},"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":"Cancels a payment","tags":["Payments"]}}}}
```

## Captures an existing payment

> Capturing an authorized payment will complete (finalise) the payment, this is only used for card payments

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"The Payments APIs cover payment initiation and payment lifecycle operations.\n\nPayment initiation has separate endpoints for **CIT** and **MIT**:\n- **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.\n- **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.\n\nA payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment.\nThe Checkout Session APIs follow an action-driven workflow,\nwhere each response returns the current session status together with any actions required to progress the payment,\nsuch as customer authentication or bank account selection.\nYou should process the returned actions and continue the checkout session until a final status is reached,\nindicating that the payment has either been successfully completed or has failed.\n","name":"Payments"}],"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":{"CapturePaymentRequest":{"type":"object","description":"The request for capturing an existing payment","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount to be captured"}},"required":["amount"],"title":"Capture Payment Request"},"Amount":{"type":"object","description":"Monetary amount together with its currency","properties":{"amount":{"type":"string","description":"The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. The decimal separator is a dot.\nCan be 0 for account verification (save payment method for future usage without initial payment).\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n  * 1056\n  * 5768.2\n  * 1.50\n  * 5877.78\n"},"currency":{"type":"string","description":"ISO 4217 alpha-3 currency code"}},"required":["amount","currency"]},"PaymentInformationResponse":{"type":"object","description":"Details of a payment","properties":{"_links":{"$ref":"#/components/schemas/PaymentInformationResponse.Links"},"additionalFields":{"type":"array","description":"Additional fields for the payment","items":{"$ref":"#/components/schemas/PaymentAdditionalField"}},"amount":{"$ref":"#/components/schemas/Amount","description":"Current/actual amount of the payment. Updated as the order amount changes (e.g. incremental authorization); frozen once the customer pays."},"authorizedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount reserved on the customer's account via pre-authorization. Present only for payments with pre-authorization."},"availablePaymentMethods":{"type":"array","description":"Payment methods available for the payment","items":{"oneOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod.ApplePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.Card"},{"$ref":"#/components/schemas/AvailablePaymentMethod.ClickToPay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.GooglePay"},{"$ref":"#/components/schemas/AvailablePaymentMethod.OpenBanking"},{"$ref":"#/components/schemas/AvailablePaymentMethod.PayPal"}]}},"basket":{"$ref":"#/components/schemas/Basket"},"billingModel":{"$ref":"#/components/schemas/BillingModel"},"channel":{"$ref":"#/components/schemas/PaymentChannel"},"createdAt":{"type":"string","format":"date-time","description":"Date and time the payment was created"},"customer":{"$ref":"#/components/schemas/Customer"},"dynamicCurrencyConversion":{"$ref":"#/components/schemas/DynamicCurrencyConversionDataDto","description":"Dynamic currency conversion data used in last checkout session"},"environment":{"$ref":"#/components/schemas/Environment","description":"Indicates whether the payment belongs to the sandbox or the live environment"},"invoiceNumber":{"type":"string","description":"Merchant's invoice number"},"merchantReference":{"type":"string","description":"Optional reference associated with a specific payment.\nIntended for internal payment tracking purposes, such as reconciliation references, workflow identifiers,\nor any other payment-related metadata meaningful within merchant's systems."},"netAmount":{"$ref":"#/components/schemas/Amount","description":"Amount effectively retained by the merchant after all refunds have been applied. Present once the customer has paid."},"orderNumber":{"type":"string","description":"Order number that links the payment to a corresponding merchant's order.\nThe value is intended to be used by both the merchant and the customer when referencing the order."},"participantId":{"type":"string","description":"Unique ID of the participant","maxLength":64},"paymentId":{"type":"string","description":"Unique ID of the payment","maxLength":64},"paymentLinkId":{"type":"string","description":"ID of the payment link that was used to initiate the payment","maxLength":64},"paymentMethod":{"$ref":"#/components/schemas/PaymentInformation.PaymentMethod"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"paymentStatusReason":{"$ref":"#/components/schemas/PaymentStatusReason"},"preferredCountry":{"type":"string","description":"Default country for bank selection in the gateway hosted checkout page"},"refundedAmount":{"$ref":"#/components/schemas/Amount","description":"Amount already refunded. Present only when the payment has refunds."},"shopAgreementId":{"type":"string","description":"Unique ID of the shop","maxLength":64},"shopRedirectUrl":{"type":"string","description":"URL of the shop the customer is redirected back to once the payment flow completes"}}},"PaymentInformationResponse.Links":{"type":"object","description":"Links related to the payment","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","description":"A hyperlink to a related resource","properties":{"href":{"type":"string","description":"URL of the linked resource"}}},"PaymentAdditionalField":{"type":"object","description":"Represents an additional field associated with a payment","properties":{"id":{"type":"string","description":"ID of the additional field","maxLength":64},"name":{"type":"string","description":"Name of the additional field"},"value":{"type":"string","description":"Value of the additional field"}}},"AvailablePaymentMethod.ApplePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true}}}],"description":"Apple Pay payment method available for the payment"},"AvailablePaymentMethod":{"description":"Represents an available payment method for a payment. The specific fields included in the response\ndepend on the type of payment method, as indicated by the 'type' field.\n","discriminator":{"mapping":{"APPLE_PAY":"#/components/schemas/AvailablePaymentMethod.ApplePay","CARD":"#/components/schemas/AvailablePaymentMethod.Card","CLICK_TO_PAY":"#/components/schemas/AvailablePaymentMethod.ClickToPay","GOOGLE_PAY":"#/components/schemas/AvailablePaymentMethod.GooglePay","OPEN_BANKING":"#/components/schemas/AvailablePaymentMethod.OpenBanking","PAYPAL":"#/components/schemas/AvailablePaymentMethod.PayPal"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/PaymentMethodType"}},"required":["type"]},"PaymentMethodType":{"type":"string","description":"Payment method used to complete a payment:\n\n* CARD - payment card\n* OPEN_BANKING - bank transfer initiated via open banking\n* CLICK_TO_PAY - Click to Pay wallet\n* APPLE_PAY - Apple Pay wallet\n* GOOGLE_PAY - Google Pay wallet\n* PAYPAL - PayPal wallet\n","enum":["APPLE_PAY","CARD","CLICK_TO_PAY","GOOGLE_PAY","OPEN_BANKING","PAYPAL"]},"CardBrand":{"type":"string","description":"Card scheme of the payment card","enum":["MASTERCARD","VISA"]},"AvailablePaymentMethod.Card":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nNote: this field is only returned in the sandbox environment.\n"}}}],"description":"Card payment method available for the payment"},"PaymentMethod.Links":{"type":"object","description":"Links for completing the payment using this payment method","properties":{"checkoutRedirect":{"$ref":"#/components/schemas/Link"}}},"AvailablePaymentMethod.ClickToPay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"},"srcDpaId":{"type":"string","description":"Digital payment application identifier used to initialize Click to Pay"}}}],"description":"Click to Pay payment method available for the payment"},"AvailablePaymentMethod.GooglePay":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"brands":{"type":"array","description":"Card schemes accepted for this payment method","items":{"$ref":"#/components/schemas/CardBrand"},"uniqueItems":true},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this payment method is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}}],"description":"Google Pay payment method available for the payment"},"AvailablePaymentMethod.OpenBanking":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/PaymentMethod.Links"},"banks":{"type":"array","items":{"$ref":"#/components/schemas/Bank"}}}}],"description":"Open banking payment method available for the payment, including the banks the customer can choose from"},"Bank":{"type":"object","description":"Information about a bank that can be used for payments","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"country":{"type":"string","description":"Country code in ISO 3166-1 alpha-2 format"},"logo":{"type":"string","description":"SVG markup for the bank's logo"},"name":{"type":"string","description":"Name of the bank"},"sandboxAvailable":{"type":"boolean","description":"Indicates whether this bank is available in the sandbox environment.\nThis field is only included in responses when using the sandbox environment.\n"}}},"AvailablePaymentMethod.PayPal":{"allOf":[{"$ref":"#/components/schemas/AvailablePaymentMethod"}],"description":"PayPal payment method available for the payment"},"Basket":{"type":"object","description":"Basket containing detailed information about items to be purchased","properties":{"items":{"type":"array","description":"List of items to be purchased","items":{"oneOf":[{"$ref":"#/components/schemas/BasketItem.Discount"},{"$ref":"#/components/schemas/BasketItem.Fee"},{"$ref":"#/components/schemas/BasketItem.Product"},{"$ref":"#/components/schemas/BasketItem.Shipping"},{"$ref":"#/components/schemas/BasketItem.Tax"}]},"minItems":1},"subtotalAmount":{"$ref":"#/components/schemas/Amount","description":"Subtotal amount, excluding taxes, shipping, and coupon discounts (calculated, if missing)"}},"required":["items"]},"BasketItem.Discount":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Discount amount"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Discount amount in percentage"}}}],"description":"Discount item","required":["amount"]},"BasketItem":{"description":"Detailed information about the item in the basket","discriminator":{"mapping":{"DISCOUNT":"#/components/schemas/BasketItem.Discount","FEE":"#/components/schemas/BasketItem.Fee","PRODUCT":"#/components/schemas/BasketItem.Product","SHIPPING":"#/components/schemas/BasketItem.Shipping","TAX":"#/components/schemas/BasketItem.Tax"},"propertyName":"type"},"properties":{"type":{"$ref":"#/components/schemas/BasketItemType"}},"required":["type"]},"BasketItemType":{"type":"string","description":"Type of a basket line item:\n\n* PRODUCT - a product being purchased\n* TAX - a tax charge applied to the basket\n* SHIPPING - a shipping charge applied to the basket\n* FEE - an additional fee applied to the basket\n* DISCOUNT - a discount applied to the basket\n","enum":["DISCOUNT","FEE","PRODUCT","SHIPPING","TAX"]},"BasketItem.Fee":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for fee (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Fee item","required":["amount"]},"BasketItem.Product":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"imageUrl":{"type":"string","description":"URL to the image of the item, to be displayed in the gateway hosted checkout page"},"name":{"type":"string","description":"Name of the item","minLength":1},"price":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item (including taxes)"},"priceBeforeDiscount":{"$ref":"#/components/schemas/Amount","description":"Individual amount of the item before discount (including taxes)"},"quantity":{"type":"integer","format":"int32","description":"Quantity of the item","minimum":1},"sku":{"type":"string","description":"The SKU (Stock Keeping Unit) that identifies the item in the merchant's inventory system","maxLength":64,"minLength":0},"taxRate":{"type":"number","description":"Tax rate applied to the item"},"totalPrice":{"$ref":"#/components/schemas/Amount","description":"Total amount of all items (including taxes; calculated, if missing)"}}}],"description":"Product item","required":["name","price","quantity"]},"BasketItem.Shipping":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount for shipping (including taxes)"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"}}}],"description":"Shipping item","required":["amount"]},"BasketItem.Tax":{"allOf":[{"$ref":"#/components/schemas/BasketItem"},{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount of tax"},"description":{"type":"string","description":"Description of the item","maxLength":512,"minLength":0},"name":{"type":"string","description":"Name of the item"},"percentage":{"type":"number","description":"Tax amount in percentage"}}}],"description":"Tax item","required":["amount"]},"BillingModel":{"type":"string","description":"Describes the commercial billing model under which a payment is collected,\nwhether the payment is one-time, recurring, fulfillment-driven, or part of a predefined payment plan:\n\n* ONE_OFF - A payment that is not part of a predefined recurring, scheduled, or multi-payment billing model.\n    Additional payments may occur in the future, but each payment is initiated independently\n    rather than as part of an agreed payment schedule.\n    For example, regular retail purchases, one-time service fees, unscheduled merchant-initiated charges, ad hoc account top-ups.\n* SUBSCRIPTION - Payments made as part of an ongoing subscription agreement,\n    where charges recur automatically while the subscription remains active.\n    For example, streaming services, software subscriptions, gym memberships.\n* STANDING_ORDER - Recurring payments collected on a predefined schedule,\n    where the amount is typically determined by usage, consumption, or periodic billing rather than a fixed plan.\n    For example, electricity, telecommunications, or other utility bills.\n","enum":["ONE_OFF","SUBSCRIPTION","STANDING_ORDER"]},"PaymentChannel":{"type":"string","description":"Method or channel through which a payment was initiated:\n\n* CHECKOUT - customer actively completes a payment through a merchant (or gateway hosted) checkout experience, e.g. via shops webside or app.\n* MERCHANT_INITIATED - merchant or other backend system initiates a payment without the customer actively participating in that transaction.\n* PAYMENT_LINK - payment initiated by the customer opening a payment link.\n* INVOICE - payment initiated by the customer opening a payment link for an invoice.\n","enum":["CHECKOUT","MERCHANT_INITIATED","PAYMENT_LINK","INVOICE"]},"Customer":{"type":"object","description":"Information about the customer","properties":{"email":{"type":"string","format":"email","description":"The customer's email address","maxLength":255,"minLength":0},"name":{"type":"string","description":"The customer's full name or business name","maxLength":255,"minLength":0},"phone":{"type":"string","description":"The customer's mobile phone number in international format (with '+' and country code)"}}},"DynamicCurrencyConversionDataDto":{"type":"object","description":"Dynamic currency conversion data","properties":{"authorizationDetails":{"$ref":"#/components/schemas/DetailsDto"},"captureDetails":{"$ref":"#/components/schemas/DetailsDto"},"cardholderResponse":{"$ref":"#/components/schemas/DccCardholderResponseStatus"}}},"DetailsDto":{"type":"object","description":"Dynamic currency conversion (DCC) details","properties":{"conversionRate":{"type":"string","description":"Conversion rate used to convert amounts"},"markup":{"type":"string","description":"Any additional markup (as percentage) added during conversion"},"transactionAmount":{"$ref":"#/components/schemas/Amount","description":"Transaction amount offered to cardholder after DCC"}}},"DccCardholderResponseStatus":{"type":"string","description":"Cardholder response to DCC details from acquirer.\n\n* ACCEPTED - Accept DCC details\n* REJECTED - Reject DCC details\n\nThis status is available only for DCC enabled payments.\n","enum":["ACCEPTED","REJECTED"]},"Environment":{"type":"string","description":"Environment the payment belongs to:\n\n* SANDBOX - test environment used for integration testing\n* LIVE - production environment\n","enum":["SANDBOX","LIVE"]},"PaymentInformation.PaymentMethod":{"type":"object","description":"Payment method used for the payment","properties":{"card":{"$ref":"#/components/schemas/CardMethod"},"gatewayTokenId":{"type":"string","description":"ID of the gateway token created or used for this payment","maxLength":64},"openBanking":{"$ref":"#/components/schemas/OpenBankingMethod"},"type":{"$ref":"#/components/schemas/PaymentMethodType"}}},"CardMethod":{"type":"object","description":"Card used for the payment","properties":{"brand":{"$ref":"#/components/schemas/CardBrand","description":"Card scheme of the card used for the payment"},"cardArtUrl":{"type":"string","description":"URL of the card image supplied by the card network. Not available for every card."},"cardholderName":{"type":"string","description":"Name of the cardholder"},"expiry":{"$ref":"#/components/schemas/CardExpiry"},"lastFourDigits":{"type":"string","description":"Last four digits of the card number"},"preAuthorization":{"type":"boolean","description":"Whether the payment was authorized only and requires a separate capture request to settle the funds"}}},"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)"}}},"OpenBankingMethod":{"type":"object","description":"Bank used for the payment via open banking","properties":{"bankId":{"type":"string","description":"Unique ID of the bank, used to select it when creating a checkout session"},"iban":{"type":"string","description":"IBAN of the customer's bank account"},"name":{"type":"string","description":"Display name of the bank"}}},"PaymentStatus":{"type":"string","description":"Current lifecycle state of a payment:\n\n* INITIALIZED - the payment has been created but processing has not started yet\n* SENT_FOR_PROCESSING - the payment has been submitted for processing and the outcome is not yet known\n* ABANDONED - the customer did not complete the checkout session\n* AUTHORIZED - funds have been reserved on the customer's payment method but not yet captured\n* CAPTURED - the authorized funds have been captured\n* CANCELLED - the payment was cancelled before it completed\n* SETTLED - the payment has completed and funds have settled\n* FAILED - the payment attempt failed\n* REFUNDED - at least one refund has been completed against this payment\n","enum":["INITIALIZED","SENT_FOR_PROCESSING","ABANDONED","AUTHORIZED","CAPTURED","CANCELLED","SETTLED","FAILED","REFUNDED"]},"PaymentStatusReason":{"type":"string","description":"Business reason that explains why a payment has its current status:\n\n  - THREEDS_REJECTED - The payment could not be authorized because the issuer rejected the 3-D Secure authentication.\n  - THREEDS_FAILED - The customer did not successfully complete the 3-D Secure authentication process.\n  - THREEDS_UNAVAILABLE - 3-D Secure authentication could not be completed due to a technical or service availability issue.\n  - INVALID_ACCOUNT - The provided card or account details are invalid.\n  - INVALID_EXPIRY - The card expiry date is invalid or the card has expired.\n  - INVALID_CSC - The card security code (CSC/CVV/CVC) is invalid.\n  - LOST_OR_STOLEN_CARD - The card has been reported as lost or stolen and cannot be used.\n  - DECLINED - The transaction was declined by the issuer, acquirer, or payment network.\n  - INSUFFICIENT_FUNDS - The account does not have sufficient funds to complete the transaction.\n  - LIMIT_EXCEEDED - A transaction amount, velocity, or payment method usage limit has been exceeded.\n  - SUSPECTED_FRAUD - The transaction was declined due to suspected fraudulent activity.\n  - ABANDONED - The customer did not complete the checkout session and the payment expired.\n  - CANCELLED - The payment was cancelled before it completed.\n  - CUSTOMER_CANCELLED - The customer cancelled the payment before it completed.\n  - ACQUIRER_UNAVAILABLE - The acquiring service was temporarily unavailable and could not process the transaction.\n  - ISSUER_UNAVAILABLE - The card issuer was temporarily unavailable and could not authorize the transaction.\n  - TIMEOUT - The transaction could not be completed because processing exceeded the allowed time limit.\n  - PROCESSING_ERROR - The transaction could not be completed due to a technical processing error. The operation may be retried; if the issue persists, contact the service provider.\n","enum":["THREEDS_REJECTED","THREEDS_FAILED","THREEDS_UNAVAILABLE","INVALID_ACCOUNT","INVALID_EXPIRY","INVALID_CSC","LOST_OR_STOLEN_CARD","DECLINED","INSUFFICIENT_FUNDS","LIMIT_EXCEEDED","SUSPECTED_FRAUD","ABANDONED","CANCELLED","CUSTOMER_CANCELLED","ACQUIRER_UNAVAILABLE","ISSUER_UNAVAILABLE","TIMEOUT","PROCESSING_ERROR"]},"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}/capture":{"patch":{"description":"Capturing an authorized payment will complete (finalise) the payment, this is only used for card payments","operationId":"capturePayment","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/CapturePaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInformationResponse"}}},"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":"Captures an existing payment","tags":["Payments"]}}}}
```

## Increments a pre-authorized payment

> Increases the amount of a pre-authorized card payment\
> Available after the payment is authorized and before it is captured.

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"tags":[{"description":"The Payments APIs cover payment initiation and payment lifecycle operations.\n\nPayment initiation has separate endpoints for **CIT** and **MIT**:\n- **CIT (Customer-Initiated Transaction):** used when the customer is present during the payment flow, such as one-time purchases or setting up a subscription.\n- **MIT (Merchant-Initiated Transaction):** used when the customer is not present, such as subscription payments, automatic top-ups, or other unscheduled merchant-triggered payments.\n\nA payment is first initiated, and then Checkout Session APIs are used to provide payment method credentials to complete the payment.\nThe Checkout Session APIs follow an action-driven workflow,\nwhere each response returns the current session status together with any actions required to progress the payment,\nsuch as customer authentication or bank account selection.\nYou should process the returned actions and continue the checkout session until a final status is reached,\nindicating that the payment has either been successfully completed or has failed.\n","name":"Payments"}],"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":{"IncrementPaymentRequest":{"type":"object","description":"The request for incrementing an existing payment","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Amount to be incremented. Optional - if not provided, it is treated as 0, which leaves the authorized amount unchanged but still extends how long the payment can be incremented or captured."}},"title":"Increment Payment Request"},"Amount":{"type":"object","description":"Monetary amount together with its currency","properties":{"amount":{"type":"string","description":"The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. The decimal separator is a dot.\nCan be 0 for account verification (save payment method for future usage without initial payment).\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n  * 1056\n  * 5768.2\n  * 1.50\n  * 5877.78\n"},"currency":{"type":"string","description":"ISO 4217 alpha-3 currency code"}},"required":["amount","currency"]},"IncrementPaymentResponse":{"type":"object","description":"The response after incrementing a payment","properties":{"amount":{"$ref":"#/components/schemas/Amount","description":"Incremented amount"},"authorizedAmount":{"$ref":"#/components/schemas/Amount","description":"Resulting authorized amount after the increment"},"incrementId":{"type":"string","description":"Unique ID of the increment","maxLength":64},"incrementStatus":{"$ref":"#/components/schemas/IncrementStatus","description":"Current status of the increment"},"incrementStatusReason":{"$ref":"#/components/schemas/PaymentStatusReason","description":"Current status of the increment"},"paymentId":{"type":"string","description":"Unique ID of the incremented payment","maxLength":64}},"title":"Increment Payment Response"},"IncrementStatus":{"type":"string","description":"Outcome of an incremental authorization attempt:\n\n* APPROVED - the increment was approved and the payment's amount was increased\n* DECLINED - the increment was declined by the acquirer/network/issuer\n* FAILED - the increment failed due to a technical error, outcome is unclear and it may be safe to retry\n","enum":["APPROVED","DECLINED","FAILED"]},"PaymentStatusReason":{"type":"string","description":"Business reason that explains why a payment has its current status:\n\n  - THREEDS_REJECTED - The payment could not be authorized because the issuer rejected the 3-D Secure authentication.\n  - THREEDS_FAILED - The customer did not successfully complete the 3-D Secure authentication process.\n  - THREEDS_UNAVAILABLE - 3-D Secure authentication could not be completed due to a technical or service availability issue.\n  - INVALID_ACCOUNT - The provided card or account details are invalid.\n  - INVALID_EXPIRY - The card expiry date is invalid or the card has expired.\n  - INVALID_CSC - The card security code (CSC/CVV/CVC) is invalid.\n  - LOST_OR_STOLEN_CARD - The card has been reported as lost or stolen and cannot be used.\n  - DECLINED - The transaction was declined by the issuer, acquirer, or payment network.\n  - INSUFFICIENT_FUNDS - The account does not have sufficient funds to complete the transaction.\n  - LIMIT_EXCEEDED - A transaction amount, velocity, or payment method usage limit has been exceeded.\n  - SUSPECTED_FRAUD - The transaction was declined due to suspected fraudulent activity.\n  - ABANDONED - The customer did not complete the checkout session and the payment expired.\n  - CANCELLED - The payment was cancelled before it completed.\n  - CUSTOMER_CANCELLED - The customer cancelled the payment before it completed.\n  - ACQUIRER_UNAVAILABLE - The acquiring service was temporarily unavailable and could not process the transaction.\n  - ISSUER_UNAVAILABLE - The card issuer was temporarily unavailable and could not authorize the transaction.\n  - TIMEOUT - The transaction could not be completed because processing exceeded the allowed time limit.\n  - PROCESSING_ERROR - The transaction could not be completed due to a technical processing error. The operation may be retried; if the issue persists, contact the service provider.\n","enum":["THREEDS_REJECTED","THREEDS_FAILED","THREEDS_UNAVAILABLE","INVALID_ACCOUNT","INVALID_EXPIRY","INVALID_CSC","LOST_OR_STOLEN_CARD","DECLINED","INSUFFICIENT_FUNDS","LIMIT_EXCEEDED","SUSPECTED_FRAUD","ABANDONED","CANCELLED","CUSTOMER_CANCELLED","ACQUIRER_UNAVAILABLE","ISSUER_UNAVAILABLE","TIMEOUT","PROCESSING_ERROR"]},"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}/increment":{"patch":{"description":"Increases the amount of a pre-authorized card payment\nAvailable after the payment is authorized and before it is captured.","operationId":"incrementPayment","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/IncrementPaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncrementPaymentResponse"}}},"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":"Increments a pre-authorized payment","tags":["Payments"]}}}}
```


---

# 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.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.
