We refreshed our doc site!

Bookmarked links may have changed

Read release notes

Circle Mint

Circle SDKs

Use our SDKs to quickly get your codebase up and running with Circle APIs.

Circle’s SDKs are developer toolkits that enable you to integrate your code with Circle APIs. Because our SDKs are open source, users like you can help us to improve them. If you find bugs or missing features, we encourage you to file an issue or contribute back to the node-sdk.

**Note: **This page contains code snippets and examples that can be run as is or incorporated into your apps.

Circle offers SDKs for Typescript, Java and Python. Java and Python SDKs are currently in beta.

Installing the SDK

You can run one of the two commands below from your project directory to install the SDK.

npm install @circle-fin/circle-sdk --save
# or
yarn add @circle-fin/circle-sdk

Configuration

import { Circle, CircleEnvironments } from "@circle-fin/circle-sdk";
 
const circle = new Circle(
 "<your-api-key>",
 CircleEnvironments.sandbox // API base url
);

List balances

async function listBalances() {
 const balancesRes = await circle.balances.listBalances();
}

Create a crypto payment

async function createCryptoPayment() {
 const createCryptoPaymentRes =
   await circle.paymentIntents.createPaymentIntent({
     idempotencyKey: "5c6e9b91-6563-47ec-8c6d-0ce1103c50b3",
     amount: {
       amount: "3.14",
       currency: "USD",
     },
     settlementCurrency: "USD",
     paymentMethods: [
       {
         chain: "ETH",
         type: "blockchain",
       },
     ],
   });
}

Get a crypto payment

async function getCryptoPayment(id: string) {
 const cryptoPayment = await circle.paymentIntents.getPaymentIntent(id);
}
Did this page help you?
© 2023-2024 Circle Technology Services, LLC. All rights reserved.