# Retrieving transaction details

Endpoint: GET /payment/{serviceId}/transactions/{transactionId}
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer scopes: payment.transaction

## Path parameters:

  - `serviceId` (string, required)

  - `transactionId` (string, required)

## Header parameters:

  - `x-sim-flow-submerchant` (string)
    **Applies only to SimPay Flow integrators.** If you do not use SimPay Flow - skip this header.
Indicates the submerchant on whose behalf the request is made. The value is the submerchant ID (`flsm_...`)
or its `customId` assigned during registration (max. 36 characters).
**When is the header required?**
When `serviceId` in the path is an Online Payments service **linked to your active Flow service**
(the parent service, visible as `paymentService` in `GET /flow/{flowServiceId}`).
In that case every request to `/payment/{serviceId}/...` must include this header - without it you will receive
`422` with the `SIMPAY_FLOW_VALIDATION_ERROR` code.
For regular Online Payments services (not linked to Flow) the header is ignored.
**How does it work?**
- In the path you always pass the
`serviceId`
 of the
**parent service**
 (linked to the Flow service), not the submerchant's service.
- The request is executed in the context of the submerchant's Online Payments service - transactions, refunds, channels, subscriptions

and BLIK aliases belong to the given submerchant, and funds go to its wallet.
- Submerchant Online Payments services cannot be used directly - passing their ID as
`serviceId`

returns
`422`
 (
`VALIDATION_ERROR`
).

**Possible errors:**
- `422`

`SIMPAY_FLOW_VALIDATION_ERROR`
 - missing header for a service linked to Flow or an invalid value,
- `404`

`FLOW_SUBMERCHANT_NOT_FOUND`
 - the submerchant does not exist within this Flow service,
- `403`

`FLOW_SUBMERCHANT_NOT_ACTIVE`
 - the submerchant has not completed onboarding or is not active,
- `400`

`FLOW_SUBMERCHANT_PAYMENT_SERVICE_NOT_FOUND`
 /
`FLOW_SUBMERCHANT_PAYMENT_SERVICE_NOT_ACTIVE`
 - the submerchant's Online Payments service does not exist or is not active.

**Example:** `x-sim-flow-submerchant: flsm_aaaabbbb` or `x-sim-flow-submerchant: user-123`

## Response 200 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `data` (object, required)

  - `data.id` (string, required)
    Transaction ID

  - `data.payer_transaction_id` (string, required)
    Transaction identifier shared with the payer

  - `data.status` (string, required)
    Transaction status
    Enum: "transaction_new", "transaction_confirmed", "transaction_generated", "transaction_paid", "transaction_failure", "transaction_expired", "transaction_canceled", "transaction_refunded", "transaction_fraud", "transaction_fraud_possibility"

  - `data.amount` (object, required)

  - `data.amount.value` (number, required)
    Payment amount in the buyer's currency

  - `data.amount.currency` (string, required)
    Buyer's currency

  - `data.amount.commission` (number, required)
    SimPay's commission amount

  - `data.amount.commission_currency` (string, required)
    Commission currency (PLN/EUR)

  - `data.amount.original` (object)
    Original amounts declared at initiation

  - `data.amount.original.value` (number)
    Payment amount

  - `data.amount.original.currency` (string)
    Payment currency

  - `data.amount.original.pln_rate` (number)
    Currency exchange rate

  - `data.channel` (string, required)

  - `data.control` (string, required)

  - `data.description` (string, required)

  - `data.redirect` (object, required)

  - `data.redirect.success` (string, required)

  - `data.redirect.failure` (string, required)

  - `data.customer` (object, required)

  - `data.customer.name` (string, required)

  - `data.customer.email` (string, required)

  - `data.customer.ip` (string)

  - `data.customer.country` (string)

  - `data.billing` (object, required)

  - `data.billing.name` (string, required)

  - `data.billing.surname` (string, required)

  - `data.billing.street` (string, required)

  - `data.billing.building` (string)

  - `data.billing.flat` (string)

  - `data.billing.city` (string, required)

  - `data.billing.region` (string)

  - `data.billing.postalCode` (string, required)
    Postal code, format depends on the `country` field

  - `data.billing.country` (string, required)
    Country

  - `data.billing.company` (string)
    Company name

  - `data.cart` (array, required)

  - `data.cart.name` (string, required)
    Product name

  - `data.cart.quantity` (number, required)
    Quantity of the product

  - `data.cart.price` (number, required)
    Price of one product

  - `data.cart.producer` (string, required)
    Product brand

  - `data.cart.category` (string, required)
    Product category

  - `data.cart.code` (string, required)
    Product code

  - `data.paid_at` (string, required)
    Creation date in format: ISO 8601

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "UNAUTHORIZED"

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "INVALID_ABILITY_PROVIDED", "IP_ADDRESS_NOT_WHITELISTED"

## Response 404:

  - `404` (unknown)
    NotFound

## Response 404 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "SERVICE_NOT_FOUND", "TRANSACTION_NOT_FOUND", "ROUTE_NOT_FOUND"

