# Fiat deposit API

API for fiat deposit

## Get fiat info

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Fiat deposit API","description":"API for fiat deposit"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/fiat/deposit/order":{"post":{"tags":["Fiat deposit API"],"summary":"Get fiat info","description":"Permission annotations:","operationId":"getFiatOrder_1","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithAccountContainerUUIDKeyRequestDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OrderDepositResponsePGDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"WithAccountContainerUUIDKeyRequestDTO":{"required":["account","payload","timestamp"],"type":"object","properties":{"account":{"type":"string","description":"Merchant account ID. Request will be sent for this account"},"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/UUIDKeyRequestDTO"}},"description":"Object with request data"},"UUIDKeyRequestDTO":{"required":["id"],"type":"object","properties":{"id":{"type":"string","description":"id","format":"uuid"}},"description":"Object with request id and idempotencyKey parameters"},"OrderDepositResponsePGDTO":{"required":["currency","fiatCurrency","id","state"],"type":"object","properties":{"externalAddress":{"type":"string","description":"External address"},"id":{"type":"string","description":"Id","format":"uuid"},"cryptoAmount":{"type":"number","description":"Amount in crypto"},"fiatAmount":{"type":"number","description":"Amount in fiat"},"fiatCurrency":{"type":"string","description":"Fiat Currency"},"currency":{"type":"string","description":"Crypto Currency"},"state":{"type":"string","description":"State","enum":["CREATED","IN_PROGRESS","PAID","DEPOSIT_COMPLETED","EXTERNAL_WITHDRAWAL_IN_PROGRESS","PAUSED","COMPLETED","FAILED","EXPIRED"]},"hash":{"type":"string","description":"Hash"}},"description":"Order response"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Get method

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Fiat deposit API","description":"API for fiat deposit"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/fiat/deposit/method":{"post":{"tags":["Fiat deposit API"],"summary":"Get method","description":"Permission annotations:","operationId":"getMethod_1","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithAccountContainerPaymentMethodsDepositRequestPGDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PaymentMethodsDepositResponsePGDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"WithAccountContainerPaymentMethodsDepositRequestPGDTO":{"required":["account","payload","timestamp"],"type":"object","properties":{"account":{"type":"string","description":"Merchant account ID. Request will be sent for this account"},"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/PaymentMethodsDepositRequestPGDTO"}},"description":"Object with request data"},"PaymentMethodsDepositRequestPGDTO":{"required":["currency","external","fiatCurrency"],"type":"object","properties":{"itemId":{"type":"string","description":"Item id","format":"uuid"},"fiatCurrency":{"type":"string","description":"Fiat currency"},"cryptoAmount":{"type":"number","description":"Amount in crypto"},"fiatAmount":{"type":"number","description":"Amount in fiat"},"currency":{"type":"string","description":"Crypto Currency"},"external":{"type":"boolean","description":"Sign of external payment"}},"description":"Payment method request"},"PaymentMethodsDepositResponsePGDTO":{"required":["fixedRateId","methods","rateExpiredDate"],"type":"object","properties":{"fixedRateId":{"type":"string","description":"Rate id","format":"uuid"},"rateExpiredDate":{"type":"string","description":"Rate expired date","format":"date-time"},"methods":{"type":"array","description":"Payment methods","items":{"$ref":"#/components/schemas/PaymentMethodResponseDepositDTO"}}},"description":"Payment method response"},"PaymentMethodResponseDepositDTO":{"required":["cryptoAmount","currency","fiatAmount","fiatCurrency","itemId","maxLimit","minLimit","paymentMethodCode","paymentMethodName"],"type":"object","properties":{"itemId":{"type":"string","description":"Item id","format":"uuid"},"paymentMethodCode":{"type":"string","description":"Payment method code"},"paymentMethodName":{"type":"string","description":"Payment method name"},"fiatAmount":{"type":"number","description":"Amount in fiat"},"cryptoAmount":{"type":"number","description":"Amount in crypto"},"currency":{"type":"string","description":"Currency"},"fiatCurrency":{"type":"string","description":"Fiat currency"},"minLimit":{"type":"number","description":"Min limit in fiat"},"maxLimit":{"type":"number","description":"Max limit in fiat"}},"description":"Payment methods"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Generate key

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Fiat deposit API","description":"API for fiat deposit"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/fiat/deposit/key/generate":{"post":{"tags":["Fiat deposit API"],"summary":"Generate key","description":"Permission annotations:","operationId":"generateKey","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithAccountContainerKeyDepositRequestPGDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/KeyDepositPGDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"WithAccountContainerKeyDepositRequestPGDTO":{"required":["account","payload","timestamp"],"type":"object","properties":{"account":{"type":"string","description":"Merchant account ID. Request will be sent for this account"},"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/KeyDepositRequestPGDTO"}},"description":"Object with request data"},"KeyDepositRequestPGDTO":{"required":["currencyData","description","idempotencyKey","returnUrl"],"type":"object","properties":{"currencyData":{"type":"array","description":"Currency data","items":{"$ref":"#/components/schemas/CurrencyDataDTO"}},"description":{"maxLength":1000,"minLength":0,"type":"string","description":"Description"},"merchantExternalId":{"maxLength":255,"minLength":0,"type":"string","description":"Merchant external id"},"returnUrl":{"type":"string","description":"Merchant return url"},"idempotencyKey":{"type":"string","description":"Idempotency Key","format":"uuid"}},"description":"Request body for generating widget key for deposit"},"CurrencyDataDTO":{"required":["currency"],"type":"object","properties":{"currency":{"type":"string","description":"Currency"},"amount":{"type":"number","description":"Fixed amount"},"externalAddress":{"type":"string","description":"External address"}},"description":"Currency data"},"KeyDepositPGDTO":{"required":["expiredAt","key"],"type":"object","properties":{"key":{"type":"string","description":"Access key","format":"uuid"},"expiredAt":{"type":"string","description":"Access key expired date","format":"date-time"}},"description":"Access key response"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Get available fiat currencies

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Fiat deposit API","description":"API for fiat deposit"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/fiat/deposit/fiatCurrencies":{"post":{"tags":["Fiat deposit API"],"summary":"Get available fiat currencies","description":"Permission annotations:","operationId":"getAvailableFiatCurrencies","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyWithAccountContainer"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/FiatCurrencyListDepositPGDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"EmptyWithAccountContainer":{"required":["account","timestamp"],"type":"object","properties":{"account":{"type":"string","description":"Merchant account ID. Request will be sent for this account"},"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"}},"description":"Object with request data"},"FiatCurrencyListDepositPGDTO":{"required":["fiatCurrencies"],"type":"object","properties":{"fiatCurrencies":{"type":"array","description":"List of available fiat currencies","items":{"$ref":"#/components/schemas/FiatCurrency"}}},"description":"FiatCurrency  list response"},"FiatCurrency":{"type":"string"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Create order

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Fiat deposit API","description":"API for fiat deposit"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/fiat/deposit/create/order":{"post":{"tags":["Fiat deposit API"],"summary":"Create order","description":"Permission annotations:","operationId":"createOrder_1","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithAccountContainerCreateOnrampDepositOrderRequestPGDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OrderDepositResponsePGDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"WithAccountContainerCreateOnrampDepositOrderRequestPGDTO":{"required":["account","payload","timestamp"],"type":"object","properties":{"account":{"type":"string","description":"Merchant account ID. Request will be sent for this account"},"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/CreateOnrampDepositOrderRequestPGDTO"}},"description":"Object with request data"},"CreateOnrampDepositOrderRequestPGDTO":{"required":["description","idempotencyKey","itemId","rateId","returnUrl"],"type":"object","properties":{"rateId":{"type":"string","description":"Rate Id","format":"uuid"},"itemId":{"type":"string","description":"Item Id","format":"uuid"},"cryptoAmount":{"type":"number","description":"Amount in crypto"},"fiatAmount":{"type":"number","description":"Amount in fiat"},"description":{"maxLength":1000,"minLength":0,"type":"string","description":"Description"},"merchantExternalId":{"maxLength":255,"minLength":0,"type":"string","description":"Merchant external id"},"returnUrl":{"type":"string","description":"Merchant return url"},"idempotencyKey":{"type":"string","description":"Idempotency Key","format":"uuid"},"externalAddress":{"type":"string","description":"External address"}},"description":"Create order request"},"OrderDepositResponsePGDTO":{"required":["currency","fiatCurrency","id","state"],"type":"object","properties":{"externalAddress":{"type":"string","description":"External address"},"id":{"type":"string","description":"Id","format":"uuid"},"cryptoAmount":{"type":"number","description":"Amount in crypto"},"fiatAmount":{"type":"number","description":"Amount in fiat"},"fiatCurrency":{"type":"string","description":"Fiat Currency"},"currency":{"type":"string","description":"Crypto Currency"},"state":{"type":"string","description":"State","enum":["CREATED","IN_PROGRESS","PAID","DEPOSIT_COMPLETED","EXTERNAL_WITHDRAWAL_IN_PROGRESS","PAUSED","COMPLETED","FAILED","EXPIRED"]},"hash":{"type":"string","description":"Hash"}},"description":"Order response"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Confirm order

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Fiat deposit API","description":"API for fiat deposit"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/fiat/deposit/confirm/order":{"post":{"tags":["Fiat deposit API"],"summary":"Confirm order","description":"Permission annotations:","operationId":"confirmOrder","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithAccountContainerConfirmDepositOrderRequestPGDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RedirectUrlDepositPGDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"WithAccountContainerConfirmDepositOrderRequestPGDTO":{"required":["account","payload","timestamp"],"type":"object","properties":{"account":{"type":"string","description":"Merchant account ID. Request will be sent for this account"},"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/ConfirmDepositOrderRequestPGDTO"}},"description":"Object with request data"},"ConfirmDepositOrderRequestPGDTO":{"required":["id","requestParams"],"type":"object","properties":{"id":{"type":"string","description":"Order ID","format":"uuid"},"requestParams":{"type":"object","additionalProperties":{"type":"object","description":"Additional data"},"description":"Additional data"}},"description":"Confirm order request"},"RedirectUrlDepositPGDTO":{"required":["redirectUrl"],"type":"object","properties":{"redirectUrl":{"type":"string","description":"Redirect URL"}},"description":"Redirect URL response"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```
