# Transaction

## Retrieving many transactions

> Retrieves many payment transactions. A particular transaction contains all transactions' events attached as an entries of the response body.  <br>

```json
{"openapi":"3.0.0","info":{"title":"Payment-Gateway Service","version":"0.0.1"},"tags":[{"name":"Transaction"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["payment-gateway.paymenttransactions_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"payment-gateway.paymentmodes_read":"Needed for reading payment modes by a tenant employee.","payment-gateway.paymentmodes_manage":"Needed to manage payment modes by a tenant employee.","payment-gateway.authorize_manage":"Needed to perform a payment authorization flow by a tenant employee.","payment-gateway.capture_manage":"Needed to perform a payment capture flow by a tenant employee.","payment-gateway.refund_manage":"Needed to perform a payment refund flow by a tenant employee.","payment-gateway.cancel_manage":"Needed to perform a payment cancel flow by a tenant employee.","payment-gateway.paymenttransactions_read":"Needed to read all transaction details by a tenant employee."}}}}},"responses":{"paymentTransactionsResponse":{"description":"Payment transactions response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/paymentTransactionResponse"}}}},"headers":{"X-Total-Count":{"description":"'The total number of entities in the database matching the specified query criteria.\nReturned if request X-Total-Count header has been set to true.'","schema":{"type":"number"}}}},"common_response_Unauthorized_401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"common_response_Forbidden_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}},"common_response_InternalServerError_500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}}},"schemas":{"paymentTransactionResponse":{"title":"paymentTransactionResponse","type":"object","properties":{"id":{"type":"string","description":"A unique identifier of a payment transaction."},"provider":{"$ref":"#/components/schemas/provider","description":"Indicates which provider should be used."},"paymentInformation":{"type":"object","description":"Information related to a payment mode.","properties":{"paymentMode":{"type":"string","description":"A unique identifier of a payment mode configured for the tenant."},"creditCardToken":{"type":"string","description":"Token of the credit card."},"cardHolderName":{"type":"string","description":"Name of the card holder."},"payByLinkURL":{"type":"string","description":"URL for pay-by-link payment flow."},"iban":{"type":"string","description":"International Bank Account Number."},"bic":{"type":"string","description":"Bank Identifier Code (SWIFT)."},"sepaMandateReference":{"type":"string","description":"SEPA mandate reference."}}},"entries":{"type":"array","description":"List of transaction entries representing payment events.","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of a payment transaction entry."},"createdDate":{"type":"string","format":"date-time","description":"Timestamp when the event happened."},"type":{"type":"string","description":"Event type.","enum":["INITIALIZATION","AUTHORIZATION","CAPTURE","REFUND","CANCEL","AUTHORIZATION_START","AUTHORIZATION_CALLBACK"]},"successful":{"type":"boolean","description":"Indicates if the event completed successfully."},"amount":{"type":"object","properties":{"amount":{"type":"number","description":"Amount related to the event."},"currency":{"type":"string","description":"ISO currency code."}}},"summary":{"type":"string","description":"Summary of the event."},"remoteRequest":{"type":"string","description":"Serialized request body sent to payment provider."},"remoteResponse":{"type":"string","description":"Serialized response body from payment provider."},"remoteToken":{"type":"string","description":"Remote token returned by payment provider."},"additionalInfo":{"type":"object","description":"Additional info about the transaction.","additionalProperties":true}}}}}},"provider":{"type":"string","enum":["INVOICE","CASH_ON_DELIVERY","SPREEDLY","SPREEDLY_SAFERPAY","UNZER"]},"coreErrorMessage":{"anyOf":[{"type":"object","properties":{"code":{"type":"integer","description":"HTTP Status code."},"timestamp":{"type":"string","description":"Indicates a timestamp when the error occurred."},"message":{"type":"string","description":"Error message."}}},{"type":"object","properties":{"type":{"type":"string","description":"HTTP error type."},"status":{"type":"integer","description":"HTTP Status code."},"message":{"type":"string","description":"Error message."},"moreInfo":{"type":"string","description":"URL which additional information."},"details":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","description":"Detailed message."}}}}}}]}},"parameters":{"page_number_query_param":{"name":"pageNumber","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"The page number to be retrieved, where the size of the pages is specified by the `pageSize` parameter. The number of the first page is 1."},"page_size_query_param":{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","default":50,"minimum":1,"maximum":50},"description":"The number of documents being retrieved on one page."},"sort_query_param":{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Fields to sort the response data by following the order of the parameters from left to right. Can contain multiple fields in the following format: `field name:sort direction`, separated by a comma. The colon preceding the `sort direction` parameter is optional, and the descending order is taken only if it is equal to `desc` or `DESC`. The ascending order is assumed in any other case."},"x_total_count_header":{"name":"X-Total-Count","in":"header","required":false,"schema":{"type":"boolean"},"description":"To get information how many entities meet the filtering requirements, the `X-Total-Count` header has been introduced. The header is optional and its default value is `false`. If the header is provided and it is set to `true`, then the total count is returned in the `X-Total-Count` response header. In both cases (X-Total-Count `true`, `false` or not provided), the response body has the same format (array of entities). This means that the information about the total count is returned only on demand, provided that the X-Total-Count header is present in a request."}}},"paths":{"/payment-gateway/{tenant}/transactions":{"get":{"summary":"Retrieving many transactions","tags":["Transaction"],"responses":{"200":{"$ref":"#/components/responses/paymentTransactionsResponse"},"401":{"$ref":"#/components/responses/common_response_Unauthorized_401"},"403":{"$ref":"#/components/responses/common_response_Forbidden_403"},"500":{"$ref":"#/components/responses/common_response_InternalServerError_500"}},"operationId":"GET-payment-gateway-list-transactions","description":"Retrieves many payment transactions. A particular transaction contains all transactions' events attached as an entries of the response body.  \n","parameters":[{"$ref":"#/components/parameters/page_number_query_param"},{"$ref":"#/components/parameters/page_size_query_param"},{"$ref":"#/components/parameters/sort_query_param"},{"$ref":"#/components/parameters/x_total_count_header"}]}}}}
```

