{
  "openapi": "3.0.0",
  "info": {
    "title": "x-gateway-external-api",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.xgateway.tech/api/v2"
    }
  ],
  "paths": {
    "/invoices/{invoiceId}": {
      "get": {
        "operationId": "GetInvoiceAsync",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSuccessResponse_PublicInvoice_"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "data": {
                        "amount": "100.00",
                        "baseCurrency": "EUR",
                        "createdAt": "2026-01-28T14:35:00.000Z",
                        "customerId": "3f0a9b6d-8c2b-4f21-9f6b-7a8e2d5c4b1f",
                        "id": "5d7c2f4a-1b6e-4e3a-8c9f-2a3b4d5e6f7a",
                        "paymentUrl": "https://checkout.xgateway.tech/5d7c2f4a-1b6e-4e3a-8c9f-2a3b4d5e6f7a",
                        "status": "created",
                        "strategy": "floating",
                        "type": "deposit",
                        "accountId": "9a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
                        "orderId": "f1e2d3c4-b5a6-7f8e-9d0c-1b2a3e4f5d6c",
                        "paymentCurrency": "EUR",
                        "transactions": [
                          {
                            "id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
                            "createdAt": "2026-01-28T14:40:00.000Z",
                            "type": "deposit",
                            "status": "confirmed"
                          }
                        ]
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppAuthenticationErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "internal_server_error",
                          "message": "Something went wrong on our end. We're working on fixing it."
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Retrieves the invoice details.\r\n\r\nThis endpoint retrieves the invoice details for the specified invoice ID or order ID for specific merchant.\r\n\r\nReturns the invoice details.\r\n\r\n### Invoice fields\r\n- `id` *(string)*: Unique invoice identifier.\r\n- `amount` *(number)*: The amount to deposit.\r\n- `baseCurrency` *(string)*: The base currency of the deposit.\r\n- `paymentCurrency` *(string | null)*: The payment currency of the deposit.\r\n- `customerId` *(string)*: The customer ID in your system.\r\n- `orderId` *(string | null)*: The associated order ID in your system.\r\n- `status` *(string)*: The current status of the invoice. Possible values: `created`, `active`, `processing`, `canceled`.\r\n- `createdAt` *(string)*: The date and time when the invoice was created, in ISO 8601 format.\r\n- `paymentUrl` *(string)*: The URL to which the customer will be redirected after completing checkout.\r\n- `type` *(string)*: The type of the invoice. Possible values: `deposit`.\r\n- `accountId` *(string)*: The merchant's account ID.\r\n- `strategy` *(string)*: The invoice strategy. Possible values: `floating`, `fixed`.\r\n- `transactions` *(array)*: List of transactions associated with this invoice, ordered by creation date (newest first).\r\n  Each transaction contains: `id`, `createdAt`, `type`, `status`.",
        "summary": "Retrieves the invoice details.",
        "tags": [
          "Invoice"
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "description": "- The invoice identifier or order ID.",
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AppClientErrorResponseCode": {
        "type": "string",
        "enum": [
          "bad_request",
          "db_violation",
          "unauthorized",
          "payment_required",
          "forbidden",
          "not_found",
          "method_not_allowed",
          "not_acceptable",
          "proxy_authentication_required",
          "request_timeout",
          "conflict",
          "db_unique_violation",
          "gone",
          "length_required",
          "precondition_failed",
          "payload_too_large",
          "uri_too_long",
          "unsupported_media_type",
          "range_not_satisfiable",
          "expectation_failed",
          "misdirected_request",
          "unprocessable_content",
          "db_non_null_violation",
          "locked",
          "failed_dependency",
          "upgrade_required",
          "precondition_required",
          "too_many_requests",
          "request_header_fields_too_large",
          "unavailable_for_legal_reasons"
        ],
        "nullable": false,
        "description": "The AppClientErrorResponseCode object contains all client error response codes."
      },
      "AppServerErrorResponseCode": {
        "type": "string",
        "enum": [
          "internal_server_error",
          "not_implemented",
          "bad_gateway",
          "service_unavailable",
          "gateway_timeout",
          "http_version_not_supported",
          "variant_also_negotiates",
          "insufficient_storage",
          "loop_detected",
          "not_extended",
          "network_authentication_required"
        ],
        "nullable": false,
        "description": "The AppServerErrorResponseCode object contains all server error response codes."
      },
      "IAppError": {
        "description": "The IAppError interface represents an application error message.",
        "properties": {
          "code": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppClientErrorResponseCode"
              },
              {
                "$ref": "#/components/schemas/AppServerErrorResponseCode"
              }
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppErrorResponse": {
        "description": "The AppErrorResponse object contains general information about the error message.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": false
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/IAppError"
            },
            "type": "array"
          }
        },
        "required": [
          "success",
          "errors"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppAuthenticationErrorResponse": {
        "description": "The AppAuthenticationErrorResponse object contains general information about the authentication\r\nerror.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": false
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/IAppError"
            },
            "type": "array",
            "default": [
              {
                "code": "unauthorized",
                "message": "You do not have permission to access this resource."
              }
            ]
          }
        },
        "required": [
          "success",
          "errors"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "Currency": {
        "type": "string",
        "enum": [
          "USDC",
          "USDT",
          "BNB",
          "bUSDT",
          "BTC",
          "ETH",
          "eUSDC",
          "eUSDT",
          "FTN",
          "POL",
          "pUSDC",
          "SOL",
          "sUSDT",
          "TRX",
          "tUSDC",
          "tUSDT",
          "wpUSDC",
          "wpUSDT",
          "EUR",
          "GBP",
          "AZN",
          "BDT",
          "INR",
          "JPY",
          "PKR",
          "RUB",
          "TRY",
          "UZS",
          "AUD",
          "BRL",
          "CAD",
          "CHF",
          "CZK",
          "DKK",
          "KES",
          "NOK",
          "NZD",
          "SEK",
          "USD"
        ],
        "description": "Represents all currencies in the payment processing system.\r\n\r\nUsed to specify the currency of accounts, exchange rates, and transactions in the payment\r\nprocessing system.\r\n\r\nIt provides a controlled and standardized list of supported currencies for all transactions and\r\nbalances in the payment processing system.\r\n\r\nNew currencies can be added to the payment processing system as additional members.\r\n\r\nSupported cryptocurrencies:\r\n- `BNB` - Binance Coin\r\n- `bUSDT` - Tether (pegged to USD), issued on BNB Smart Chain network (BEP20 token)\r\n- `BTC` - Bitcoin\r\n- `ETH` - Ether\r\n- `eUSDC` - USD Coin (pegged to USD), issued on Ethereum network (ERC20 token)\r\n- `eUSDT` - Tether (pegged to USD), issued on Ethereum network (ERC20 token)\r\n- `FTN` - Fasttoken\r\n- `POL` - POL\r\n- `pUSDC` - USD Coin (pegged to USD), issued on Polygon network (ERC20 token)\r\n- `SOL` - SOL\r\n- `sUSDT` - Tether (pegged to USD), issued on Solana network (SPL token)\r\n- `TRX` - Tronix (native coin), issued on Tron network\r\n- `tUSDC` - USD Coin (pegged to USD), issued on Tron network (TRC20 token)\r\n- `tUSDT` - Tether (pegged to USD), issued on Tron network (TRC20 token)\r\n- `wpUSDC` - wrapped USD Coin (pegged to USD), issued on Polygon network (ERC20 token)\r\n- `wpUSDT` - wrapped Tether (pegged to USD), issued on Polygon network (ERC20 token).\r\n\r\nSupported fiat currencies:\r\n- `AZN` - Azerbaijani Manat\r\n- `BDT` - Bangladeshi Taka\r\n- `EUR` - Euro\r\n- `GBP` - Pound Sterling\r\n- `INR` - Indian Rupee\r\n- `JPY` - Japanese Yen\r\n- `KES` - Kenyan Shilling\r\n- `PKR` - Pakistani Rupee\r\n- `RUB` - Russian Ruble\r\n- `TRY` - Turkish Lira\r\n- `USD` - United States Dollar\r\n- `UZS` - Uzbekistani Som."
      },
      "InvoiceStrategy": {
        "description": "Represents the possible strategies of an invoice.",
        "enum": [
          "floating",
          "fixed"
        ],
        "type": "string"
      },
      "InvoiceStatus": {
        "description": "Represents the possible statuses of an invoice.",
        "enum": [
          "active",
          "canceled",
          "completed",
          "created",
          "processing"
        ],
        "type": "string"
      },
      "InvoiceType": {
        "description": "Represents the possible types of an invoice.",
        "enum": [
          "deposit",
          "withdrawal"
        ],
        "type": "string"
      },
      "TransactionType": {
        "description": "Represents the possible types of a transaction.\r\n\r\nUsed to categorize transactions by their nature.",
        "enum": [
          "activation_expense",
          "cancellation",
          "cash_out",
          "change",
          "chargeback",
          "consolidation",
          "consolidation_expense",
          "correction_down",
          "correction_up",
          "deposit",
          "merchant_deposit",
          "money_out_expense",
          "settlement",
          "settlement_expense",
          "shadow_deposit",
          "withdrawal"
        ],
        "type": "string"
      },
      "PublicInvoiceTransaction": {
        "description": "Represents a minimal transaction summary exposed via the public invoice API.",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/TransactionType"
          },
          "status": {
            "type": "string",
            "description": "Lowercased {@link NewTransactionStatus } value, e.g. `\"confirmed\"`, `\"processing\"`."
          }
        },
        "required": [
          "id",
          "createdAt",
          "type",
          "status"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "PublicInvoice": {
        "properties": {
          "amount": {
            "type": "string"
          },
          "baseCurrency": {
            "$ref": "#/components/schemas/Currency"
          },
          "createdAt": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "strategy": {
            "$ref": "#/components/schemas/InvoiceStrategy"
          },
          "type": {
            "$ref": "#/components/schemas/InvoiceType"
          },
          "accountId": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "paymentCurrency": {
            "$ref": "#/components/schemas/Currency"
          },
          "paymentUrl": {
            "type": "string"
          },
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/PublicInvoiceTransaction"
            },
            "type": "array"
          }
        },
        "required": [
          "amount",
          "baseCurrency",
          "createdAt",
          "customerId",
          "id",
          "status",
          "strategy",
          "type",
          "transactions"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppSuccessResponse_PublicInvoice_": {
        "description": "The AppSuccessResponse object contains general information about the success execution.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": true
          },
          "data": {
            "$ref": "#/components/schemas/PublicInvoice"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "api_key": {
        "in": "header",
        "name": "x-api-key",
        "type": "apiKey"
      }
    }
  }
}