# Get by Idempotent Key

**GET** `/dpm/hub-payment-info/v1/payments/info/{payment_id}/{idempotency_key}`

Base URL: `https://api.pre.globalgetnet.com`

__Retrieving Transaction Data Using Idempotency Keys__<br><br>This endpoint allows querying transaction components linked to a specific payment using an **idempotency key**. The idempotency mechanism ensures that repeated requests with the same key will always return the same response, preventing the creation of duplicate transactions.<br><br>**Notes:**<br>_- Using an idempotency key ensures that repeated queries always return the same transaction details without triggering duplicate operations.<br>- This endpoint is particularly useful for retrieving transaction statuses or confirming previously executed payment operations._

## Authorization

- PROD (oauth2)
- PRE (oauth2)
- SBX (oauth2)

## Path parameters

- `idempotency_key` (string, required)
  Idempotent key for the transaction.<br><br>If an identical request is submitted multiple times, the key ensures that the response is always related to the same payment (instead of creating multiple identical payments).
- `payment_id` (string, required)
  Payment ID to be used in the query

## Responses

### 200

OK

- `rel` ("AUTHORIZATION" | "CANCEL" | "CAPTURE" | "PURCHASE")
  Relationship of item to payment.
- `idempotency_key` (string<(a-Z | 0-9 | .-_)>)
  Idempotency key, used to control requests, must be unique per request, because if it is repeated, it will always be returned the same data.
- `registered_at` (string<date-time>)
  Registration date and time.
- `items` (object[])
  - `registered_at` (string<date-time>)
    Registration date and time.
  - `type` ("request" | "response" | "result")
    Record type.
  - `content` (object)
    Registry contents.
    - `idempotency_key` (string<(a-Z | 0-9 | .-_)>)
      Idempotency key, used to control requests, must be unique per request, because if it is repeated, it will always be returned the same data.
    - `seller_id` (string<uuid>)
      ECommerce identification code
    - `request_id` (string<uuid>)
      Request identifier. Unique for each request.
    - `payment_id` (string<uuid>)
      Payment identifier
    - `order_id` (string)
      Purchase identification code used by e-commerce (code or order number).
    - `amount` (integer)
      Purchase value in cents. It must be an integer.
    - `currency` (string)
      Currency identification (See code in <a href="https://docs.globalgetnet.com/es/articles/currency-codes">this</a> section).
    - `status` ("AUTHORIZED" | "APPROVED" | "DENIED" | "ERROR")
      Authorization Status
    - `payment_method` ("CREDIT_AUTHORIZATION")
      Payment method
    - `received_at` (string)
      Transaction date
    - `transaction_id` (string)
      Transaction identifier generated by the eCommerce platform
    - `original_transaction_id` (string)
      Original transaction identifier
    - `authorized_at` (string)
      Transaction authorization date
    - `reason_code` (string)
      Return code from the sender or the getnet capture system.
    - `reason_message` (string)
      Return message from the sender or the getnet capture system.
    - `acquirer` (string)
      Acquirer.
    - `soft_descriptor` (string)
      Text displayed on the buyer's card invoice. The field is optional. When you leave it empty, Getnet uses the trade name registered for the establishment. Getnet keeps letters, digits, spaces, and the asterisk. Accented characters are converted to their unaccented equivalent, so AÇÃO becomes ACAO. Every other character is removed.  Values longer than 22 characters are truncated rather than rejected.
    - `brand` ("MASTERCARD" | "VISA" | "AMEX" | "ELO" | "HIPERCARD")
      Bcard walker. Automatically populated by the API if not informed.
      Mandatory field for using Anti-Fraud
    - `authorization_code` (string)
      Authorization Code generated by the Issuer when the transaction is carried out successfully
    - `acquirer_transaction_id` (string)
      NSU of the GetNet transaction (Acquirer)
    - `eci` (string)
      Code indicating whether the transaction was processed with Bearer Authentication.
      00, 01 and 02 for Mastercard and 05, 06 and 07 for Visa and other brands
    - `total_installment_amount` (number)
      For installment transactions, this contains the total amount to be paid (amount plus interest, taxes, fees, etc.).
    - `first_installment_amount` (number)
      For installment transactions, this contains the value of the first installment to be paid.
    - `other_installment_amount` (number)
      For installment transactions, this contains the value of the remaining installments to be paid.

Example:

```json
{
  "rel": "AUTHORIZATION",
  "idempotency_key": "63c7f8ee-51a6-470d-bb76-ef762b62bfb7",
  "registered_at": "2011-10-05T14:48:00.000Z",
  "items": [
    {
      "registered_at": "2011-10-05T14:48:00.000Z",
      "type": "request",
      "content": {
        "idempotency_key": "63c7f8ee-51a6-470d-bb76-ef762b62bfb7",
        "seller_id": "9406df6c-3100-49ba-b4df-d81c1ad8a62b",
        "request_id": "daac03dc-73db-453f-9bea-b1391669d5d3",
        "payment_id": "2c341d28-491b-4cf8-aec7-eeb60136b7a5",
        "order_id": "ORDER-10187383",
        "amount": 8900,
        "currency": "BRL",
        "status": "APPROVED",
        "payment_method": "CREDIT_AUTHORIZATION",
        "received_at": "2020-06-30T18:32:51.222Z",
        "transaction_id": "3729756321501820",
        "original_transaction_id": "-1",
        "authorized_at": "2020-06-30T18:32:51.815Z",
        "reason_code": "00",
        "reason_message": "TRANSACTION EXECUTED SUCCESSFULLY",
        "acquirer": "GETNET",
        "soft_descriptor": "MEUECOMM*ORDER10187383",
        "brand": "VISA",
        "authorization_code": "017060",
        "acquirer_transaction_id": "000152147981",
        "eci": "07",
        "total_installment_amount": 8900,
        "first_installment_amount": 1485,
        "other_installment_amount": 1483
      }
    }
  ]
}
```

### 404

Not Found

- `message` (string)
  Error message
- `name` (string)
  Module or service that returned the error
- `status_code` (number)
  HTTP Status Code
- `details` (object[])
  Error details
  - `status` (string)
    Status
  - `error_code` (string)
    Error code
  - `payment_id` (string<uuid>)
    Payment identifier
  - `description` (string)
    Short description of the error
  - `description_detail` (string)
    Detailed description of the error

Example:

```json
{
  "message": "Not Found",
  "name": "GatewayTokenizationServiceError",
  "status_code": 404,
  "details": [
    {
      "status": "DENIED",
      "error_code": "TOKENIZATION-404",
      "payment_id": "2c341d28-491b-4cf8-aec7-eeb60136b7a5",
      "description": "Not Found",
      "description_detail": "Not found number_token, verify or renew your number_token or seller_id."
    }
  ]
}
```

### 500

Internal Server Error

- `message` (string)
  Error message
- `name` (string)
  Module or service that returned the error
- `status_code` (number)
  HTTP Status Code
- `details` (object[])
  Error details
  - `status` (string)
    Status
  - `error_code` (string)
    Error code
  - `description` (string)
    Short description of the error
  - `description_detail` (string)
    Detailed description of the error

Example:

```json
{
  "message": "Internal Server Error",
  "name": "GatewayRouterHTTPServicesError",
  "status_code": 500,
  "details": [
    {
      "status": "ERROR",
      "error_code": "GENERIC-500",
      "description": "Internal Server Error",
      "description_detail": "The server encountered an unexpected error"
    }
  ]
}
```