Skip to content

Commit 0ab46ff

Browse files
feat: add exchange cps quote api
1 parent d64938e commit 0ab46ff

File tree

13 files changed

+585
-1
lines changed

13 files changed

+585
-1
lines changed

sdk.json

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"info": {
99
"version": "2.14.0",
1010
"title": "All Circle APIs",
11-
"description": "Circle's General, Core Functionality, Payments, Payouts, Accounts, and Crypto Payments APIs bundled into one OpenAPI Specification."
11+
"description": "Circle's General, Core Functionality, Payments, Payouts, Accounts, Crypto Payments, and Exchange APIs bundled into one OpenAPI Specification."
1212
},
1313
"tags": [
1414
{
@@ -114,6 +114,10 @@
114114
{
115115
"name": "Checkout Sessions",
116116
"description": "Create, get, extend a checkout session."
117+
},
118+
{
119+
"name": "Exchange",
120+
"description": "Exchange between two currencies."
117121
}
118122
],
119123
"paths": {
@@ -6998,6 +7002,46 @@
69987002
}
69997003
}
70007004
}
7005+
},
7006+
"/v1/exchange/cps/quotes": {
7007+
"post": {
7008+
"security": [
7009+
{
7010+
"bearerAuth": []
7011+
}
7012+
],
7013+
"summary": "Create CPS Quote",
7014+
"description": "Create a quote for exchanging between two stablecoins.",
7015+
"operationId": "createCpsQuote",
7016+
"tags": ["Exchange"],
7017+
"requestBody": {
7018+
"content": {
7019+
"application/json": {
7020+
"schema": {
7021+
"$ref": "#/components/schemas/CreateCpsQuoteRequest"
7022+
}
7023+
}
7024+
}
7025+
},
7026+
"responses": {
7027+
"200": {
7028+
"description": "Successfully created CPS quote.",
7029+
"content": {
7030+
"application/json": {
7031+
"schema": {
7032+
"$ref": "#/components/schemas/CreateCpsQuoteResponse"
7033+
}
7034+
}
7035+
}
7036+
},
7037+
"400": {
7038+
"$ref": "#/components/responses/BadRequest"
7039+
},
7040+
"401": {
7041+
"$ref": "#/components/responses/NotAuthorized"
7042+
}
7043+
}
7044+
}
70017045
}
70027046
},
70037047
"components": {
@@ -7018,6 +7062,106 @@
70187062
}
70197063
}
70207064
},
7065+
"CreateCpsQuoteRequest": {
7066+
"type": "object",
7067+
"required": ["from", "to"],
7068+
"properties": {
7069+
"from": {
7070+
"$ref": "#/components/schemas/CpsFromCurrency"
7071+
},
7072+
"to": {
7073+
"$ref": "#/components/schemas/CpsToAmount"
7074+
}
7075+
}
7076+
},
7077+
"CpsFromCurrency": {
7078+
"type": "object",
7079+
"required": ["currency"],
7080+
"properties": {
7081+
"amount": {
7082+
"type": "number",
7083+
"nullable": true,
7084+
"description": "Source amount (optional)",
7085+
"example": 100.0
7086+
},
7087+
"currency": {
7088+
"$ref": "#/components/schemas/CpsCurrency"
7089+
}
7090+
}
7091+
},
7092+
"CpsToAmount": {
7093+
"type": "object",
7094+
"required": ["currency"],
7095+
"properties": {
7096+
"amount": {
7097+
"type": "number",
7098+
"nullable": true,
7099+
"description": "Target amount (optional)",
7100+
"example": 1000
7101+
},
7102+
"currency": {
7103+
"$ref": "#/components/schemas/CpsCurrency"
7104+
}
7105+
}
7106+
},
7107+
"CpsCurrency": {
7108+
"type": "string",
7109+
"description": "Supported stablecoin currency codes",
7110+
"enum": ["USDC", "EURC"],
7111+
"example": "USDC"
7112+
},
7113+
"CreateCpsQuoteResponse": {
7114+
"type": "object",
7115+
"properties": {
7116+
"data": {
7117+
"$ref": "#/components/schemas/CpsQuote"
7118+
}
7119+
}
7120+
},
7121+
"CpsQuote": {
7122+
"type": "object",
7123+
"properties": {
7124+
"id": {
7125+
"type": "string",
7126+
"description": "Unique identifier for the CPS quote",
7127+
"example": "825a494f-83a7-4e1f-bb6c-e01f0766f420"
7128+
},
7129+
"rate": {
7130+
"type": "string",
7131+
"description": "Exchange rate",
7132+
"example": "0.9132"
7133+
},
7134+
"from": {
7135+
"$ref": "#/components/schemas/CpsMoney"
7136+
},
7137+
"to": {
7138+
"$ref": "#/components/schemas/CpsMoney"
7139+
},
7140+
"fee": {
7141+
"$ref": "#/components/schemas/CpsMoney"
7142+
},
7143+
"expiry": {
7144+
"type": "string",
7145+
"format": "date-time",
7146+
"description": "Quote expiration time in ISO-8601 format",
7147+
"example": "2025-09-10T17:48:12.237Z"
7148+
}
7149+
}
7150+
},
7151+
"CpsMoney": {
7152+
"type": "object",
7153+
"required": ["amount", "currency"],
7154+
"properties": {
7155+
"amount": {
7156+
"type": "string",
7157+
"description": "Magnitude of the amount with high precision",
7158+
"example": "913.390000000000000000000000000000000000000000000000000000000000000000000000000000"
7159+
},
7160+
"currency": {
7161+
"$ref": "#/components/schemas/CpsCurrency"
7162+
}
7163+
}
7164+
},
70217165
"MerchantWalletId": {
70227166
"type": "string",
70237167
"description": "Unique system generated identifier for the wallet of the merchant.",

src/generated/.openapi-generator/FILES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ apis/crypto-payment-intents-api.ts
1212
apis/cubixapi.ts
1313
apis/deposits-api.ts
1414
apis/encryption-api.ts
15+
apis/exchange-api.ts
1516
apis/health-api.ts
1617
apis/management-api.ts
1718
apis/payment-tokens-api.ts
@@ -82,6 +83,11 @@ models/checkout-session.ts
8283
models/conflict.ts
8384
models/continuous-payment-intent-creation-request.ts
8485
models/continuous-payment-intent.ts
86+
models/cps-currency.ts
87+
models/cps-from-currency.ts
88+
models/cps-money.ts
89+
models/cps-quote.ts
90+
models/cps-to-amount.ts
8591
models/create-address-book-recipient-response.ts
8692
models/create-business-cbit-account-response.ts
8793
models/create-business-cubix-account-response.ts
@@ -93,6 +99,8 @@ models/create-business-transfer-response.ts
9399
models/create-business-wire-account-response.ts
94100
models/create-card-response.ts
95101
models/create-checkout-session-response.ts
102+
models/create-cps-quote-request.ts
103+
models/create-cps-quote-response.ts
96104
models/create-crypto-payment-response.ts
97105
models/create-crypto-payment-response1.ts
98106
models/create-crypto-refund-response.ts

src/generated/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export * from "./apis/crypto-exchange-rates-api";
1919
export * from "./apis/crypto-payment-intents-api";
2020
export * from "./apis/deposits-api";
2121
export * from "./apis/encryption-api";
22+
export * from "./apis/exchange-api";
2223
export * from "./apis/health-api";
2324
export * from "./apis/management-api";
2425
export * from "./apis/pixapi";

0 commit comments

Comments
 (0)