## Retrieving a single transaction

> Retrieves a single payment transaction. The transaction contains all the transaction's events attached as an entries of the response body.  <br>

```json
{"openapi":"3.0.0","info":{"title":"Payment-Gateway Service","version":"0.0.1"},"tags":[{"name":"Transaction"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["payment-gateway.paymenttransactions_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"payment-gateway.paymentmodes_read":"Needed for reading payment modes by a tenant employee.","payment-gateway.paymentmodes_manage":"Needed to manage payment modes by a tenant employee.","payment-gateway.authorize_manage":"Needed to perform a payment authorization flow by a tenant employee.","payment-gateway.capture_manage":"Needed to perform a payment capture flow by a tenant employee.","payment-gateway.refund_manage":"Needed to perform a payment refund flow by a tenant employee.","payment-gateway.cancel_manage":"Needed to perform a payment cancel flow by a tenant employee.","payment-gateway.paymenttransactions_read":"Needed to read all transaction details by a tenant employee."}}}}},"responses":{"paymentTransactionResponse":{"description":"Payment transaction response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/paymentTransactionResponse"}}}},"common_response_Unauthorized_401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"common_response_Forbidden_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}},"common_response_NotFound_404":{"description":"Not found. The resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}},"common_response_InternalServerError_500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}}},"schemas":{"paymentTransactionResponse":{"title":"paymentTransactionResponse","type":"object","properties":{"id":{"type":"string","description":"A unique identifier of a payment transaction."},"provider":{"$ref":"#/components/schemas/provider","description":"Indicates which provider should be used."},"paymentInformation":{"type":"object","description":"Information related to a payment mode.","properties":{"paymentMode":{"type":"string","description":"A unique identifier of a payment mode configured for the tenant."},"creditCardToken":{"type":"string","description":"Token of the credit card."},"cardHolderName":{"type":"string","description":"Name of the card holder."},"payByLinkURL":{"type":"string","description":"URL for pay-by-link payment flow."},"iban":{"type":"string","description":"International Bank Account Number."},"bic":{"type":"string","description":"Bank Identifier Code (SWIFT)."},"sepaMandateReference":{"type":"string","description":"SEPA mandate reference."}}},"entries":{"type":"array","description":"List of transaction entries representing payment events.","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of a payment transaction entry."},"createdDate":{"type":"string","format":"date-time","description":"Timestamp when the event happened."},"type":{"type":"string","description":"Event type.","enum":["INITIALIZATION","AUTHORIZATION","CAPTURE","REFUND","CANCEL","AUTHORIZATION_START","AUTHORIZATION_CALLBACK"]},"successful":{"type":"boolean","description":"Indicates if the event completed successfully."},"amount":{"type":"object","properties":{"amount":{"type":"number","description":"Amount related to the event."},"currency":{"type":"string","description":"ISO currency code."}}},"summary":{"type":"string","description":"Summary of the event."},"remoteRequest":{"type":"string","description":"Serialized request body sent to payment provider."},"remoteResponse":{"type":"string","description":"Serialized response body from payment provider."},"remoteToken":{"type":"string","description":"Remote token returned by payment provider."},"additionalInfo":{"type":"object","description":"Additional info about the transaction.","additionalProperties":true}}}}}},"provider":{"type":"string","enum":["INVOICE","CASH_ON_DELIVERY","SPREEDLY","SPREEDLY_SAFERPAY","UNZER"]},"coreErrorMessage":{"anyOf":[{"type":"object","properties":{"code":{"type":"integer","description":"HTTP Status code."},"timestamp":{"type":"string","description":"Indicates a timestamp when the error occurred."},"message":{"type":"string","description":"Error message."}}},{"type":"object","properties":{"type":{"type":"string","description":"HTTP error type."},"status":{"type":"integer","description":"HTTP Status code."},"message":{"type":"string","description":"Error message."},"moreInfo":{"type":"string","description":"URL which additional information."},"details":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","description":"Detailed message."}}}}}}]}}},"paths":{"/payment-gateway/{tenant}/transactions/{transactionId}":{"get":{"summary":"Retrieving a single transaction","tags":["Transaction"],"responses":{"200":{"$ref":"#/components/responses/paymentTransactionResponse"},"401":{"$ref":"#/components/responses/common_response_Unauthorized_401"},"403":{"$ref":"#/components/responses/common_response_Forbidden_403"},"404":{"$ref":"#/components/responses/common_response_NotFound_404"},"500":{"$ref":"#/components/responses/common_response_InternalServerError_500"}},"operationId":"GET-payment-gateway-retrieve-transaction-by-transactionId","description":"Retrieves a single payment transaction. The transaction contains all the transaction's events attached as an entries of the response body.  \n"}}}}
```


---

# Agent Instructions: Querying This Documentation

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

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

```
GET https://developer.emporix.io/api-references-1/readme/api-reference-24/transaction.md?ask=<question>
```

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

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