# Invoice retrieval API

## Retrieves the invoice details.

> Retrieves the invoice details.\
> \
> This endpoint retrieves the invoice details for the specified invoice ID or order ID for specific merchant.\
> \
> Returns the invoice details.\
> \
> \### Invoice fields\
> \- \`id\` \*(string)\*: Unique invoice identifier.\
> \- \`amount\` \*(number)\*: The amount to deposit.\
> \- \`baseCurrency\` \*(string)\*: The base currency of the deposit.\
> \- \`paymentCurrency\` \*(string | null)\*: The payment currency of the deposit.\
> \- \`customerId\` \*(string)\*: The customer ID in your system.\
> \- \`orderId\` \*(string | null)\*: The associated order ID in your system.\
> \- \`status\` \*(string)\*: The current status of the invoice. Possible values: \`created\`, \`active\`, \`processing\`, \`canceled\`.\
> \- \`createdAt\` \*(string)\*: The date and time when the invoice was created, in ISO 8601 format.\
> \- \`paymentUrl\` \*(string)\*: The URL to which the customer will be redirected after completing checkout.\
> \- \`type\` \*(string)\*: The type of the invoice. Possible values: \`deposit\`.\
> \- \`accountId\` \*(string)\*: The merchant's account ID.\
> \- \`strategy\` \*(string)\*: The invoice strategy. Possible values: \`floating\`, \`fixed\`.\
> \- \`transactions\` \*(array)\*: List of transactions associated with this invoice, ordered by creation date (newest first).\
> &#x20; Each transaction contains: \`id\`, \`createdAt\`, \`type\`, \`status\`.

```json
{"openapi":"3.0.0","info":{"title":"x-gateway-external-api","version":"0.0.1"},"servers":[{"url":"https://api.xgateway.tech/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"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},"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},"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.\n\nUsed to specify the currency of accounts, exchange rates, and transactions in the payment\nprocessing system.\n\nIt provides a controlled and standardized list of supported currencies for all transactions and\nbalances in the payment processing system.\n\nNew currencies can be added to the payment processing system as additional members.\n\nSupported cryptocurrencies:\n- `BNB` - Binance Coin\n- `bUSDT` - Tether (pegged to USD), issued on BNB Smart Chain network (BEP20 token)\n- `BTC` - Bitcoin\n- `ETH` - Ether\n- `eUSDC` - USD Coin (pegged to USD), issued on Ethereum network (ERC20 token)\n- `eUSDT` - Tether (pegged to USD), issued on Ethereum network (ERC20 token)\n- `FTN` - Fasttoken\n- `POL` - POL\n- `pUSDC` - USD Coin (pegged to USD), issued on Polygon network (ERC20 token)\n- `SOL` - SOL\n- `sUSDT` - Tether (pegged to USD), issued on Solana network (SPL token)\n- `TRX` - Tronix (native coin), issued on Tron network\n- `tUSDC` - USD Coin (pegged to USD), issued on Tron network (TRC20 token)\n- `tUSDT` - Tether (pegged to USD), issued on Tron network (TRC20 token)\n- `wpUSDC` - wrapped USD Coin (pegged to USD), issued on Polygon network (ERC20 token)\n- `wpUSDT` - wrapped Tether (pegged to USD), issued on Polygon network (ERC20 token).\n\nSupported fiat currencies:\n- `AZN` - Azerbaijani Manat\n- `BDT` - Bangladeshi Taka\n- `EUR` - Euro\n- `GBP` - Pound Sterling\n- `INR` - Indian Rupee\n- `JPY` - Japanese Yen\n- `KES` - Kenyan Shilling\n- `PKR` - Pakistani Rupee\n- `RUB` - Russian Ruble\n- `TRY` - Turkish Lira\n- `USD` - United States Dollar\n- `UZS` - Uzbekistani Som."},"InvoiceStatus":{"description":"Represents the possible statuses of an invoice.","enum":["active","canceled","completed","created","processing"],"type":"string"},"InvoiceStrategy":{"description":"Represents the possible strategies of an invoice.","enum":["floating","fixed"],"type":"string"},"InvoiceType":{"description":"Represents the possible types of an invoice.","enum":["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},"TransactionType":{"description":"Represents the possible types of a transaction.\n\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"},"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},"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},"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."},"AppAuthenticationErrorResponse":{"description":"The AppAuthenticationErrorResponse object contains general information about the authentication\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}}},"paths":{"/invoices/{invoiceId}":{"get":{"operationId":"GetInvoiceAsync","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSuccessResponse_PublicInvoice_"}}}},"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"}}}}},"description":"Retrieves the invoice details.\n\nThis endpoint retrieves the invoice details for the specified invoice ID or order ID for specific merchant.\n\nReturns the invoice details.\n\n### Invoice fields\n- `id` *(string)*: Unique invoice identifier.\n- `amount` *(number)*: The amount to deposit.\n- `baseCurrency` *(string)*: The base currency of the deposit.\n- `paymentCurrency` *(string | null)*: The payment currency of the deposit.\n- `customerId` *(string)*: The customer ID in your system.\n- `orderId` *(string | null)*: The associated order ID in your system.\n- `status` *(string)*: The current status of the invoice. Possible values: `created`, `active`, `processing`, `canceled`.\n- `createdAt` *(string)*: The date and time when the invoice was created, in ISO 8601 format.\n- `paymentUrl` *(string)*: The URL to which the customer will be redirected after completing checkout.\n- `type` *(string)*: The type of the invoice. Possible values: `deposit`.\n- `accountId` *(string)*: The merchant's account ID.\n- `strategy` *(string)*: The invoice strategy. Possible values: `floating`, `fixed`.\n- `transactions` *(array)*: List of transactions associated with this invoice, ordered by creation date (newest first).\n  Each transaction contains: `id`, `createdAt`, `type`, `status`.","summary":"Retrieves the invoice details.","tags":["Invoice"],"parameters":[{"description":"- The invoice identifier or order ID.","in":"path","name":"invoiceId","required":true,"schema":{"type":"string"}}]}}}}
```
