From 8e80521488f5fcf79590a84fd106f87c32f4c472 Mon Sep 17 00:00:00 2001 From: circle-github-action-bot Date: Tue, 3 Sep 2024 20:26:38 +0000 Subject: [PATCH] Update OpenAPI docs to v2.11.0 --- CHANGELOG.md | 51 +++ VERSION | 2 +- openapi/json/account.json | 556 ++++++++++++++++++++++- openapi/json/accounts.json | 2 +- openapi/json/circle-apis.json | 823 ++++++++++++++++++++++++++++++++-- openapi/json/general.json | 2 +- openapi/json/payments.json | 232 +++++++++- openapi/json/payouts.json | 2 +- openapi/yaml/account.yaml | 387 +++++++++++++++- openapi/yaml/accounts.yaml | 2 +- openapi/yaml/circle-apis.yaml | 534 +++++++++++++++++++++- openapi/yaml/general.yaml | 2 +- openapi/yaml/payments.yaml | 163 ++++++- openapi/yaml/payouts.yaml | 2 +- 14 files changed, 2683 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28c024e..3d1fce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,56 @@ # Changelog +## [2.11.1](https://github.com/circlefin/openapi-internal/compare/v2.11.0...v2.11.1) (2024-09-03) + + +### Bug Fixes + +* use dind spot runner for sync public repo + +## [2.11.0](https://github.com/circlefin/openapi-internal/compare/v2.10.0...v2.11.0) (2024-09-03) + + +### Features + +* [BANK-1913] Add transferTypesInfo to GET wire account and GET cbit account endpoints +* Add PIX endpoints and update for FX + + +### Bug Fixes + +* Add missing build permissions + + +### Miscellaneous Chores + +* **deps:** update actions/checkout action to v4 +* **deps:** update actions/setup-node action to v4 +* **deps:** update circlefin/circle-runner-setup-action action to v5.1.10 +* **deps:** update crazy-max/ghaction-import-gpg action to v6 +* **deps:** update peter-evans/create-pull-request action to v6 +* revert permissions additions in release workflow +* use default changelog types + + +### Continuous Integration + +* bump runner action setup version +* fix AWS secrets names +* fix runner image +* refactor to circle runner job setup +* specify node version +* switch to shared workflows +* update AWS secrets path to /ops/ pref +* use default iam role in runner setup + +## [2.10.0](https://github.com/circlefin/openapi-internal/compare/v2.9.0...v2.10.0) (2024-04-25) + + +### New Features + +* [BANK-2073] Add v1/exchange/quotes to payments docs +* use circlefin/github-actions-cache@v1 + ## [2.9.0](https://github.com/circlefin/openapi-internal/compare/v2.8.0...v2.9.0) (2024-03-28) diff --git a/VERSION b/VERSION index c8e38b6..46b81d8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.9.0 +2.11.0 diff --git a/openapi/json/account.json b/openapi/json/account.json index 528e4c2..e248755 100644 --- a/openapi/json/account.json +++ b/openapi/json/account.json @@ -6,7 +6,7 @@ } ], "info": { - "version": "2.9.0", + "version": "2.11.0", "title": "Core Functionality", "description": "All of Circle's APIs share a common set of core functionality that lets you manage your Circle Account in a programmatic way.\n\nWith a Circle Account your business can deposit traditional money from 80+ countries and seamlessly convert them into \"digital currency dollars\": USDC. You can then use USDC for everyday payments and treasury flows.\n" }, @@ -27,6 +27,10 @@ "name": "CBIT", "description": "Create and get information on CBIT accounts." }, + { + "name": "PIX", + "description": "Create and get information on PIX accounts." + }, { "name": "Transfers", "description": "Create and get information on 1st party transfers." @@ -109,6 +113,7 @@ } ], "summary": "Create a payout", + "description": "\nCreate a payout. \n\nThe following table includes the supported pairs of amount.currency and toAmount.currency for FX payouts:\n\n| amount.currency | toAmount.currency |\n| ---------------- | ------------ |\n | USD | BRL |\n", "operationId": "createBusinessPayout", "tags": [ "Payouts" @@ -155,6 +160,10 @@ "amount": "3.14", "currency": "USD" }, + "toAmount": { + "amount": "3.14", + "currency": "USD" + }, "fees": { "amount": "3.14", "currency": "USD" @@ -303,6 +312,10 @@ "amount": "3.14", "currency": "USD" }, + "toAmount": { + "amount": "3.14", + "currency": "USD" + }, "fees": { "amount": "3.14", "currency": "USD" @@ -406,6 +419,10 @@ "amount": "3.14", "currency": "USD" }, + "toAmount": { + "amount": "3.14", + "currency": "USD" + }, "fees": { "amount": "3.14", "currency": "USD" @@ -508,6 +525,14 @@ "status": "pending", "description": "WELLS FARGO BANK, NA ****0010", "trackingRef": "CIR13FB13A", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", "billingDetails": { "name": "Satoshi Nakamoto", @@ -584,6 +609,14 @@ "status": "pending", "description": "WELLS FARGO BANK, NA ****0010", "trackingRef": "CIR13FB13A", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", "billingDetails": { "name": "Satoshi Nakamoto", @@ -661,6 +694,14 @@ "status": "pending", "description": "WELLS FARGO BANK, NA ****0010", "trackingRef": "CIR13FB13A", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", "billingDetails": { "name": "Satoshi Nakamoto", @@ -889,6 +930,14 @@ "status": "pending", "trackingRef": "CIR25XSXT8", "walletAddress": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "createDate": "2020-04-10T02:13:30.000Z", "updateDate": "2020-04-10T02:13:30.000Z" } @@ -947,6 +996,14 @@ "status": "pending", "trackingRef": "CIR25XSXT8", "walletAddress": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "createDate": "2020-04-10T02:13:30.000Z", "updateDate": "2020-04-10T02:13:30.000Z" } @@ -1006,6 +1063,14 @@ "status": "pending", "trackingRef": "CIR25XSXT8", "walletAddress": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "createDate": "2020-04-10T02:13:30.000Z", "updateDate": "2020-04-10T02:13:30.000Z" } @@ -1779,6 +1844,266 @@ } } } + }, + "/v1/businessAccount/banks/pix": { + "post": { + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Create a PIX bank account", + "operationId": "createBusinessPixAccount", + "tags": [ + "PIX" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PixFiatAccountCreationRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successfully created a bank account for PIX transfers.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "CreateBusinessPixAccountResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/PixFiatAccountResponse" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "status": "pending", + "description": "BTG Pactual ****0010", + "trackingRef": "CIR13FB13A", + "riskEvaluation": { + "decision": "approved", + "reason": "3000" + }, + "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", + "createDate": "2020-04-10T02:13:30.000Z", + "updateDate": "2020-04-10T02:13:30.000Z" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + } + } + }, + "get": { + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "List all PIX bank accounts.", + "operationId": "listBusinessPixAccounts", + "tags": [ + "PIX" + ], + "responses": { + "200": { + "description": "Successfully retrieved all bank accounts for PIX transfers.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "ListBusinessPixAccountsResponse", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PixFiatAccountResponse" + } + } + } + }, + "examples": { + "response": { + "value": { + "data": [ + { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "status": "pending", + "description": "BTG Pactual ****0010", + "trackingRef": "CIR13FB13A", + "riskEvaluation": { + "decision": "approved", + "reason": "3000" + }, + "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", + "createDate": "2020-04-10T02:13:30.000Z", + "updateDate": "2020-04-10T02:13:30.000Z" + } + ] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + } + } + } + }, + "/v1/businessAccount/banks/pix/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/IdPath" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Get a PIX bank account", + "operationId": "getBusinessPixAccount", + "tags": [ + "PIX" + ], + "responses": { + "200": { + "description": "Successfully retrieved a bank account for PIX transfers.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "GetBusinessPixAccountResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/PixFiatAccountResponse" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "status": "pending", + "description": "BTG Pactual ****0010", + "trackingRef": "CIR13FB13A", + "riskEvaluation": { + "decision": "approved", + "reason": "3000" + }, + "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", + "createDate": "2020-04-10T02:13:30.000Z", + "updateDate": "2020-04-10T02:13:30.000Z" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/v1/businessAccount/banks/pix/{id}/instructions": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/IdPath" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Get PIX instructions", + "description": "Get the PIX transfer instructions into the Circle bank account given your bank account id.", + "operationId": "getBusinessPixAccountInstructions", + "tags": [ + "PIX" + ], + "responses": { + "200": { + "description": "Successfully retrieved PIX transfer instructions for the bank account.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "BusinessPixAccountInstructionsResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/PixInstruction" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "trackingRef": "CIR25XSXT8", + "ispb": "68033222", + "branchCode": "123", + "accountNumber": "322286803", + "accountType": "checking", + "taxId": "57112345675712", + "name": "CIRCLE INTERNET FINANCIAL INC" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } } }, "components": { @@ -1891,6 +2216,18 @@ } } }, + "FiatCurrency": { + "type": "string", + "description": "Currency code.", + "title": "Currency", + "enum": [ + "USD", + "EUR", + "MXN", + "SGD", + "BRL" + ] + }, "FiatMoney": { "type": "object", "required": [ @@ -1904,12 +2241,24 @@ "example": "3.14" }, "currency": { - "description": "Currency code.", + "$ref": "#/components/schemas/FiatCurrency" + } + } + }, + "FiatPayoutToMoney": { + "type": "object", + "required": [ + "currency" + ], + "properties": { + "amount": { + "description": "Magnitude of the amount, in units of the currency, with a `.`.", "type": "string", - "enum": [ - "USD", - "EUR" - ] + "example": "3.14", + "readOnly": true + }, + "currency": { + "$ref": "#/components/schemas/FiatCurrency" } } }, @@ -2053,6 +2402,9 @@ "amount": { "$ref": "#/components/schemas/FiatMoney" }, + "toAmount": { + "$ref": "#/components/schemas/FiatPayoutToMoney" + }, "fees": { "$ref": "#/components/schemas/FiatMoneyUsd" }, @@ -2102,7 +2454,10 @@ "type": "string", "enum": [ "wire", - "cbit" + "cbit", + "pix", + "sepa", + "sepa_instant" ] }, "id": { @@ -2126,6 +2481,10 @@ }, "amount": { "$ref": "#/components/schemas/FiatMoney" + }, + "toAmount": { + "description": "To be used when requesting currency exchange", + "$ref": "#/components/schemas/FiatPayoutToMoney" } } }, @@ -2138,6 +2497,33 @@ "failed" ] }, + "TransferTypeInfo": { + "type": "object", + "required": [ + "currencies" + ], + "description": "Additional information for specific transfer type.", + "properties": { + "currencies": { + "type": "array", + "uniqueItems": true, + "items": { + "$ref": "#/components/schemas/FiatCurrency" + } + }, + "additionalProperties": { + "description": "Additional properties that apply to specific transfer type.", + "type": "object", + "properties": { + "transactionLimits": { + "type": "integer", + "description": "Transaction amount limit for the transfer type.", + "example": 100000 + } + } + } + } + }, "Fingerprint": { "type": "string", "description": "A UUID that uniquely identifies the account number. If the same account is used more than once, each card object will have a different id, but the fingerprint will stay the same.", @@ -2252,7 +2638,8 @@ "fingerprint", "billingDetails", "createDate", - "updateDate" + "updateDate", + "transferTypesInfo" ], "properties": { "id": { @@ -2271,6 +2658,13 @@ "description": "Wire tracking ref that needs to be set in the wire reference to beneficiary field.", "example": "CIR13FB13A" }, + "transferTypesInfo": { + "type": "object", + "description": "A map which shows transfer types supported on this account as well as additional information for each.", + "additionalProperties": { + "$ref": "#/components/schemas/TransferTypeInfo" + } + }, "fingerprint": { "$ref": "#/components/schemas/Fingerprint" }, @@ -2646,7 +3040,8 @@ "trackingRef", "walletAddress", "createDate", - "updateDate" + "updateDate", + "transferTypesInfo" ], "properties": { "id": { @@ -2665,6 +3060,13 @@ "description": "Your CBIT wallet address.", "example": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e" }, + "transferTypesInfo": { + "type": "object", + "description": "A map which shows transfer types supported on this account as well as additional information for each. For CBIT accounts this will always only show information for CBIT transfers.", + "additionalProperties": { + "$ref": "#/components/schemas/TransferTypeInfo" + } + }, "createDate": { "$ref": "#/components/schemas/UtcTimestamp" }, @@ -3262,6 +3664,142 @@ "$ref": "#/components/schemas/UtcTimestamp" } } + }, + "PixFiatAccountResponse": { + "type": "object", + "required": [ + "id", + "status", + "description", + "trackingRef", + "fingerprint", + "createDate", + "updateDate" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/Id" + }, + "status": { + "$ref": "#/components/schemas/ExternalFiatAccountStatus" + }, + "description": { + "type": "string", + "description": "Bank name plus last four digits of the PIX account number.", + "example": "BTG Pactual ****0010" + }, + "trackingRef": { + "type": "string", + "description": "Wire tracking ref that needs to be set in the wire reference to beneficiary field.", + "example": "CIR13FB13A" + }, + "riskEvaluation": { + "$ref": "#/components/schemas/RiskEvaluation" + }, + "fingerprint": { + "$ref": "#/components/schemas/Fingerprint" + }, + "createDate": { + "$ref": "#/components/schemas/UtcTimestamp" + }, + "updateDate": { + "$ref": "#/components/schemas/UtcTimestamp" + } + } + }, + "PixAccountType": { + "type": "string", + "title": "Account type", + "description": "Beneficiary account type.", + "enum": [ + "checking", + "savings", + "salary", + "prepaid" + ], + "example": "checking" + }, + "PixFiatAccountCreationRequest": { + "type": "object", + "required": [ + "idempotencyKey", + "name", + "accountNumber", + "ispb", + "taxId", + "accountType" + ], + "properties": { + "idempotencyKey": { + "$ref": "#/components/schemas/IdempotencyKey" + }, + "name": { + "type": "string", + "description": "Name of the beneficiary.", + "example": "CIRCLE INTERNET FINANCIAL INC" + }, + "accountNumber": { + "type": "string", + "description": "Beneficiary account number.", + "example": "322286803" + }, + "ispb": { + "type": "string", + "description": "Beneficiary ISPB.", + "example": "68033222" + }, + "branchCode": { + "type": "string", + "description": "Beneficiary account branch code.", + "example": "123" + }, + "taxId": { + "type": "string", + "description": "Beneficiary Tax ID.", + "example": "57112345675712" + }, + "accountType": { + "$ref": "#/components/schemas/PixAccountType" + } + } + }, + "PixInstruction": { + "type": "object", + "properties": { + "trackingRef": { + "type": "string", + "description": "Circle tracking reference that needs to be set in the PIX reference field.", + "example": "CIR25XSXT8" + }, + "ispb": { + "type": "string", + "description": "ISPB of beneficiary's bank.", + "example": "68033222" + }, + "branchCode": { + "type": "string", + "description": "Beneficiary account branch code.", + "example": "123" + }, + "accountNumber": { + "type": "string", + "description": "Beneficiary account number.", + "example": "322286803" + }, + "accountType": { + "$ref": "#/components/schemas/PixAccountType" + }, + "taxId": { + "type": "string", + "description": "Beneficiary Tax ID.", + "example": "57112345675712" + }, + "name": { + "type": "string", + "description": "Name of the beneficiary.", + "example": "CIRCLE INTERNET FINANCIAL INC" + } + } } }, "responses": { diff --git a/openapi/json/accounts.json b/openapi/json/accounts.json index 52838ac..89c6f9f 100644 --- a/openapi/json/accounts.json +++ b/openapi/json/accounts.json @@ -6,7 +6,7 @@ } ], "info": { - "version": "2.9.0", + "version": "2.11.0", "title": "Accounts API", "description": "The Accounts API allows you to easily create and host digital wallets for your customers, and manage transfers of funds across accounts- whether they are within the Circle platform, or in / out of the platform via on-chain USDC, EUROC, BTC, and ETH connectivity." }, diff --git a/openapi/json/circle-apis.json b/openapi/json/circle-apis.json index 31c0b6b..8429df1 100644 --- a/openapi/json/circle-apis.json +++ b/openapi/json/circle-apis.json @@ -6,7 +6,7 @@ } ], "info": { - "version": "2.9.0", + "version": "2.11.0", "title": "All Circle APIs", "description": "Circle's General, Core Functionality, Payments, Payouts, Accounts, and Crypto Payments APIs bundled into one OpenAPI Specification." }, @@ -83,6 +83,10 @@ "name": "CBIT", "description": "Create and get information on CBIT accounts." }, + { + "name": "PIX", + "description": "Create and get information on PIX accounts." + }, { "name": "Stablecoins", "description": "Retrieve stablecoins and their respective names, symbols, circulating total and per-chain amounts." @@ -1111,6 +1115,14 @@ "status": "pending", "description": "WELLS FARGO BANK, NA ****0010", "trackingRef": "CIR13FB13A", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", "billingDetails": { "name": "Satoshi Nakamoto", @@ -1187,6 +1199,14 @@ "status": "pending", "description": "WELLS FARGO BANK, NA ****0010", "trackingRef": "CIR13FB13A", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", "billingDetails": { "name": "Satoshi Nakamoto", @@ -1264,6 +1284,14 @@ "status": "pending", "description": "WELLS FARGO BANK, NA ****0010", "trackingRef": "CIR13FB13A", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", "billingDetails": { "name": "Satoshi Nakamoto", @@ -1423,6 +1451,14 @@ "status": "pending", "trackingRef": "CIR25XSXT8", "walletAddress": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "createDate": "2020-04-10T02:13:30.000Z", "updateDate": "2020-04-10T02:13:30.000Z" } @@ -1481,6 +1517,14 @@ "status": "pending", "trackingRef": "CIR25XSXT8", "walletAddress": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "createDate": "2020-04-10T02:13:30.000Z", "updateDate": "2020-04-10T02:13:30.000Z" } @@ -1540,6 +1584,14 @@ "status": "pending", "trackingRef": "CIR25XSXT8", "walletAddress": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e", + "transferTypesInfo": { + "currencies": [ + "USD" + ], + "additionalProperties": { + "transactionLimits": 100000 + } + }, "createDate": "2020-04-10T02:13:30.000Z", "updateDate": "2020-04-10T02:13:30.000Z" } @@ -1616,6 +1668,266 @@ } } }, + "/v1/businessAccount/banks/pix": { + "post": { + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Create a PIX bank account", + "operationId": "createBusinessPixAccount", + "tags": [ + "PIX" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PixFiatAccountCreationRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Successfully created a bank account for PIX transfers.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "CreateBusinessPixAccountResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/PixFiatAccountResponse" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "status": "pending", + "description": "BTG Pactual ****0010", + "trackingRef": "CIR13FB13A", + "riskEvaluation": { + "decision": "approved", + "reason": "3000" + }, + "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", + "createDate": "2020-04-10T02:13:30.000Z", + "updateDate": "2020-04-10T02:13:30.000Z" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + } + } + }, + "get": { + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "List all PIX bank accounts.", + "operationId": "listBusinessPixAccounts", + "tags": [ + "PIX" + ], + "responses": { + "200": { + "description": "Successfully retrieved all bank accounts for PIX transfers.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "ListBusinessPixAccountsResponse", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PixFiatAccountResponse" + } + } + } + }, + "examples": { + "response": { + "value": { + "data": [ + { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "status": "pending", + "description": "BTG Pactual ****0010", + "trackingRef": "CIR13FB13A", + "riskEvaluation": { + "decision": "approved", + "reason": "3000" + }, + "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", + "createDate": "2020-04-10T02:13:30.000Z", + "updateDate": "2020-04-10T02:13:30.000Z" + } + ] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + } + } + } + }, + "/v1/businessAccount/banks/pix/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/IdPath" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Get a PIX bank account", + "operationId": "getBusinessPixAccount", + "tags": [ + "PIX" + ], + "responses": { + "200": { + "description": "Successfully retrieved a bank account for PIX transfers.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "GetBusinessPixAccountResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/PixFiatAccountResponse" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "status": "pending", + "description": "BTG Pactual ****0010", + "trackingRef": "CIR13FB13A", + "riskEvaluation": { + "decision": "approved", + "reason": "3000" + }, + "fingerprint": "eb170539-9e1c-4e92-bf4f-1d09534fdca2", + "createDate": "2020-04-10T02:13:30.000Z", + "updateDate": "2020-04-10T02:13:30.000Z" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/v1/businessAccount/banks/pix/{id}/instructions": { + "get": { + "parameters": [ + { + "$ref": "#/components/parameters/IdPath" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Get PIX instructions", + "description": "Get the PIX transfer instructions into the Circle bank account given your bank account id.", + "operationId": "getBusinessPixAccountInstructions", + "tags": [ + "PIX" + ], + "responses": { + "200": { + "description": "Successfully retrieved PIX transfer instructions for the bank account.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "BusinessPixAccountInstructionsResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/PixInstruction" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "trackingRef": "CIR25XSXT8", + "ispb": "68033222", + "branchCode": "123", + "accountNumber": "322286803", + "accountType": "checking", + "taxId": "57112345675712", + "name": "CIRCLE INTERNET FINANCIAL INC" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, "/v1/businessAccount/wallets/addresses/deposit": { "post": { "security": [ @@ -4477,6 +4789,7 @@ } ], "summary": "Create a payout", + "description": "\nCreate a payout. \n\nThe following table includes the supported pairs of amount.currency and toAmount.currency for FX payouts:\n\n| amount.currency | toAmount.currency |\n| ---------------- | ------------ |\n | USD | BRL |\n", "operationId": "createBusinessPayout", "tags": [ "Payouts" @@ -4523,6 +4836,10 @@ "amount": "3.14", "currency": "USD" }, + "toAmount": { + "amount": "3.14", + "currency": "USD" + }, "fees": { "amount": "3.14", "currency": "USD" @@ -4671,6 +4988,10 @@ "amount": "3.14", "currency": "USD" }, + "toAmount": { + "amount": "3.14", + "currency": "USD" + }, "fees": { "amount": "3.14", "currency": "USD" @@ -4774,6 +5095,10 @@ "amount": "3.14", "currency": "USD" }, + "toAmount": { + "amount": "3.14", + "currency": "USD" + }, "fees": { "amount": "3.14", "currency": "USD" @@ -5538,8 +5863,124 @@ "Chargebacks" ], "responses": { - "200": { - "description": "Successfully retrieved a chargeback.", + "200": { + "description": "Successfully retrieved a chargeback.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "GetChargebackResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/BasicChargeback" + } + } + }, + "examples": { + "response": { + "value": { + "data": { + "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", + "paymentId": "fc988ed5-c129-4f70-a064-e5beb7eb8e32", + "merchantId": "fc988ed5-c129-4f70-a064-e5beb7eb8e32", + "reasonCode": "10.4", + "status": "active", + "category": "Canceled Recurring Payment", + "history": [ + { + "type": "1st Chargeback", + "chargebackAmount": { + "amount": "3.14", + "currency": "USD" + }, + "fee": { + "amount": "3.14", + "currency": "USD" + }, + "description": "The cardholder claims an unauthorized transaction occurred.", + "settlementId": "fc988ed5-c129-4f70-a064-e5beb7eb8e32", + "createDate": "2020-04-10T02:13:30.000Z" + } + ] + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/v1/exchange/quotes": { + "post": { + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Fetch exchange rate", + "operationId": "exchangeRate", + "description": "Fetches an indicative exchange rate between two currencies. Either the from currency or to currency must be USD.\n\nNote: The current market exchange rate will be applied when Circle receives the deposit.\n", + "tags": [ + "Payments" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeRateRequest" + }, + "examples": { + "Null amounts": { + "value": { + "from": { + "currency": "MXN" + }, + "to": { + "currency": "USD" + } + } + }, + "Non-null from amount": { + "value": { + "from": { + "amount": 5.05, + "currency": "MXN" + }, + "to": { + "currency": "USD" + } + } + }, + "Non-null to amount": { + "value": { + "from": { + "currency": "MXN" + }, + "to": { + "amount": 5.05, + "currency": "USD" + } + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Successfully fetched exchange rate.", "headers": { "X-Request-Id": { "$ref": "#/components/headers/XRequestId" @@ -5548,39 +5989,60 @@ "content": { "application/json": { "schema": { - "title": "GetChargebackResponse", + "title": "FetchExchangeRateResponse", "properties": { "data": { - "$ref": "#/components/schemas/BasicChargeback" + "$ref": "#/components/schemas/ExchangeRateResponse" } } }, "examples": { - "response": { + "Null amounts": { "value": { "data": { - "id": "b8627ae8-732b-4d25-b947-1df8f4007a29", - "paymentId": "fc988ed5-c129-4f70-a064-e5beb7eb8e32", - "merchantId": "fc988ed5-c129-4f70-a064-e5beb7eb8e32", - "reasonCode": "10.4", - "status": "active", - "category": "Canceled Recurring Payment", - "history": [ - { - "type": "1st Chargeback", - "chargebackAmount": { - "amount": "3.14", - "currency": "USD" - }, - "fee": { - "amount": "3.14", - "currency": "USD" - }, - "description": "The cardholder claims an unauthorized transaction occurred.", - "settlementId": "fc988ed5-c129-4f70-a064-e5beb7eb8e32", - "createDate": "2020-04-10T02:13:30.000Z" - } - ] + "id": "8755d0ea-14f9-4259-b092-de23c14b6568", + "rate": 17.0531, + "from": { + "currency": "MXN" + }, + "to": { + "currency": "USD" + }, + "timestamp": "2022-07-21T20:13:35.578678Z" + } + } + }, + "Non-null from amount": { + "value": { + "data": { + "id": "8755d0ea-14f9-4259-b092-de23c14b6568", + "rate": 17.0531, + "from": { + "amount": 5.05, + "currency": "MXN" + }, + "to": { + "amount": 0.29, + "currency": "USD" + }, + "timestamp": "2022-07-21T20:13:35.578678Z" + } + } + }, + "Non-null to amount": { + "value": { + "data": { + "id": "8755d0ea-14f9-4259-b092-de23c14b6568", + "rate": 17.0531, + "from": { + "amount": 96.12, + "currency": "MXN" + }, + "to": { + "amount": 5.05, + "currency": "USD" + }, + "timestamp": "2022-07-21T20:13:35.578678Z" } } } @@ -5588,6 +6050,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/NotAuthorized" }, @@ -8215,6 +8680,45 @@ } } }, + "FiatCurrency": { + "type": "string", + "description": "Currency code.", + "title": "Currency", + "enum": [ + "USD", + "EUR", + "MXN", + "SGD", + "BRL" + ] + }, + "TransferTypeInfo": { + "type": "object", + "required": [ + "currencies" + ], + "description": "Additional information for specific transfer type.", + "properties": { + "currencies": { + "type": "array", + "uniqueItems": true, + "items": { + "$ref": "#/components/schemas/FiatCurrency" + } + }, + "additionalProperties": { + "description": "Additional properties that apply to specific transfer type.", + "type": "object", + "properties": { + "transactionLimits": { + "type": "integer", + "description": "Transaction amount limit for the transfer type.", + "example": 100000 + } + } + } + } + }, "BankAddress": { "type": "object", "description": "The address details for the bank, as provided during bank account creation.", @@ -8270,7 +8774,8 @@ "fingerprint", "billingDetails", "createDate", - "updateDate" + "updateDate", + "transferTypesInfo" ], "properties": { "id": { @@ -8289,6 +8794,13 @@ "description": "Wire tracking ref that needs to be set in the wire reference to beneficiary field.", "example": "CIR13FB13A" }, + "transferTypesInfo": { + "type": "object", + "description": "A map which shows transfer types supported on this account as well as additional information for each.", + "additionalProperties": { + "$ref": "#/components/schemas/TransferTypeInfo" + } + }, "fingerprint": { "$ref": "#/components/schemas/Fingerprint" }, @@ -8605,7 +9117,8 @@ "trackingRef", "walletAddress", "createDate", - "updateDate" + "updateDate", + "transferTypesInfo" ], "properties": { "id": { @@ -8624,6 +9137,13 @@ "description": "Your CBIT wallet address.", "example": "0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e" }, + "transferTypesInfo": { + "type": "object", + "description": "A map which shows transfer types supported on this account as well as additional information for each. For CBIT accounts this will always only show information for CBIT transfers.", + "additionalProperties": { + "$ref": "#/components/schemas/TransferTypeInfo" + } + }, "createDate": { "$ref": "#/components/schemas/UtcTimestamp" }, @@ -8664,6 +9184,142 @@ } } }, + "PixFiatAccountResponse": { + "type": "object", + "required": [ + "id", + "status", + "description", + "trackingRef", + "fingerprint", + "createDate", + "updateDate" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/Id" + }, + "status": { + "$ref": "#/components/schemas/ExternalFiatAccountStatus" + }, + "description": { + "type": "string", + "description": "Bank name plus last four digits of the PIX account number.", + "example": "BTG Pactual ****0010" + }, + "trackingRef": { + "type": "string", + "description": "Wire tracking ref that needs to be set in the wire reference to beneficiary field.", + "example": "CIR13FB13A" + }, + "riskEvaluation": { + "$ref": "#/components/schemas/RiskEvaluation" + }, + "fingerprint": { + "$ref": "#/components/schemas/Fingerprint" + }, + "createDate": { + "$ref": "#/components/schemas/UtcTimestamp" + }, + "updateDate": { + "$ref": "#/components/schemas/UtcTimestamp" + } + } + }, + "PixAccountType": { + "type": "string", + "title": "Account type", + "description": "Beneficiary account type.", + "enum": [ + "checking", + "savings", + "salary", + "prepaid" + ], + "example": "checking" + }, + "PixFiatAccountCreationRequest": { + "type": "object", + "required": [ + "idempotencyKey", + "name", + "accountNumber", + "ispb", + "taxId", + "accountType" + ], + "properties": { + "idempotencyKey": { + "$ref": "#/components/schemas/IdempotencyKey" + }, + "name": { + "type": "string", + "description": "Name of the beneficiary.", + "example": "CIRCLE INTERNET FINANCIAL INC" + }, + "accountNumber": { + "type": "string", + "description": "Beneficiary account number.", + "example": "322286803" + }, + "ispb": { + "type": "string", + "description": "Beneficiary ISPB.", + "example": "68033222" + }, + "branchCode": { + "type": "string", + "description": "Beneficiary account branch code.", + "example": "123" + }, + "taxId": { + "type": "string", + "description": "Beneficiary Tax ID.", + "example": "57112345675712" + }, + "accountType": { + "$ref": "#/components/schemas/PixAccountType" + } + } + }, + "PixInstruction": { + "type": "object", + "properties": { + "trackingRef": { + "type": "string", + "description": "Circle tracking reference that needs to be set in the PIX reference field.", + "example": "CIR25XSXT8" + }, + "ispb": { + "type": "string", + "description": "ISPB of beneficiary's bank.", + "example": "68033222" + }, + "branchCode": { + "type": "string", + "description": "Beneficiary account branch code.", + "example": "123" + }, + "accountNumber": { + "type": "string", + "description": "Beneficiary account number.", + "example": "322286803" + }, + "accountType": { + "$ref": "#/components/schemas/PixAccountType" + }, + "taxId": { + "type": "string", + "description": "Beneficiary Tax ID.", + "example": "57112345675712" + }, + "name": { + "type": "string", + "description": "Name of the beneficiary.", + "example": "CIRCLE INTERNET FINANCIAL INC" + } + } + }, "Address": { "type": "string", "description": "An alphanumeric string representing a blockchain address. Will be in different formats for different chains. It is important to preserve the exact formatting and capitalization of the address.", @@ -8821,12 +9477,7 @@ "example": "3.14" }, "currency": { - "description": "Currency code.", - "type": "string", - "enum": [ - "USD", - "EUR" - ] + "$ref": "#/components/schemas/FiatCurrency" } } }, @@ -10923,6 +11574,23 @@ } } }, + "FiatPayoutToMoney": { + "type": "object", + "required": [ + "currency" + ], + "properties": { + "amount": { + "description": "Magnitude of the amount, in units of the currency, with a `.`.", + "type": "string", + "example": "3.14", + "readOnly": true + }, + "currency": { + "$ref": "#/components/schemas/FiatCurrency" + } + } + }, "PayoutErrorCode": { "type": "string", "nullable": true, @@ -11015,6 +11683,9 @@ "amount": { "$ref": "#/components/schemas/FiatMoney" }, + "toAmount": { + "$ref": "#/components/schemas/FiatPayoutToMoney" + }, "fees": { "$ref": "#/components/schemas/FiatMoneyUsd" }, @@ -11058,7 +11729,10 @@ "type": "string", "enum": [ "wire", - "cbit" + "cbit", + "pix", + "sepa", + "sepa_instant" ] }, "id": { @@ -11082,6 +11756,10 @@ }, "amount": { "$ref": "#/components/schemas/FiatMoney" + }, + "toAmount": { + "description": "To be used when requesting currency exchange", + "$ref": "#/components/schemas/FiatPayoutToMoney" } } }, @@ -11509,6 +12187,77 @@ } } }, + "FiatOptionalAmountMoney": { + "type": "object", + "title": "OptionalAmountMoney", + "required": [ + "currency" + ], + "properties": { + "amount": { + "description": "Magnitude of the amount, in units of the currency, with a `.`.", + "type": "string", + "example": "3.14" + }, + "currency": { + "$ref": "#/components/schemas/FiatCurrency" + } + } + }, + "ExchangeRateRequest": { + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "allOf": [ + { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + } + ], + "description": "Amount (Optional) and currency to convert from. If an amount is provided here, then the amount in the \"to\" field must be null." + }, + "to": { + "allOf": [ + { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + } + ], + "description": "Amount (Optional) and currency to convert to. If an amount is provided here, then the amount in the \"from\" field must be null." + } + } + }, + "ExchangeRateResponse": { + "type": "object", + "required": [ + "id", + "rate", + "from", + "to", + "timestamp" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/Id" + }, + "rate": { + "description": "Exchange rate", + "type": "number", + "format": "float" + }, + "from": { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + }, + "to": { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + }, + "timestamp": { + "$ref": "#/components/schemas/UtcTimestamp" + } + } + }, "Wallet": { "type": "object", "properties": { diff --git a/openapi/json/general.json b/openapi/json/general.json index 635c2a0..01c10ff 100644 --- a/openapi/json/general.json +++ b/openapi/json/general.json @@ -6,7 +6,7 @@ } ], "info": { - "version": "2.9.0", + "version": "2.11.0", "title": "API Overview", "description": "Common endpoints shared across all Circle APIs." }, diff --git a/openapi/json/payments.json b/openapi/json/payments.json index 559cc79..4bf2f4d 100644 --- a/openapi/json/payments.json +++ b/openapi/json/payments.json @@ -6,7 +6,7 @@ } ], "info": { - "version": "2.9.0", + "version": "2.11.0", "title": "Payments API", "description": "The Circle Payments API allows you to take payments from your end users via traditional methods such as debit & credit cards and receive settlement in USDC.\n\nThe Circle Payments API has been designed with any business or internet commerce in mind, not just crypto applications, and it's based on Circle's extensive experience processing millions of card payments since 2014.\n" }, @@ -2967,6 +2967,146 @@ } } }, + "/v1/exchange/quotes": { + "post": { + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Fetch exchange rate", + "operationId": "exchangeRate", + "description": "Fetches an indicative exchange rate between two currencies. Either the from currency or to currency must be USD.\n\nNote: The current market exchange rate will be applied when Circle receives the deposit.\n", + "tags": [ + "Payments" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeRateRequest" + }, + "examples": { + "Null amounts": { + "value": { + "from": { + "currency": "MXN" + }, + "to": { + "currency": "USD" + } + } + }, + "Non-null from amount": { + "value": { + "from": { + "amount": 5.05, + "currency": "MXN" + }, + "to": { + "currency": "USD" + } + } + }, + "Non-null to amount": { + "value": { + "from": { + "currency": "MXN" + }, + "to": { + "amount": 5.05, + "currency": "USD" + } + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Successfully fetched exchange rate.", + "headers": { + "X-Request-Id": { + "$ref": "#/components/headers/XRequestId" + } + }, + "content": { + "application/json": { + "schema": { + "title": "FetchExchangeRateResponse", + "properties": { + "data": { + "$ref": "#/components/schemas/ExchangeRateResponse" + } + } + }, + "examples": { + "Null amounts": { + "value": { + "data": { + "id": "8755d0ea-14f9-4259-b092-de23c14b6568", + "rate": 17.0531, + "from": { + "currency": "MXN" + }, + "to": { + "currency": "USD" + }, + "timestamp": "2022-07-21T20:13:35.578678Z" + } + } + }, + "Non-null from amount": { + "value": { + "data": { + "id": "8755d0ea-14f9-4259-b092-de23c14b6568", + "rate": 17.0531, + "from": { + "amount": 5.05, + "currency": "MXN" + }, + "to": { + "amount": 0.29, + "currency": "USD" + }, + "timestamp": "2022-07-21T20:13:35.578678Z" + } + } + }, + "Non-null to amount": { + "value": { + "data": { + "id": "8755d0ea-14f9-4259-b092-de23c14b6568", + "rate": 17.0531, + "from": { + "amount": 96.12, + "currency": "MXN" + }, + "to": { + "amount": 5.05, + "currency": "USD" + }, + "timestamp": "2022-07-21T20:13:35.578678Z" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/NotAuthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, "/v1/balances": { "get": { "security": [ @@ -3558,6 +3698,18 @@ } } }, + "FiatCurrency": { + "type": "string", + "description": "Currency code.", + "title": "Currency", + "enum": [ + "USD", + "EUR", + "MXN", + "SGD", + "BRL" + ] + }, "FiatMoney": { "type": "object", "required": [ @@ -3571,12 +3723,7 @@ "example": "3.14" }, "currency": { - "description": "Currency code.", - "type": "string", - "enum": [ - "USD", - "EUR" - ] + "$ref": "#/components/schemas/FiatCurrency" } } }, @@ -6470,6 +6617,77 @@ "type": "object", "properties": {} }, + "FiatOptionalAmountMoney": { + "type": "object", + "title": "OptionalAmountMoney", + "required": [ + "currency" + ], + "properties": { + "amount": { + "description": "Magnitude of the amount, in units of the currency, with a `.`.", + "type": "string", + "example": "3.14" + }, + "currency": { + "$ref": "#/components/schemas/FiatCurrency" + } + } + }, + "ExchangeRateRequest": { + "type": "object", + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "allOf": [ + { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + } + ], + "description": "Amount (Optional) and currency to convert from. If an amount is provided here, then the amount in the \"to\" field must be null." + }, + "to": { + "allOf": [ + { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + } + ], + "description": "Amount (Optional) and currency to convert to. If an amount is provided here, then the amount in the \"from\" field must be null." + } + } + }, + "ExchangeRateResponse": { + "type": "object", + "required": [ + "id", + "rate", + "from", + "to", + "timestamp" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/Id" + }, + "rate": { + "description": "Exchange rate", + "type": "number", + "format": "float" + }, + "from": { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + }, + "to": { + "$ref": "#/components/schemas/FiatOptionalAmountMoney" + }, + "timestamp": { + "$ref": "#/components/schemas/UtcTimestamp" + } + } + }, "Money": { "type": "object", "required": [ diff --git a/openapi/json/payouts.json b/openapi/json/payouts.json index 25b640c..69459d4 100644 --- a/openapi/json/payouts.json +++ b/openapi/json/payouts.json @@ -6,7 +6,7 @@ } ], "info": { - "version": "2.9.0", + "version": "2.11.0", "title": "Payouts API", "description": "The Circle Payouts API allows you to programmatically make fast, global payouts to your customers, vendors, and suppliers. Make payouts on supported blockchains." }, diff --git a/openapi/yaml/account.yaml b/openapi/yaml/account.yaml index 2f7c2b4..ef72bfd 100644 --- a/openapi/yaml/account.yaml +++ b/openapi/yaml/account.yaml @@ -2,7 +2,7 @@ openapi: 3.0.2 servers: - url: https://api-sandbox.circle.com info: - version: 2.9.0 + version: 2.11.0 title: Core Functionality description: 'All of Circle''s APIs share a common set of core functionality that lets you manage your Circle Account in a programmatic way. @@ -23,6 +23,8 @@ tags: for wire transfers. - name: CBIT description: Create and get information on CBIT accounts. +- name: PIX + description: Create and get information on PIX accounts. - name: Transfers description: Create and get information on 1st party transfers. - name: Addresses @@ -69,6 +71,10 @@ paths: security: - bearerAuth: [] summary: Create a payout + description: "\nCreate a payout. \n\nThe following table includes the supported\ + \ pairs of amount.currency and toAmount.currency for FX payouts:\n\n| amount.currency\ + \ | toAmount.currency |\n| ---------------- | ------------ |\n | USD | BRL\ + \ |\n" operationId: createBusinessPayout tags: - Payouts @@ -103,6 +109,9 @@ paths: amount: amount: '3.14' currency: USD + toAmount: + amount: '3.14' + currency: USD fees: amount: '3.14' currency: USD @@ -202,6 +211,9 @@ paths: amount: amount: '3.14' currency: USD + toAmount: + amount: '3.14' + currency: USD fees: amount: '3.14' currency: USD @@ -271,6 +283,9 @@ paths: amount: amount: '3.14' currency: USD + toAmount: + amount: '3.14' + currency: USD fees: amount: '3.14' currency: USD @@ -340,6 +355,11 @@ paths: status: pending description: WELLS FARGO BANK, NA ****0010 trackingRef: CIR13FB13A + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 billingDetails: name: Satoshi Nakamoto @@ -392,6 +412,11 @@ paths: status: pending description: WELLS FARGO BANK, NA ****0010 trackingRef: CIR13FB13A + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 billingDetails: name: Satoshi Nakamoto @@ -443,6 +468,11 @@ paths: status: pending description: WELLS FARGO BANK, NA ****0010 trackingRef: CIR13FB13A + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 billingDetails: name: Satoshi Nakamoto @@ -593,6 +623,11 @@ paths: status: pending trackingRef: CIR25XSXT8 walletAddress: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 createDate: '2020-04-10T02:13:30.000Z' updateDate: '2020-04-10T02:13:30.000Z' '400': @@ -629,6 +664,11 @@ paths: status: pending trackingRef: CIR25XSXT8 walletAddress: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 createDate: '2020-04-10T02:13:30.000Z' updateDate: '2020-04-10T02:13:30.000Z' '401': @@ -664,6 +704,11 @@ paths: status: pending trackingRef: CIR25XSXT8 walletAddress: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 createDate: '2020-04-10T02:13:30.000Z' updateDate: '2020-04-10T02:13:30.000Z' '401': @@ -1153,6 +1198,170 @@ paths: updateDate: '2020-04-10T02:13:30.000Z' '401': $ref: '#/components/responses/NotAuthorized' + /v1/businessAccount/banks/pix: + post: + security: + - bearerAuth: [] + summary: Create a PIX bank account + operationId: createBusinessPixAccount + tags: + - PIX + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PixFiatAccountCreationRequest' + responses: + '201': + description: Successfully created a bank account for PIX transfers. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: CreateBusinessPixAccountResponse + properties: + data: + $ref: '#/components/schemas/PixFiatAccountResponse' + examples: + response: + value: + data: + id: b8627ae8-732b-4d25-b947-1df8f4007a29 + status: pending + description: BTG Pactual ****0010 + trackingRef: CIR13FB13A + riskEvaluation: + decision: approved + reason: '3000' + fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 + createDate: '2020-04-10T02:13:30.000Z' + updateDate: '2020-04-10T02:13:30.000Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/NotAuthorized' + get: + security: + - bearerAuth: [] + summary: List all PIX bank accounts. + operationId: listBusinessPixAccounts + tags: + - PIX + responses: + '200': + description: Successfully retrieved all bank accounts for PIX transfers. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: ListBusinessPixAccountsResponse + properties: + data: + type: array + items: + $ref: '#/components/schemas/PixFiatAccountResponse' + examples: + response: + value: + data: + - id: b8627ae8-732b-4d25-b947-1df8f4007a29 + status: pending + description: BTG Pactual ****0010 + trackingRef: CIR13FB13A + riskEvaluation: + decision: approved + reason: '3000' + fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 + createDate: '2020-04-10T02:13:30.000Z' + updateDate: '2020-04-10T02:13:30.000Z' + '401': + $ref: '#/components/responses/NotAuthorized' + /v1/businessAccount/banks/pix/{id}: + get: + parameters: + - $ref: '#/components/parameters/IdPath' + security: + - bearerAuth: [] + summary: Get a PIX bank account + operationId: getBusinessPixAccount + tags: + - PIX + responses: + '200': + description: Successfully retrieved a bank account for PIX transfers. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: GetBusinessPixAccountResponse + properties: + data: + $ref: '#/components/schemas/PixFiatAccountResponse' + examples: + response: + value: + data: + id: b8627ae8-732b-4d25-b947-1df8f4007a29 + status: pending + description: BTG Pactual ****0010 + trackingRef: CIR13FB13A + riskEvaluation: + decision: approved + reason: '3000' + fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 + createDate: '2020-04-10T02:13:30.000Z' + updateDate: '2020-04-10T02:13:30.000Z' + '401': + $ref: '#/components/responses/NotAuthorized' + '404': + $ref: '#/components/responses/NotFound' + /v1/businessAccount/banks/pix/{id}/instructions: + get: + parameters: + - $ref: '#/components/parameters/IdPath' + security: + - bearerAuth: [] + summary: Get PIX instructions + description: Get the PIX transfer instructions into the Circle bank account + given your bank account id. + operationId: getBusinessPixAccountInstructions + tags: + - PIX + responses: + '200': + description: Successfully retrieved PIX transfer instructions for the bank + account. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: BusinessPixAccountInstructionsResponse + properties: + data: + $ref: '#/components/schemas/PixInstruction' + examples: + response: + value: + data: + trackingRef: CIR25XSXT8 + ispb: '68033222' + branchCode: '123' + accountNumber: '322286803' + accountType: checking + taxId: '57112345675712' + name: CIRCLE INTERNET FINANCIAL INC + '401': + $ref: '#/components/responses/NotAuthorized' + '404': + $ref: '#/components/responses/NotFound' components: securitySchemes: bearerAuth: @@ -1241,6 +1450,16 @@ components: description: Bank name plus last four digits of the bank account number or IBAN. example: COMMERZBANK AG ****3000 + FiatCurrency: + type: string + description: Currency code. + title: Currency + enum: + - USD + - EUR + - MXN + - SGD + - BRL FiatMoney: type: object required: @@ -1252,11 +1471,19 @@ components: type: string example: '3.14' currency: - description: Currency code. + $ref: '#/components/schemas/FiatCurrency' + FiatPayoutToMoney: + type: object + required: + - currency + properties: + amount: + description: Magnitude of the amount, in units of the currency, with a `.`. type: string - enum: - - USD - - EUR + example: '3.14' + readOnly: true + currency: + $ref: '#/components/schemas/FiatCurrency' FiatMoneyUsd: type: object required: @@ -1372,6 +1599,8 @@ components: $ref: '#/components/schemas/BankDestination' amount: $ref: '#/components/schemas/FiatMoney' + toAmount: + $ref: '#/components/schemas/FiatPayoutToMoney' fees: $ref: '#/components/schemas/FiatMoneyUsd' status: @@ -1410,6 +1639,9 @@ components: enum: - wire - cbit + - pix + - sepa + - sepa_instant id: $ref: '#/components/schemas/Id' BusinessPayoutCreationRequest: @@ -1425,6 +1657,9 @@ components: $ref: '#/components/schemas/BusinessDestinationRequest' amount: $ref: '#/components/schemas/FiatMoney' + toAmount: + description: To be used when requesting currency exchange + $ref: '#/components/schemas/FiatPayoutToMoney' ExternalFiatAccountStatus: description: Status of the account. A `pending` status indicates that the linking is in-progress; `complete` indicates the account was linked successfully; @@ -1434,6 +1669,25 @@ components: - pending - complete - failed + TransferTypeInfo: + type: object + required: + - currencies + description: Additional information for specific transfer type. + properties: + currencies: + type: array + uniqueItems: true + items: + $ref: '#/components/schemas/FiatCurrency' + additionalProperties: + description: Additional properties that apply to specific transfer type. + type: object + properties: + transactionLimits: + type: integer + description: Transaction amount limit for the transfer type. + example: 100000 Fingerprint: type: string description: A UUID that uniquely identifies the account number. If the same @@ -1539,6 +1793,7 @@ components: - billingDetails - createDate - updateDate + - transferTypesInfo properties: id: $ref: '#/components/schemas/Id' @@ -1554,6 +1809,13 @@ components: description: Wire tracking ref that needs to be set in the wire reference to beneficiary field. example: CIR13FB13A + transferTypesInfo: + type: object + description: A map which shows transfer + types supported on this account as well as additional information for + each. + additionalProperties: + $ref: '#/components/schemas/TransferTypeInfo' fingerprint: $ref: '#/components/schemas/Fingerprint' billingDetails: @@ -1857,6 +2119,7 @@ components: - walletAddress - createDate - updateDate + - transferTypesInfo properties: id: $ref: '#/components/schemas/Id' @@ -1871,6 +2134,14 @@ components: type: string description: Your CBIT wallet address. example: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + type: object + description: A map which shows transfer + types supported on this account as well as additional information for + each. For CBIT accounts this will always only show information for CBIT + transfers. + additionalProperties: + $ref: '#/components/schemas/TransferTypeInfo' createDate: $ref: '#/components/schemas/UtcTimestamp' updateDate: @@ -2337,6 +2608,112 @@ components: $ref: '#/components/schemas/UtcTimestamp' updateDate: $ref: '#/components/schemas/UtcTimestamp' + PixFiatAccountResponse: + type: object + required: + - id + - status + - description + - trackingRef + - fingerprint + - createDate + - updateDate + properties: + id: + $ref: '#/components/schemas/Id' + status: + $ref: '#/components/schemas/ExternalFiatAccountStatus' + description: + type: string + description: Bank name plus last four digits of the PIX account number. + example: BTG Pactual ****0010 + trackingRef: + type: string + description: Wire tracking ref that needs to be set in the wire reference + to beneficiary field. + example: CIR13FB13A + riskEvaluation: + $ref: '#/components/schemas/RiskEvaluation' + fingerprint: + $ref: '#/components/schemas/Fingerprint' + createDate: + $ref: '#/components/schemas/UtcTimestamp' + updateDate: + $ref: '#/components/schemas/UtcTimestamp' + PixAccountType: + type: string + title: Account type + description: Beneficiary account type. + enum: + - checking + - savings + - salary + - prepaid + example: checking + PixFiatAccountCreationRequest: + type: object + required: + - idempotencyKey + - name + - accountNumber + - ispb + - taxId + - accountType + properties: + idempotencyKey: + $ref: '#/components/schemas/IdempotencyKey' + name: + type: string + description: Name of the beneficiary. + example: CIRCLE INTERNET FINANCIAL INC + accountNumber: + type: string + description: Beneficiary account number. + example: '322286803' + ispb: + type: string + description: Beneficiary ISPB. + example: '68033222' + branchCode: + type: string + description: Beneficiary account branch code. + example: '123' + taxId: + type: string + description: Beneficiary Tax ID. + example: '57112345675712' + accountType: + $ref: '#/components/schemas/PixAccountType' + PixInstruction: + type: object + properties: + trackingRef: + type: string + description: Circle tracking reference that needs to be set in the PIX reference + field. + example: CIR25XSXT8 + ispb: + type: string + description: ISPB of beneficiary's bank. + example: '68033222' + branchCode: + type: string + description: Beneficiary account branch code. + example: '123' + accountNumber: + type: string + description: Beneficiary account number. + example: '322286803' + accountType: + $ref: '#/components/schemas/PixAccountType' + taxId: + type: string + description: Beneficiary Tax ID. + example: '57112345675712' + name: + type: string + description: Name of the beneficiary. + example: CIRCLE INTERNET FINANCIAL INC responses: NotAuthorized: description: The request has not been applied because it lacks valid authentication diff --git a/openapi/yaml/accounts.yaml b/openapi/yaml/accounts.yaml index 9b20dba..ef60c09 100644 --- a/openapi/yaml/accounts.yaml +++ b/openapi/yaml/accounts.yaml @@ -2,7 +2,7 @@ openapi: 3.0.2 servers: - url: https://api-sandbox.circle.com info: - version: 2.9.0 + version: 2.11.0 title: Accounts API description: The Accounts API allows you to easily create and host digital wallets for your customers, and manage transfers of funds across accounts- whether they diff --git a/openapi/yaml/circle-apis.yaml b/openapi/yaml/circle-apis.yaml index 143d0b9..7b25d64 100644 --- a/openapi/yaml/circle-apis.yaml +++ b/openapi/yaml/circle-apis.yaml @@ -2,7 +2,7 @@ openapi: 3.0.2 servers: - url: https://api-sandbox.circle.com info: - version: 2.9.0 + version: 2.11.0 title: All Circle APIs description: Circle's General, Core Functionality, Payments, Payouts, Accounts, and Crypto Payments APIs bundled into one OpenAPI Specification. @@ -43,6 +43,8 @@ tags: description: Get information on settlement batches. - name: CBIT description: Create and get information on CBIT accounts. +- name: PIX + description: Create and get information on PIX accounts. - name: Stablecoins description: Retrieve stablecoins and their respective names, symbols, circulating total and per-chain amounts. @@ -703,6 +705,11 @@ paths: status: pending description: WELLS FARGO BANK, NA ****0010 trackingRef: CIR13FB13A + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 billingDetails: name: Satoshi Nakamoto @@ -755,6 +762,11 @@ paths: status: pending description: WELLS FARGO BANK, NA ****0010 trackingRef: CIR13FB13A + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 billingDetails: name: Satoshi Nakamoto @@ -806,6 +818,11 @@ paths: status: pending description: WELLS FARGO BANK, NA ****0010 trackingRef: CIR13FB13A + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 billingDetails: name: Satoshi Nakamoto @@ -912,6 +929,11 @@ paths: status: pending trackingRef: CIR25XSXT8 walletAddress: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 createDate: '2020-04-10T02:13:30.000Z' updateDate: '2020-04-10T02:13:30.000Z' '400': @@ -948,6 +970,11 @@ paths: status: pending trackingRef: CIR25XSXT8 walletAddress: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 createDate: '2020-04-10T02:13:30.000Z' updateDate: '2020-04-10T02:13:30.000Z' '401': @@ -983,6 +1010,11 @@ paths: status: pending trackingRef: CIR25XSXT8 walletAddress: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + currencies: + - USD + additionalProperties: + transactionLimits: 100000 createDate: '2020-04-10T02:13:30.000Z' updateDate: '2020-04-10T02:13:30.000Z' '401': @@ -1025,6 +1057,170 @@ paths: $ref: '#/components/responses/NotAuthorized' '404': $ref: '#/components/responses/NotFound' + /v1/businessAccount/banks/pix: + post: + security: + - bearerAuth: [] + summary: Create a PIX bank account + operationId: createBusinessPixAccount + tags: + - PIX + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PixFiatAccountCreationRequest' + responses: + '201': + description: Successfully created a bank account for PIX transfers. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: CreateBusinessPixAccountResponse + properties: + data: + $ref: '#/components/schemas/PixFiatAccountResponse' + examples: + response: + value: + data: + id: b8627ae8-732b-4d25-b947-1df8f4007a29 + status: pending + description: BTG Pactual ****0010 + trackingRef: CIR13FB13A + riskEvaluation: + decision: approved + reason: '3000' + fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 + createDate: '2020-04-10T02:13:30.000Z' + updateDate: '2020-04-10T02:13:30.000Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/NotAuthorized' + get: + security: + - bearerAuth: [] + summary: List all PIX bank accounts. + operationId: listBusinessPixAccounts + tags: + - PIX + responses: + '200': + description: Successfully retrieved all bank accounts for PIX transfers. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: ListBusinessPixAccountsResponse + properties: + data: + type: array + items: + $ref: '#/components/schemas/PixFiatAccountResponse' + examples: + response: + value: + data: + - id: b8627ae8-732b-4d25-b947-1df8f4007a29 + status: pending + description: BTG Pactual ****0010 + trackingRef: CIR13FB13A + riskEvaluation: + decision: approved + reason: '3000' + fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 + createDate: '2020-04-10T02:13:30.000Z' + updateDate: '2020-04-10T02:13:30.000Z' + '401': + $ref: '#/components/responses/NotAuthorized' + /v1/businessAccount/banks/pix/{id}: + get: + parameters: + - $ref: '#/components/parameters/IdPath' + security: + - bearerAuth: [] + summary: Get a PIX bank account + operationId: getBusinessPixAccount + tags: + - PIX + responses: + '200': + description: Successfully retrieved a bank account for PIX transfers. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: GetBusinessPixAccountResponse + properties: + data: + $ref: '#/components/schemas/PixFiatAccountResponse' + examples: + response: + value: + data: + id: b8627ae8-732b-4d25-b947-1df8f4007a29 + status: pending + description: BTG Pactual ****0010 + trackingRef: CIR13FB13A + riskEvaluation: + decision: approved + reason: '3000' + fingerprint: eb170539-9e1c-4e92-bf4f-1d09534fdca2 + createDate: '2020-04-10T02:13:30.000Z' + updateDate: '2020-04-10T02:13:30.000Z' + '401': + $ref: '#/components/responses/NotAuthorized' + '404': + $ref: '#/components/responses/NotFound' + /v1/businessAccount/banks/pix/{id}/instructions: + get: + parameters: + - $ref: '#/components/parameters/IdPath' + security: + - bearerAuth: [] + summary: Get PIX instructions + description: Get the PIX transfer instructions into the Circle bank account + given your bank account id. + operationId: getBusinessPixAccountInstructions + tags: + - PIX + responses: + '200': + description: Successfully retrieved PIX transfer instructions for the bank + account. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: BusinessPixAccountInstructionsResponse + properties: + data: + $ref: '#/components/schemas/PixInstruction' + examples: + response: + value: + data: + trackingRef: CIR25XSXT8 + ispb: '68033222' + branchCode: '123' + accountNumber: '322286803' + accountType: checking + taxId: '57112345675712' + name: CIRCLE INTERNET FINANCIAL INC + '401': + $ref: '#/components/responses/NotAuthorized' + '404': + $ref: '#/components/responses/NotFound' /v1/businessAccount/wallets/addresses/deposit: post: security: @@ -2942,6 +3138,10 @@ paths: security: - bearerAuth: [] summary: Create a payout + description: "\nCreate a payout. \n\nThe following table includes the supported\ + \ pairs of amount.currency and toAmount.currency for FX payouts:\n\n| amount.currency\ + \ | toAmount.currency |\n| ---------------- | ------------ |\n | USD | BRL\ + \ |\n" operationId: createBusinessPayout tags: - Payouts @@ -2976,6 +3176,9 @@ paths: amount: amount: '3.14' currency: USD + toAmount: + amount: '3.14' + currency: USD fees: amount: '3.14' currency: USD @@ -3075,6 +3278,9 @@ paths: amount: amount: '3.14' currency: USD + toAmount: + amount: '3.14' + currency: USD fees: amount: '3.14' currency: USD @@ -3144,6 +3350,9 @@ paths: amount: amount: '3.14' currency: USD + toAmount: + amount: '3.14' + currency: USD fees: amount: '3.14' currency: USD @@ -3687,6 +3896,102 @@ paths: $ref: '#/components/responses/NotAuthorized' '404': $ref: '#/components/responses/NotFound' + /v1/exchange/quotes: + post: + security: + - bearerAuth: [] + summary: Fetch exchange rate + operationId: exchangeRate + description: 'Fetches an indicative exchange rate between two currencies. Either + the from currency or to currency must be USD. + + + Note: The current market exchange rate will be applied when Circle receives + the deposit. + + ' + tags: + - Payments + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExchangeRateRequest' + examples: + Null amounts: + value: + from: + currency: MXN + to: + currency: USD + Non-null from amount: + value: + from: + amount: 5.05 + currency: MXN + to: + currency: USD + Non-null to amount: + value: + from: + currency: MXN + to: + amount: 5.05 + currency: USD + responses: + '201': + description: Successfully fetched exchange rate. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: FetchExchangeRateResponse + properties: + data: + $ref: '#/components/schemas/ExchangeRateResponse' + examples: + Null amounts: + value: + data: + id: 8755d0ea-14f9-4259-b092-de23c14b6568 + rate: 17.0531 + from: + currency: MXN + to: + currency: USD + timestamp: '2022-07-21T20:13:35.578678Z' + Non-null from amount: + value: + data: + id: 8755d0ea-14f9-4259-b092-de23c14b6568 + rate: 17.0531 + from: + amount: 5.05 + currency: MXN + to: + amount: 0.29 + currency: USD + timestamp: '2022-07-21T20:13:35.578678Z' + Non-null to amount: + value: + data: + id: 8755d0ea-14f9-4259-b092-de23c14b6568 + rate: 17.0531 + from: + amount: 96.12 + currency: MXN + to: + amount: 5.05 + currency: USD + timestamp: '2022-07-21T20:13:35.578678Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/NotAuthorized' + '404': + $ref: '#/components/responses/NotFound' /v1/wallets: post: security: @@ -5546,6 +5851,35 @@ components: $ref: '#/components/schemas/UtcTimestamp' updateDate: $ref: '#/components/schemas/UtcTimestamp' + FiatCurrency: + type: string + description: Currency code. + title: Currency + enum: + - USD + - EUR + - MXN + - SGD + - BRL + TransferTypeInfo: + type: object + required: + - currencies + description: Additional information for specific transfer type. + properties: + currencies: + type: array + uniqueItems: true + items: + $ref: '#/components/schemas/FiatCurrency' + additionalProperties: + description: Additional properties that apply to specific transfer type. + type: object + properties: + transactionLimits: + type: integer + description: Transaction amount limit for the transfer type. + example: 100000 BankAddress: type: object description: The address details for the bank, as provided during bank account @@ -5598,6 +5932,7 @@ components: - billingDetails - createDate - updateDate + - transferTypesInfo properties: id: $ref: '#/components/schemas/Id' @@ -5613,6 +5948,13 @@ components: description: Wire tracking ref that needs to be set in the wire reference to beneficiary field. example: CIR13FB13A + transferTypesInfo: + type: object + description: A map which shows transfer + types supported on this account as well as additional information for + each. + additionalProperties: + $ref: '#/components/schemas/TransferTypeInfo' fingerprint: $ref: '#/components/schemas/Fingerprint' billingDetails: @@ -5867,6 +6209,7 @@ components: - walletAddress - createDate - updateDate + - transferTypesInfo properties: id: $ref: '#/components/schemas/Id' @@ -5881,6 +6224,14 @@ components: type: string description: Your CBIT wallet address. example: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + transferTypesInfo: + type: object + description: A map which shows transfer + types supported on this account as well as additional information for + each. For CBIT accounts this will always only show information for CBIT + transfers. + additionalProperties: + $ref: '#/components/schemas/TransferTypeInfo' createDate: $ref: '#/components/schemas/UtcTimestamp' updateDate: @@ -5910,6 +6261,112 @@ components: description: Circle wallet address that needs to be set in the CBIT recipient wallet field. example: '0x7d8da35e03ef3a5ec5d5edbb961ef399dfb42d1e' + PixFiatAccountResponse: + type: object + required: + - id + - status + - description + - trackingRef + - fingerprint + - createDate + - updateDate + properties: + id: + $ref: '#/components/schemas/Id' + status: + $ref: '#/components/schemas/ExternalFiatAccountStatus' + description: + type: string + description: Bank name plus last four digits of the PIX account number. + example: BTG Pactual ****0010 + trackingRef: + type: string + description: Wire tracking ref that needs to be set in the wire reference + to beneficiary field. + example: CIR13FB13A + riskEvaluation: + $ref: '#/components/schemas/RiskEvaluation' + fingerprint: + $ref: '#/components/schemas/Fingerprint' + createDate: + $ref: '#/components/schemas/UtcTimestamp' + updateDate: + $ref: '#/components/schemas/UtcTimestamp' + PixAccountType: + type: string + title: Account type + description: Beneficiary account type. + enum: + - checking + - savings + - salary + - prepaid + example: checking + PixFiatAccountCreationRequest: + type: object + required: + - idempotencyKey + - name + - accountNumber + - ispb + - taxId + - accountType + properties: + idempotencyKey: + $ref: '#/components/schemas/IdempotencyKey' + name: + type: string + description: Name of the beneficiary. + example: CIRCLE INTERNET FINANCIAL INC + accountNumber: + type: string + description: Beneficiary account number. + example: '322286803' + ispb: + type: string + description: Beneficiary ISPB. + example: '68033222' + branchCode: + type: string + description: Beneficiary account branch code. + example: '123' + taxId: + type: string + description: Beneficiary Tax ID. + example: '57112345675712' + accountType: + $ref: '#/components/schemas/PixAccountType' + PixInstruction: + type: object + properties: + trackingRef: + type: string + description: Circle tracking reference that needs to be set in the PIX reference + field. + example: CIR25XSXT8 + ispb: + type: string + description: ISPB of beneficiary's bank. + example: '68033222' + branchCode: + type: string + description: Beneficiary account branch code. + example: '123' + accountNumber: + type: string + description: Beneficiary account number. + example: '322286803' + accountType: + $ref: '#/components/schemas/PixAccountType' + taxId: + type: string + description: Beneficiary Tax ID. + example: '57112345675712' + name: + type: string + description: Name of the beneficiary. + example: CIRCLE INTERNET FINANCIAL INC Address: type: string description: An alphanumeric string representing a blockchain address. Will @@ -6028,11 +6485,7 @@ components: type: string example: '3.14' currency: - description: Currency code. - type: string - enum: - - USD - - EUR + $ref: '#/components/schemas/FiatCurrency' FiatMoneyUsd: type: object required: @@ -7613,6 +8066,18 @@ components: description: Bank name plus last four digits of the bank account number or IBAN. example: COMMERZBANK AG ****3000 + FiatPayoutToMoney: + type: object + required: + - currency + properties: + amount: + description: Magnitude of the amount, in units of the currency, with a `.`. + type: string + example: '3.14' + readOnly: true + currency: + $ref: '#/components/schemas/FiatCurrency' PayoutErrorCode: type: string nullable: true @@ -7691,6 +8156,8 @@ components: $ref: '#/components/schemas/BankDestination' amount: $ref: '#/components/schemas/FiatMoney' + toAmount: + $ref: '#/components/schemas/FiatPayoutToMoney' fees: $ref: '#/components/schemas/FiatMoneyUsd' status: @@ -7723,6 +8190,9 @@ components: enum: - wire - cbit + - pix + - sepa + - sepa_instant id: $ref: '#/components/schemas/Id' BusinessPayoutCreationRequest: @@ -7738,6 +8208,9 @@ components: $ref: '#/components/schemas/BusinessDestinationRequest' amount: $ref: '#/components/schemas/FiatMoney' + toAmount: + description: To be used when requesting currency exchange + $ref: '#/components/schemas/FiatPayoutToMoney' PayoutDestinationType: type: string description: The destination type. @@ -8097,6 +8570,55 @@ components: minItems: 1 items: $ref: '#/components/schemas/BasicChargebackHistory' + FiatOptionalAmountMoney: + type: object + title: OptionalAmountMoney + required: + - currency + properties: + amount: + description: Magnitude of the amount, in units of the currency, with a `.`. + type: string + example: '3.14' + currency: + $ref: '#/components/schemas/FiatCurrency' + ExchangeRateRequest: + type: object + required: + - from + - to + properties: + from: + allOf: + - $ref: '#/components/schemas/FiatOptionalAmountMoney' + description: Amount (Optional) and currency to convert from. If an amount + is provided here, then the amount in the "to" field must be null. + to: + allOf: + - $ref: '#/components/schemas/FiatOptionalAmountMoney' + description: Amount (Optional) and currency to convert to. If an amount + is provided here, then the amount in the "from" field must be null. + ExchangeRateResponse: + type: object + required: + - id + - rate + - from + - to + - timestamp + properties: + id: + $ref: '#/components/schemas/Id' + rate: + description: Exchange rate + type: number + format: float + from: + $ref: '#/components/schemas/FiatOptionalAmountMoney' + to: + $ref: '#/components/schemas/FiatOptionalAmountMoney' + timestamp: + $ref: '#/components/schemas/UtcTimestamp' Wallet: type: object properties: diff --git a/openapi/yaml/general.yaml b/openapi/yaml/general.yaml index bf17723..c168007 100644 --- a/openapi/yaml/general.yaml +++ b/openapi/yaml/general.yaml @@ -2,7 +2,7 @@ openapi: 3.0.2 servers: - url: https://api-sandbox.circle.com info: - version: 2.9.0 + version: 2.11.0 title: API Overview description: Common endpoints shared across all Circle APIs. tags: diff --git a/openapi/yaml/payments.yaml b/openapi/yaml/payments.yaml index b7d3a57..6b6dc2a 100644 --- a/openapi/yaml/payments.yaml +++ b/openapi/yaml/payments.yaml @@ -2,7 +2,7 @@ openapi: 3.0.2 servers: - url: https://api-sandbox.circle.com info: - version: 2.9.0 + version: 2.11.0 title: Payments API description: 'The Circle Payments API allows you to take payments from your end users via traditional methods such as debit & credit cards and receive settlement @@ -1992,6 +1992,102 @@ paths: $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' + /v1/exchange/quotes: + post: + security: + - bearerAuth: [] + summary: Fetch exchange rate + operationId: exchangeRate + description: 'Fetches an indicative exchange rate between two currencies. Either + the from currency or to currency must be USD. + + + Note: The current market exchange rate will be applied when Circle receives + the deposit. + + ' + tags: + - Payments + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExchangeRateRequest' + examples: + Null amounts: + value: + from: + currency: MXN + to: + currency: USD + Non-null from amount: + value: + from: + amount: 5.05 + currency: MXN + to: + currency: USD + Non-null to amount: + value: + from: + currency: MXN + to: + amount: 5.05 + currency: USD + responses: + '201': + description: Successfully fetched exchange rate. + headers: + X-Request-Id: + $ref: '#/components/headers/XRequestId' + content: + application/json: + schema: + title: FetchExchangeRateResponse + properties: + data: + $ref: '#/components/schemas/ExchangeRateResponse' + examples: + Null amounts: + value: + data: + id: 8755d0ea-14f9-4259-b092-de23c14b6568 + rate: 17.0531 + from: + currency: MXN + to: + currency: USD + timestamp: '2022-07-21T20:13:35.578678Z' + Non-null from amount: + value: + data: + id: 8755d0ea-14f9-4259-b092-de23c14b6568 + rate: 17.0531 + from: + amount: 5.05 + currency: MXN + to: + amount: 0.29 + currency: USD + timestamp: '2022-07-21T20:13:35.578678Z' + Non-null to amount: + value: + data: + id: 8755d0ea-14f9-4259-b092-de23c14b6568 + rate: 17.0531 + from: + amount: 96.12 + currency: MXN + to: + amount: 5.05 + currency: USD + timestamp: '2022-07-21T20:13:35.578678Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/NotAuthorized' + '404': + $ref: '#/components/responses/NotFound' /v1/balances: get: security: @@ -2446,6 +2542,16 @@ components: type: string enum: - USD + FiatCurrency: + type: string + description: Currency code. + title: Currency + enum: + - USD + - EUR + - MXN + - SGD + - BRL FiatMoney: type: object required: @@ -2457,11 +2563,7 @@ components: type: string example: '3.14' currency: - description: Currency code. - type: string - enum: - - USD - - EUR + $ref: '#/components/schemas/FiatCurrency' SourceResponse: type: object description: The payment source. @@ -4752,6 +4854,55 @@ components: MockChargeback: type: object properties: {} + FiatOptionalAmountMoney: + type: object + title: OptionalAmountMoney + required: + - currency + properties: + amount: + description: Magnitude of the amount, in units of the currency, with a `.`. + type: string + example: '3.14' + currency: + $ref: '#/components/schemas/FiatCurrency' + ExchangeRateRequest: + type: object + required: + - from + - to + properties: + from: + allOf: + - $ref: '#/components/schemas/FiatOptionalAmountMoney' + description: Amount (Optional) and currency to convert from. If an amount + is provided here, then the amount in the "to" field must be null. + to: + allOf: + - $ref: '#/components/schemas/FiatOptionalAmountMoney' + description: Amount (Optional) and currency to convert to. If an amount + is provided here, then the amount in the "from" field must be null. + ExchangeRateResponse: + type: object + required: + - id + - rate + - from + - to + - timestamp + properties: + id: + $ref: '#/components/schemas/Id' + rate: + description: Exchange rate + type: number + format: float + from: + $ref: '#/components/schemas/FiatOptionalAmountMoney' + to: + $ref: '#/components/schemas/FiatOptionalAmountMoney' + timestamp: + $ref: '#/components/schemas/UtcTimestamp' Money: type: object required: diff --git a/openapi/yaml/payouts.yaml b/openapi/yaml/payouts.yaml index 9be09bd..7e85a1b 100644 --- a/openapi/yaml/payouts.yaml +++ b/openapi/yaml/payouts.yaml @@ -2,7 +2,7 @@ openapi: 3.0.2 servers: - url: https://api-sandbox.circle.com info: - version: 2.9.0 + version: 2.11.0 title: Payouts API description: The Circle Payouts API allows you to programmatically make fast, global payouts to your customers, vendors, and suppliers. Make payouts on supported blockchains.