{"openapi":"3.0.3","info":{"title":"OTC (Coming soon)","version":"1.0","description":"OTC (Over-The-Counter) deals are transactions that occur directly between two parties, without the supervision of an exchange. This API facilitates the management of these direct financial transactions.","x-logo":{"url":""}},"servers":[{"url":"https://api-otc-sandbox.vertofx.com","description":"The base URL for the OTC Deals API."}],"paths":{"/deals":{"get":{"tags":["OTC"],"summary":"Gets a list of OTC deals.","description":"Retrieves a paginated list of OTC deals. This endpoint supports filtering and sorting of deals based on various criteria. ","security":[{"JWTAuth":[]}],"parameters":[{"name":"includeArchived","in":"query","required":false,"schema":{"type":"boolean"},"description":"If true, includes archived deals in the results. By default, archived deals are excluded."},{"name":"sellCurrency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Currency"},"description":"Filters deals by the currency being sold."},{"name":"buyCurrency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Currency"},"description":"Filters deals by the currency being bought."},{"name":"referenceId","in":"query","required":false,"schema":{"type":"string"},"description":"Filters deals by a specific reference ID."},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/DealStatus"},"description":"Filters deals by their current status."},{"name":"inwardStartDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filters deals by the inward settlement time, starting from this date and time."},{"name":"inwardEndDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filters deals by the inward settlement time, ending at this date and time."},{"name":"outwardStartDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filters deals by the outward settlement time, starting from this date and time."},{"name":"outwardEndDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filters deals by the outward settlement time, ending at this date and time."},{"name":"createdStartDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filters deals by their creation date, starting from this date and time."},{"name":"createdEndDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filters deals by their creation date, ending at this date and time."},{"name":"limit","$ref":"#/components/parameters/limitParam","description":"The maximum number of items to return in the response."},{"name":"skip","$ref":"#/components/parameters/skipParam","description":"The number of items to skip before starting to return the results. Used for pagination."},{"name":"orderBy","in":"query","required":false,"schema":{"type":"string","enum":["createdDateAsc","createdDateDesc"],"default":"createdDateDesc"},"description":"Specifies the order in which to return the deals, either by ascending or descending creation date."},{"name":"baseCurrency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Currency"},"description":"Specifies the currency to get equivalent amount in the specified currency."},{"name":"minimumAmount","in":"query","required":false,"schema":{"type":"number"},"description":"Filters deals by a minimum amount."},{"name":"maximumAmount","in":"query","required":false,"schema":{"type":"number"},"description":"Filters deals by a maximum amount."}],"responses":{"200":{"description":"Resultant paginated list of deals.","content":{"application/json":{"schema":{"properties":{"totalCount":{"type":"integer","format":"int32","description":"The total number of deals available."},"items":{"type":"array","items":{"$ref":"#/components/schemas/DealResponse"},"description":"An array of DealResponse objects representing the retrieved deals."}}}}}},"400":{"description":"Unacceptable request. Indicates that the request was malformed or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"A server-side error occurred. Indicates an unexpected error on the server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"RequestReceiptRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The email address to which the receipt request is sent."}}},"RequestReceiptResponse":{"type":"object","properties":{"link":{"type":"string","description":"A link to access the receipt."},"linkAliveTillApprox":{"type":"string","format":"date-time","description":"The date and time until which the receipt link is valid."}}},"DealClientRequest":{"type":"object","required":["accept"],"properties":{"accept":{"type":"boolean","description":"Indicates whether the client accepts the deal."}}},"DealRequest":{"type":"object","required":["companyId","sellAmount","buyAmount","sellToBuyFxRate","inwardSettlementTime","outwardSettlementTime","expirationPeriodMins"],"properties":{"companyId":{"type":"string","description":"The unique identifier of the company involved in the deal."},"sellAmount":{"$ref":"#/components/schemas/AmountWithCurrency","description":"The amount being sold, including the currency."},"buyAmount":{"$ref":"#/components/schemas/AmountWithCurrency","description":"The amount being bought, including the currency."},"sellToBuyFxRate":{"$ref":"#/components/schemas/amount","description":"The foreign exchange rate at which the currency is being sold to buy."},"inwardSettlementTime":{"$ref":"#/components/schemas/settlementTimeOptions","description":"Details regarding the inward settlement time."},"outwardSettlementTime":{"$ref":"#/components/schemas/settlementTimeOptions","description":"Details regarding the outward settlement time."},"expirationPeriodMins":{"type":"number","description":"The period in minutes after which the deal expires."}}},"DealResponse":{"allOf":[{"$ref":"#/components/schemas/AuditableBaseObj"},{"$ref":"#/components/schemas/DealRequest"}],"type":"object","properties":{"isArchived":{"type":"boolean","description":"Filters out the list of deals"},"inwardSettlementReference":{"type":"string","description":"Reference for the inward settlement."},"outwardSettlementTxnId":{"type":"string","description":"Transaction ID for the outward settlement."},"refundTxnId":{"type":"string","description":"Transaction ID for any refunds related to the deal."},"referenceId":{"type":"string","description":"A unique reference ID for the deal."},"archivedDate":{"type":"string","format":"date-time","description":"The date and time when the deal was archived."},"clientAcceptedDate":{"type":"string","format":"date-time","description":"The date and time when the client accepted the deal."},"dealAcceptedByUserId":{"$ref":"#/components/schemas/Uuid","description":"The ID of the user who accepted the deal."},"status":{"$ref":"#/components/schemas/DealStatus","description":"Gives the currenct status of the Deal."},"baseEquiSellAmount":{"$ref":"#/components/schemas/AmountWithCurrency","description":"The equivalent sell amount in the base currency."}}},"DealStatus":{"type":"string","enum":["awaitingClientResponse","clientAccepted","clientRejected","expired","inwardSettlementDone","outwardSettlementDone","settled"],"description":"The status of the deal, indicating its current stage in the workflow."},"Error":{"required":["message","code"],"type":"object","properties":{"message":{"description":"The error message indicating what the issue is.","type":"string"},"code":{"description":"Displays HTTP error code.","type":"number"}}},"AuditableBaseObj":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid","description":"The unique identifier for the object."},"createdAt":{"type":"string","format":"date-time","description":"The date and time when the object was created."},"modifiedAt":{"type":"string","format":"date-time","description":"The date and time when the object was last modified."},"modifiedByUserId":{"$ref":"#/components/schemas/Uuid","description":"The ID of the user who last modified the object."}}},"settlementTimeOptions":{"type":"object","required":["date"],"properties":{"date":{"type":"string","format":"date-time","description":"The scheduled date and time for settlement."},"hint":{"type":"string","description":"Additional information or hints about the settlement time."},"actual":{"type":"string","format":"date-time","readOnly":true,"description":"The actual date and time of the settlement (read-only)."},"byUserId":{"type":"string","readOnly":true,"description":"The ID of the user who set the settlement time (read-only)."}}},"Currency":{"type":"string","enum":["AED","AUD","BDT","BGN","BHD","BRL","CAD","CHF","CNY","CZK","DKK","EGP","ETB","EUR","GBP","GHS","HKD","HRK","HUF","IDR","ILS","INR","JPY","KES","KWD","LKR","MAD","MXN","MYR","NGN","NOK","NZD","OMR","PHP","PKR","PLN","QAR","RON","RWF","SAR","SEK","THB","TRY","TZS","UGX","USD","XAF","XOF","ZAR","ZMW"],"description":"A 3-character ISO 4217 currency code representing a specific currency."},"AmountWithCurrency":{"type":"object","properties":{"currency":{"description":"The currency.","$ref":"#/components/schemas/Currency"},"amount":{"description":"The amount.","$ref":"#/components/schemas/amount"}},"description":"Represents an amount with its associated currency."},"amount":{"type":"number","format":"float","description":"A numeric value representing an amount."},"Uuid":{"type":"string","description":"A universally unique identifier (UUID)."},"dealId":{"type":"string","pattern":"^[a-f\\d]{24}$","description":"A unique identifier for a deal. It should be a 24-character hexadecimal string."}},"securitySchemes":{"JWTAuth":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"JSON Web Token (JWT) authentication scheme. Requires a valid JWT in the Authorization header."}},"headers":{},"responses":{},"parameters":{"sinceParam":{"name":"since","in":"query","description":"Filters results to include only items created on or after the specified\ndate and time.","required":false,"example":"2022-05-14T02:35:53.455+05:30","schema":{"type":"string","format":"date-time"}},"tillParam":{"name":"till","in":"query","description":"Filters results to include only items created on or before the specified\ndate and time.","required":false,"example":"2022-05-14T02:35:53.455+05:30","schema":{"type":"string","format":"date-time"}},"skipParam":{"name":"skip","in":"query","description":"The number of items to skip before starting to return the results. Used for pagination.","required":true,"schema":{"type":"integer","format":"int32"}},"limitParam":{"name":"limit","in":"query","description":"The maximum number of items to return in a single response. Used for pagination.","required":true,"schema":{"type":"integer","format":"int32"}}}},"security":[{"JWTAuth":[]}]}