{"openapi":"3.1.0","info":{"title":"Virtual Account API","description":"","termsOfService":"","contact":{"name":"API Owner","email":"api@cfxlabs.com"},"license":{"name":"","url":""},"version":"@VERSION@","summary":"CFX Virtual Account API"},"components":{"securitySchemes":{"ApiKeyAuth":{"name":"x-api-key","type":"apiKey","in":"header"},"ApiSecretAuth":{"name":"x-api-secret","type":"apiKey","in":"header"}},"schemas":{}},"paths":{"/v1/virtual-accounts":{"get":{"summary":"Search virtual accounts","tags":["Virtual Account"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"ids","required":false,"description":"Comma-separated list of virtual account IDs"},{"schema":{"type":"string"},"in":"query","name":"ledgerAccountIds","required":false,"description":"Comma-separated list of ledger account IDs"},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Page number (1-indexed)"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"pageSize","required":false,"description":"Items per page"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","hasNext","page","pageSize"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","referenceId","status","accountNumber","routingNumber","type","ledgerAccountId","entityId","wireDepositInstructions","achDepositInstructions","rtpDepositInstructions","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"referenceId":{"type":"string","description":"Customer-supplied identifier","nullable":true},"status":{"type":"string","enum":["ACTIVE","PENDING"]},"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"type":{"type":"string","enum":["US_DEPOSIT","US_DDA"]},"ledgerAccountId":{"type":"string"},"entityId":{"type":"string"},"wireDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","beneficiaryName","currency","currencyCountryCode","beneficiaryAddress","bankName","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"beneficiaryAddress":{"type":"object","required":["line1","city","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}},"bankName":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"achDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"rtpDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"hasNext":{"type":"boolean"},"page":{"type":"integer"},"pageSize":{"type":"integer"}}}}}},"401":{"description":"The access to this resource has been denied","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"title":"UNAUTHORIZED","description":"The access to this resource has been denied"}}}},"default":{"description":"Catch-all error response for any unexpected internal errors","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INTERNAL"]},"message":{"type":"string","enum":["An unexpected internal error has occurred"]}},"title":"INTERNAL","description":"Catch-all error response for any unexpected internal errors"}}}}}}},"/v1/virtual-accounts/{id}":{"get":{"summary":"Get a virtual account","tags":["Virtual Account"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","referenceId","status","accountNumber","routingNumber","type","ledgerAccountId","entityId","wireDepositInstructions","achDepositInstructions","rtpDepositInstructions","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"referenceId":{"type":"string","description":"Customer-supplied identifier","nullable":true},"status":{"type":"string","enum":["ACTIVE","PENDING"]},"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"type":{"type":"string","enum":["US_DEPOSIT","US_DDA"]},"ledgerAccountId":{"type":"string"},"entityId":{"type":"string"},"wireDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","beneficiaryName","currency","currencyCountryCode","beneficiaryAddress","bankName","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"beneficiaryAddress":{"type":"object","required":["line1","city","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}},"bankName":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"achDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"rtpDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"401":{"description":"The access to this resource has been denied","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"title":"UNAUTHORIZED","description":"The access to this resource has been denied"}}}},"404":{"description":"The resource was not found","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"type":"string"}},"title":"NOT_FOUND","description":"The resource was not found"}}}},"default":{"description":"Catch-all error response for any unexpected internal errors","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INTERNAL"]},"message":{"type":"string","enum":["An unexpected internal error has occurred"]}},"title":"INTERNAL","description":"Catch-all error response for any unexpected internal errors"}}}}}},"patch":{"summary":"Update a virtual account","tags":["Virtual Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"referenceId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"header","name":"Idempotency-Key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","referenceId","status","accountNumber","routingNumber","type","ledgerAccountId","entityId","wireDepositInstructions","achDepositInstructions","rtpDepositInstructions","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"referenceId":{"type":"string","description":"Customer-supplied identifier","nullable":true},"status":{"type":"string","enum":["ACTIVE","PENDING"]},"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"type":{"type":"string","enum":["US_DEPOSIT","US_DDA"]},"ledgerAccountId":{"type":"string"},"entityId":{"type":"string"},"wireDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","beneficiaryName","currency","currencyCountryCode","beneficiaryAddress","bankName","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"beneficiaryAddress":{"type":"object","required":["line1","city","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}},"bankName":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"achDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"rtpDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true}}},"title":"INVALID_REQUEST","description":"The service cannot understand the request"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["MISSING_IDEMPOTENCY_KEY"]},"message":{"type":"string"}},"title":"MISSING_IDEMPOTENCY_KEY","description":"Missing required idempotency key header"}]}}}},"401":{"description":"The access to this resource has been denied","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"title":"UNAUTHORIZED","description":"The access to this resource has been denied"}}}},"404":{"description":"The resource was not found","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"type":"string"}},"title":"NOT_FOUND","description":"The resource was not found"}}}},"409":{"description":"A duplicate request with this idempotency key is already in progress","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["IDEMPOTENCY_IN_PROGRESS"]},"message":{"type":"string"}},"title":"IDEMPOTENCY_IN_PROGRESS","description":"A duplicate request with this idempotency key is already in progress"}}}},"422":{"description":"Another request with this idempotency key was made using a different body","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["IDEMPOTENCY_KEY_REUSED"]},"message":{"type":"string"}},"title":"IDEMPOTENCY_KEY_REUSED","description":"Another request with this idempotency key was made using a different body"}}}},"default":{"description":"Catch-all error response for any unexpected internal errors","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INTERNAL"]},"message":{"type":"string","enum":["An unexpected internal error has occurred"]}},"title":"INTERNAL","description":"Catch-all error response for any unexpected internal errors"}}}}}},"delete":{"summary":"Delete a virtual account","tags":["Virtual Account"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Virtual account was deleted successfully"},"401":{"description":"The access to this resource has been denied","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"title":"UNAUTHORIZED","description":"The access to this resource has been denied"}}}},"404":{"description":"The resource was not found","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"type":"string"}},"title":"NOT_FOUND","description":"The resource was not found"}}}},"default":{"description":"Catch-all error response for any unexpected internal errors","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INTERNAL"]},"message":{"type":"string","enum":["An unexpected internal error has occurred"]}},"title":"INTERNAL","description":"Catch-all error response for any unexpected internal errors"}}}}}}},"/v1/virtual-accounts/us-deposit":{"post":{"summary":"Create a US deposit virtual account","tags":["Virtual Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ledgerAccountId"],"properties":{"ledgerAccountId":{"type":"string"},"name":{"type":"string"},"referenceId":{"type":"string","description":"Customer-supplied identifier"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"header","name":"Idempotency-Key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","referenceId","status","accountNumber","routingNumber","type","ledgerAccountId","entityId","wireDepositInstructions","achDepositInstructions","rtpDepositInstructions","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"referenceId":{"type":"string","description":"Customer-supplied identifier","nullable":true},"status":{"type":"string","enum":["ACTIVE","PENDING"]},"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"type":{"type":"string","enum":["US_DEPOSIT","US_DDA"]},"ledgerAccountId":{"type":"string"},"entityId":{"type":"string"},"wireDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","beneficiaryName","currency","currencyCountryCode","beneficiaryAddress","bankName","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"beneficiaryAddress":{"type":"object","required":["line1","city","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}},"bankName":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"achDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"rtpDepositInstructions":{"type":"object","required":["accountNumber","routingNumber","bankName","beneficiaryName","currency","currencyCountryCode","bankAddress"],"properties":{"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"bankName":{"type":"string"},"beneficiaryName":{"type":"string"},"currency":{"type":"string"},"currencyCountryCode":{"type":"string"},"bankAddress":{"type":"object","required":["line1","city","regionCode","postalCode","countryCode"],"properties":{"line1":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":"string"}}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true}}},"title":"INVALID_REQUEST","description":"The service cannot understand the request"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["MISSING_IDEMPOTENCY_KEY"]},"message":{"type":"string"}},"title":"MISSING_IDEMPOTENCY_KEY","description":"Missing required idempotency key header"},{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INVALID_REQUEST"]},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true}}},"title":"INVALID_REQUEST","description":"The service cannot understand the request"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INVALID_ENTITY"]},"message":{"type":"string"}},"title":"INVALID_ENTITY","description":"The entity does not exist or is not verified"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["ENTITY_NOT_FOUND"]},"message":{"type":"string"}},"title":"ENTITY_NOT_FOUND","description":"The entity associated with the ledger account is not found"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["DUPLICATE"]},"message":{"type":"string"}},"title":"DUPLICATE","description":"A virtual account already exists for this entity and ledger account"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["LEDGER_ACCOUNT_NOT_FOUND"]},"message":{"type":"string"}},"title":"LEDGER_ACCOUNT_NOT_FOUND","description":"The ledger account does not exist"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["NO_ELIGIBLE_ROUTE"]},"message":{"type":"string"}},"title":"NO_ELIGIBLE_ROUTE","description":"Virtual account creation is not available for this entity"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["PRODUCT_INACTIVE"]},"message":{"type":"string"}},"title":"PRODUCT_INACTIVE","description":"Virtual account creation is not enabled"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["PRODUCT_BLOCKED"]},"message":{"type":"string"}},"title":"PRODUCT_BLOCKED","description":"The entity is blocked from creating virtual accounts"}]}]}}}},"401":{"description":"The access to this resource has been denied","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"title":"UNAUTHORIZED","description":"The access to this resource has been denied"}}}},"409":{"description":"A duplicate request with this idempotency key is already in progress","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["IDEMPOTENCY_IN_PROGRESS"]},"message":{"type":"string"}},"title":"IDEMPOTENCY_IN_PROGRESS","description":"A duplicate request with this idempotency key is already in progress"}}}},"422":{"description":"Another request with this idempotency key was made using a different body","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["IDEMPOTENCY_KEY_REUSED"]},"message":{"type":"string"}},"title":"IDEMPOTENCY_KEY_REUSED","description":"Another request with this idempotency key was made using a different body"}}}},"default":{"description":"Catch-all error response for any unexpected internal errors","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["INTERNAL"]},"message":{"type":"string","enum":["An unexpected internal error has occurred"]}},"title":"INTERNAL","description":"Catch-all error response for any unexpected internal errors"}}}}}}}},"servers":[{"url":"https://api.dev.cfx.to","description":"Customer Sandbox"},{"url":"https://api.cfx.to","description":"Production"}],"security":[{"ApiKeyAuth":[],"ApiSecretAuth":[]}],"tags":[{"name":"Virtual Account"}],"externalDocs":{"description":"Find out more about CFX","url":"https://cfx.to/"}}