### Install Go SDK Source: https://docs.dakota.xyz/documentation/sdks Install the official Go SDK using the go get command. This prepares your Go project for integration with the Dakota platform. ```bash go get github.com/dakota-xyz/go-sdk ``` -------------------------------- ### GET Request Example Source: https://docs.dakota.xyz/documentation/authentication/api-keys-headers This example demonstrates how to make an authenticated GET request to the `/customers` endpoint using your API key. It includes the required `x-api-key` and `Content-Type` headers. ```APIDOC ## GET /customers ### Description Retrieves a list of customers. ### Method GET ### Endpoint /customers ### Headers - **x-api-key** (string) - Required - Your API key for authentication. - **Content-Type** (string) - Required - Set to `application/json`. ### Request Example ```bash curl -X GET https://api.platform.dakota.xyz/customers \ -H "x-api-key: AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=" \ -H "Content-Type: application/json" ``` ```javascript const response = await fetch('https://api.platform.dakota.xyz/customers', { headers: { 'x-api-key': 'AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=', 'Content-Type': 'application/json' } }); ``` ```python import requests response = requests.get( 'https://api.platform.dakota.xyz/customers', headers={ 'x-api-key': 'AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=', 'Content-Type': 'application/json' } ) ``` ```go package main import ( "net/http" ) func main() { client := &http.Client{} req, _ := http.NewRequest("GET", "https://api.platform.dakota.xyz/customers", nil) req.Header.Add("x-api-key", "AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=") req.Header.Add("Content-Type", "application/json") resp, _ := client.Do(req) defer resp.Body.Close() } ``` ```rust use reqwest::header::{HeaderMap, HeaderValue}; #[tokio::main] async fn main() -> Result<(), Box> { let client = reqwest::Client::new(); let mut headers = HeaderMap::new(); headers.insert("x-api-key", HeaderValue::from_static("AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=")); headers.insert("Content-Type", HeaderValue::from_static("application/json")); let response = client .get("https://api.platform.dakota.xyz/customers") .headers(headers) .send() .await?; Ok(()) } ``` ```java import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.URI; public class DakotaGetExample { public static void main(String[] args) throws Exception { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.platform.dakota.xyz/customers")) .header("x-api-key", "AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=") .header("Content-Type", "application/json") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); } } ``` ``` -------------------------------- ### GET Request with API Key Authentication Source: https://docs.dakota.xyz/api-reference/introduction Use this example to make a GET request to the API. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```bash curl -X GET https://api.platform.dakota.xyz/customers \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### List Webhook Targets (Go) Source: https://docs.dakota.xyz/documentation/webhooks Make a GET request to list webhook targets using Go's standard http package. This example sets up the client, request, and headers. ```go package main import ( "net/http" ) func main() { client := &http.Client{} req, _ := http.NewRequest("GET", "https://api.platform.dakota.xyz/webhooks/targets", nil) req.Header.Add("X-API-Key", "your-api-key") resp, _ := client.Do(req) defer resp.Body.Close() } ``` -------------------------------- ### Making Authenticated GET Requests Source: https://docs.dakota.xyz/documentation/authentication/api-keys-headers Examples of making authenticated GET requests to the API using various programming languages. These examples include the necessary `x-api-key` and `Content-Type` headers. ```bash curl -X GET https://api.platform.dakota.xyz/customers \ -H "x-api-key: AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=" \ -H "Content-Type: application/json" ``` ```javascript const response = await fetch('https://api.platform.dakota.xyz/customers', { headers: { 'x-api-key': 'AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=', 'Content-Type': 'application/json' } }); ``` ```python import requests response = requests.get( 'https://api.platform.dakota.xyz/customers', headers={ 'x-api-key': 'AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=', 'Content-Type': 'application/json' } ) ``` ```go package main import ( "net/http" ) func main() { client := &http.Client{} req, _ := http.NewRequest("GET", "https://api.platform.dakota.xyz/customers", nil) req.Header.Add("x-api-key", "AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=") req.Header.Add("Content-Type", "application/json") resp, _ := client.Do(req) defer resp.Body.Close() } ``` ```rust use reqwest::header::{HeaderMap, HeaderValue}; #[tokio::main] async fn main() -> Result<(), Box> { let client = reqwest::Client::new(); let mut headers = HeaderMap::new(); headers.insert("x-api-key", HeaderValue::from_static("AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=")); headers.insert("Content-Type", HeaderValue::from_static("application/json")); let response = client .get("https://api.platform.dakota.xyz/customers") .headers(headers) .send() .await?; Ok(()) } ``` ```java import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.URI; public class DakotaGetExample { public static void main(String[] args) throws Exception { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.platform.dakota.xyz/customers")) .header("x-api-key", "AHGlPZaxDSMz8Wf1l8VRH4ObdbHiKsWFWnmRyHtiwAc=") .header("Content-Type", "application/json") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); } } ``` -------------------------------- ### List Destinations for a Recipient (Go) Source: https://docs.dakota.xyz/documentation/destinations-recipients Make a GET request to list destinations for a recipient using Go's `net/http` package. This example includes setting up the HTTP client and request headers. ```go package main import ( "net/http" ) func main() { client := &http.Client{} req, _ := http.NewRequest("GET", "https://api.platform.dakota.xyz/recipients/" + recipientId + "/destinations", nil) req.Header.Add("X-API-Key", "your-api-key") resp, _ := client.Do(req) defer resp.Body.Close() } ``` -------------------------------- ### Create User Request Example Source: https://docs.dakota.xyz/api-reference/users/create-a-new-user Provides an example of the request body for creating a new user. Ensure all required fields are present. ```json { "first_name": "John", "last_name": "Doe", "email": "john@example.com", "role": "admin" } ``` -------------------------------- ### Get Customers Source: https://docs.dakota.xyz/api-reference/introduction Retrieve a list of customers. This is a basic example to get started with the API. ```APIDOC ## GET /customers ### Description Retrieves a list of customers managed by the Dakota Platform. ### Method GET ### Endpoint /customers ### Parameters #### Query Parameters None explicitly documented. #### Request Body None ### Request Example ```bash curl -X GET https://api.platform.sandbox.dakota.xyz/customers \ -H "x-api-key: YOUR_API_KEY" ``` ### Response #### Success Response (200) - **(Type Undetermined)** - Description of customer data not provided in source. #### Response Example No example provided in source. ``` -------------------------------- ### Create a Customer in Go Source: https://docs.dakota.xyz/api-reference/introduction This Go example shows the process of creating a business customer. Replace 'YOUR_API_KEY' and 'unique-request-id' with your actual API key and idempotency key. ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) type CustomerRequest struct { CustomerType string `json:"customer_type"` Name string `json:"name"` ExternalID *string `json:"external_id,omitempty"` } type CustomerResponse struct { ID string `json:"id"` ApplicationID string `json:"application_id"` ApplicationURL string `json:"application_url"` } func main() { externalID := "your-internal-id" reqBody := CustomerRequest{ CustomerType: "business", Name: "Acme Corp", ExternalID: &externalID, } jsonBody, _ := json.Marshal(reqBody) req, _ := http.NewRequest("POST", "https://api.platform.dakota.xyz/customers", bytes.NewBuffer(jsonBody)) req.Header.Set("x-api-key", "YOUR_API_KEY") req.Header.Set("x-idempotency-key", "unique-request-id") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close() var customer CustomerResponse json.NewDecoder(resp.Body).Decode(&customer) fmt.Println("Customer ID:", customer.ID) fmt.Println("Application URL:", customer.ApplicationURL) } ``` -------------------------------- ### Make a GET Request to Customers Endpoint Source: https://docs.dakota.xyz/api-reference/introduction Use this cURL command to make a GET request to the customers endpoint. Replace YOUR_API_KEY with your actual API key. This is a basic example for getting started with API requests. ```bash curl -X GET https://api.platform.sandbox.dakota.xyz/customers \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### Quick Start Go SDK Source: https://docs.dakota.xyz/documentation/sdks Initialize the Dakota client and list customers using the Go SDK. Replace 'your_api_key' with your actual Dakota API key. ```go import ( "github.com/dakota-xyz/go-sdk/client" "github.com/dakota-xyz/go-sdk/client/gen" ) c, _ := client.New(client.WithAPIKey("your_api_key")) resp, _ := client.CheckResponse( c.Raw().ListCustomersWithResponse(ctx, &gen.ListCustomersParams{}), ) for _, customer := range resp.JSON200.Data { fmt.Println(customer.Name) } ``` -------------------------------- ### Create a Customer in JavaScript Source: https://docs.dakota.xyz/api-reference This example demonstrates how to create a new customer using a POST request. Ensure you include the 'x-api-key' and 'x-idempotency-key' headers. ```javascript const response = await fetch('https://api.platform.sandbox.dakota.xyz/customers', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'x-idempotency-key': 'unique-request-id', 'Content-Type': 'application/json' }, body: JSON.stringify({ customer_type: 'business', name: 'Acme Corp', external_id: 'your-internal-id' }) }); const customer = await response.json(); console.log('Customer ID:', customer.id); console.log('Application URL:', customer.application_url); ``` -------------------------------- ### Initiate Bank Transaction with Go Source: https://docs.dakota.xyz/documentation/destinations-recipients This Go example demonstrates initiating a bank transaction by making an HTTP POST request. It sets up the client, request body, and headers, including the API key and a generated idempotency key. Ensure the `github.com/google/uuid` package is imported. ```go package main import ( "bytes" "net/http" "github.com/google/uuid" ) func main() { client := &http.Client{} body := bytes.NewBufferString(`{ "customer_id": "31Tgw0zSyDVo4Az66kmzUjMuwxx", "destination_id": "31TgvtxUdXi95dUN4M8X1rhSCNS", "source_asset": "USDC", "source_network_id": "ethereum-mainnet", "destination_asset": "USD", "destination_network_id": "fiat", "amount": "500.00" }`) req, _ := http.NewRequest("POST", "https://api.platform.dakota.xyz/transactions", body) req.Header.Add("X-API-Key", "your-api-key") req.Header.Add("X-Idempotency-Key", uuid.New().String()) req.Header.Add("Content-Type", "application/json") resp, _ := client.Do(req) defer resp.Body.Close() } ``` -------------------------------- ### Create Crypto Destination with Go Source: https://docs.dakota.xyz/documentation/destinations-recipients This Go example demonstrates creating a crypto destination. It utilizes the `net/http` package for making the POST request and `github.com/google/uuid` for generating an idempotency key. ```go package main import ( "bytes" "net/http" "github.com/google/uuid" ) func main() { client := &http.Client{} body := bytes.NewBufferString(`{ "destination_type": "crypto", "name": "Primary USDC Wallet", "crypto_address": "0x742d35Cc6634C0532925a3b8D404fA40b5398Ad2", "network_id": "ethereum-mainnet" }`) req, _ := http.NewRequest("POST", "https://api.platform.dakota.xyz/recipients/" + recipientId + "/destinations", body) req.Header.Add("X-API-Key", "your-api-key") req.Header.Add("X-Idempotency-Key", uuid.New().String()) req.Header.Add("Content-Type", "application/json") resp, _ := client.Do(req) defer resp.Body.Close() } ``` -------------------------------- ### Get Wallets for a Policy (JSON Response Example) Source: https://docs.dakota.xyz/api-reference/policies/get-wallets-attached-to-a-policy This example demonstrates the structure of a successful JSON response when retrieving wallets attached to a policy. It includes the ID, name, and family of each wallet. ```json [ { "id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi", "name": "Treasury Wallet", "family": "evm" } ] ``` -------------------------------- ### Get Recipient by ID Source: https://docs.dakota.xyz/api-reference/recipients/get-a-specific-recipient This example demonstrates how to retrieve a recipient's details using their ID. ```APIDOC ## GET /recipients/{id} ### Description Retrieves the details of a specific recipient. ### Method GET ### Endpoint /recipients/{id} ### Parameters #### Path Parameters - **id** (KSUID) - Required - The unique identifier of the recipient. ### Response #### Success Response (200) - **id** (KSUID) - The unique identifier of the recipient. - **name** (string) - The name of the recipient. - **address** (object) - The physical address of the recipient (nullable). - **status** (string) - The current status of the recipient (e.g., "unused", "active", "frozen"). - **destinations** (array) - A list of destinations associated with this recipient. #### Response Example ```json { "id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi", "name": "Acme Corporation", "address": { "street1": "123 Main St", "city": "San Francisco", "postal_code": "94105", "country": "US" }, "status": "active", "destinations": [ { "destination_type": "crypto", "address": "0x123...", "network": "ethereum" } ] } ``` #### Error Response (404) - **type** (string) - URI reference identifying the problem type. - **title** (string) - Short, human-readable summary of the problem type. - **status** (integer) - HTTP status code for this occurrence. - **detail** (string) - Human-readable explanation specific to this occurrence. - **instance** (string) - The request path that triggered this error. - **request_id** (string) - Unique request identifier. #### Error Response Example ```json { "type": "https://docs.dakota.xyz/api-reference/errors#not-found", "title": "Recipient Not Found", "status": 404, "detail": "Recipient rcp_2abc123 was not found in your organization.", "instance": "https://api.platform.dakota.xyz/recipients/rcp_2abc123", "request_id": "req_7f3a8b2c" } ``` ``` -------------------------------- ### Make First API Call (Raw HTTP) Source: https://docs.dakota.xyz/ Make a GET request to the customers endpoint using a raw HTTP client and your API key. Ensure you are using the sandbox environment. ```bash curl -X GET https://api.platform.sandbox.dakota.xyz/customers \ -H "x-api-key: YOUR_API_KEY" ``` -------------------------------- ### List Customers Source: https://docs.dakota.xyz/api-reference Fetches a list of all customers. This is a basic example demonstrating how to authenticate and make a GET request to the API. ```APIDOC ## GET /customers ### Description Retrieves a list of all customers managed by the Dakota Platform. ### Method GET ### Endpoint /customers ### Parameters #### Query Parameters None explicitly documented. #### Request Body None. ### Request Example ```bash curl -X GET https://api.platform.sandbox.dakota.xyz/customers \ -H "x-api-key: YOUR_API_KEY" ``` ### Response #### Success Response (200) Details of the response body are not explicitly documented in the provided text, but it is expected to contain a list of customer objects. #### Response Example (Example not provided in source text) ``` -------------------------------- ### POST Request with API Key and Idempotency Key Source: https://docs.dakota.xyz/api-reference/introduction This example demonstrates how to make a POST request, including the required 'x-api-key' and 'x-idempotency-key' headers. The 'Content-Type' and request body are also specified. ```bash curl -X POST https://api.platform.dakota.xyz/customers \ -H "x-api-key: YOUR_API_KEY" \ -H "x-idempotency-key: unique-request-id" \ -H "Content-Type: application/json" \ -d '{"customer_type": "business", "name": "Acme Corp"}' ``` -------------------------------- ### Real-World Example: Payment Chain Structure Source: https://docs.dakota.xyz/documentation/destinations-recipients Demonstrates a multi-destination setup for a recipient, including bank accounts and crypto wallets for different currencies and networks. ```plaintext Customer: Acme Corp └── Recipient: Global Manufacturing Ltd ├── Destination 1: Bank Account (USD payments) │ ├── Type: fiat_us │ ├── Account: ****6789 │ └── Routing: 021000021 ├── Destination 2: Ethereum Wallet (USDC payments) │ ├── Type: crypto │ ├── Address: 0x742d35Cc6634C0532925a3b8D404fA40b5398Ad2 │ └── Network: ethereum-mainnet └── Destination 3: Solana Wallet (SOL/USDC payments) ├── Type: crypto ├── Address: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU └── Network: solana ``` -------------------------------- ### Verify Customer KYB Status with Python Source: https://docs.dakota.xyz/documentation/destinations-recipients This Python example uses the `requests` library to get customer information from the Dakota API. It prints the KYB status after a successful request. ```python import requests response = requests.get( 'https://api.platform.dakota.xyz/customers/31Tgw0zSyDVo4Az66kmzUjMuwxx', headers={'X-API-Key': 'your-api-key'} ) customer = response.json() print(f'Customer KYB Status: {customer["data"]["kyb_status"]}') ``` -------------------------------- ### Simulate Onboarding State Transition (OpenAPI) Source: https://docs.dakota.xyz/api-reference/sandbox/simulate-an-onboarding-state-transition This OpenAPI definition describes the POST endpoint for simulating onboarding state transitions. It requires an idempotency key and an API key for authentication and idempotency control. ```yaml openapi: 3.0.3 info: title: Dakota Platform API version: 1.0.0 description: >- Combined API specification for Dakota Platform services: - Issuance API: Asset minting and burning operations - Onboarding API: Know Your Business/Customer verification - On/Off Ramp API: Managing on-ramp and off-ramp accounts - Recipients API: Managing destinations for KYB'd entities - Transactions API: Viewing transaction history across platform operations ## Authentication and API Headers All API endpoints require the following headers: - `x-idempotency-key`: Required for all POST endpoints to ensure request idempotency - `x-api-key`: Required for authentication across all endpoints Note: On /applications endpoints you need a token for authentication instead of a x-api-key - `x-application-token`: Required for authentication on public /applications endpoints (alternative to `x-api-key` where documented) ## Rate Limits Requests are rate limited per API key. Every response includes the following headers: | Header | Description | | --- | --- | | `X-RateLimit-Limit` | Maximum requests allowed in the current one-minute window. | | `X-RateLimit-Remaining` | Requests remaining in the current window. | | `X-RateLimit-Reset` | Absolute Unix timestamp (seconds since epoch) when the current rate-limit window resets. | When a request is throttled (`429`), responses also include `Retry-After` with seconds to wait before retrying. servers: - url: https://api.platform.dakota.xyz description: Production environment - url: https://api.platform.sandbox.dakota.xyz description: Sandbox — safe for testing with simulated data security: - ApiKeyAuth: [] tags: - name: Customers description: >- Manage customer entities representing businesses and organizations onboarded to Dakota. **Prerequisites:** Complete KYB via Onboarding endpoints before initiating money movement. **Related:** Onboarding, Recipients, Transactions, Accounts, Wallets - name: Wallets description: >- Manage wallets, balances, and wallet-to-signer-group relationships for custody and movement controls. **Prerequisites:** Customer must exist. Configure signer groups before policy-enforced workflows. **Related:** Signer Groups, Policies, Transactions, Customers - name: Transactions description: >- Create, cancel, and retrieve transaction records across account and wallet flows. **Prerequisites:** Accounts or destinations must be configured based on flow type. **Related:** Accounts, Recipients, Policies, Events - name: Recipients description: >- Manage recipient entities and destination rails used by customers for payouts and transfers. **Prerequisites:** Customer must be onboarded and active. **Related:** Customers, Transactions, Accounts, Onboarding - name: Accounts description: >- Manage account resources used for onramp, offramp, and swap operations. **Prerequisites:** Customer must be created and network/asset constraints must be known. **Related:** Customers, Transactions, Auto Transactions, Info - name: Auto Transactions description: >- Manage automated transaction configurations and execution history for account automation workflows. **Prerequisites:** Source account must exist and be configured for automation. **Related:** Accounts, Transactions, Events - name: Onboarding description: >- Manage KYB/KYC onboarding lifecycle, application documents, attestations, and verification steps. **Prerequisites:** Customer context and required entity/application metadata. **Related:** Customers, Exceptions, Recipients, Transactions - name: Policies description: >- Define and manage policy objects and rules used for transaction governance and risk controls. **Prerequisites:** Wallet and signer group resources should be configured for enforcement scenarios. **Related:** Wallets, Signer Groups, Transactions - name: Signer Groups description: >- Manage signer groups and signer assignments for multi-party authorization models. **Prerequisites:** Wallets should exist before linking signer groups. **Related:** Wallets, Policies, Transactions - name: Authentication description: >- Manage API authentication credentials and key lifecycle for platform access. **Prerequisites:** Client organization must be provisioned. **Related:** Users, Info - name: Users description: >- Manage client users, roles, and identity metadata for platform access control. ``` -------------------------------- ### List Destinations for a Recipient (JavaScript) Source: https://docs.dakota.xyz/documentation/destinations-recipients Fetch recipient destinations using JavaScript's `fetch` API. This example demonstrates making an asynchronous GET request and parsing the JSON response. ```javascript const response = await fetch(`https://api.platform.dakota.xyz/recipients/${recipientId}/destinations`, { headers: { 'X-API-Key': 'your-api-key' } }); const destinations = await response.json(); ``` -------------------------------- ### List all onboarding applications Source: https://docs.dakota.xyz/api-reference/onboarding/list-all-onboarding-applications Returns a paginated list of your onboarding applications for both businesses and individuals. Use the `type` parameter to filter by application type, and `status` to filter by application status. Supports cursor-based pagination using `starting_after`, `ending_before`, and `limit` parameters. ```APIDOC ## GET /applications ### Description Returns a paginated list of your onboarding applications for both businesses and individuals. Supports filtering by application type and status, and cursor-based pagination. ### Method GET ### Endpoint /applications ### Query Parameters - **type** (string) - Optional - Filters applications by type (e.g., 'business', 'individual'). - **status** (string) - Optional - Filters applications by status (e.g., 'pending', 'approved', 'rejected'). - **starting_after** (string) - Optional - Cursor for pagination, returns applications after this ID. - **ending_before** (string) - Optional - Cursor for pagination, returns applications before this ID. - **limit** (integer) - Optional - Maximum number of applications to return per page. ### Authentication Accepts API Key (X-API-Key header) or Application Token (X-Application-Token header). ### Response #### Success Response (200) - **data** (array) - List of onboarding applications. - **id** (string) - The unique identifier for the application. - **type** (string) - The type of the application (e.g., 'business', 'individual'). - **status** (string) - The current status of the application. - **created_at** (string) - Timestamp when the application was created. - **updated_at** (string) - Timestamp when the application was last updated. #### Response Example ```json { "data": [ { "id": "app_123", "type": "business", "status": "approved", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:30:00Z" } ], "has_more": true, "next_cursor": "cursor_abc" } ``` ``` -------------------------------- ### Verify Customer KYB Status with Java Source: https://docs.dakota.xyz/documentation/destinations-recipients An example in Java using `java.net.http.HttpClient` to perform a GET request to the Dakota API for customer information. It demonstrates setting headers and building the HTTP request. ```java import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.URI; public class DakotaCustomerStatus { public static void main(String[] args) throws Exception { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.platform.dakota.xyz/customers/31Tgw0zSyDVo4Az66kmzUjMuwxx")) .header("X-API-Key", "your-api-key") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); } } ``` -------------------------------- ### List all onboarding applications Source: https://docs.dakota.xyz/api-reference/onboarding/list-all-onboarding-applications Returns a paginated list of your onboarding applications for both businesses and individuals. Use the `type` parameter to filter by application type, and `status` to filter by application status. Supports cursor-based pagination using `starting_after`, `ending_before`, and `limit` parameters. ```APIDOC ## GET /applications ### Description Returns a paginated list of your onboarding applications for both businesses and individuals. Use the `type` parameter to filter by application type, and `status` to filter by application status. Supports cursor-based pagination using `starting_after`, `ending_before`, and `limit` parameters. **Authentication:** Accepts API Key (X-API-Key header). ### Method GET ### Endpoint /applications ### Parameters #### Query Parameters - **type** (string) - Optional - Filter by application type (enum: business, individual) - **status** (string) - Optional - Filter by application status (enum: pending, submitted, completed) - **starting_after** (string) - Optional - Used for cursor-based pagination. Specifies the ID of the last item in the previous page. - **ending_before** (string) - Optional - Used for cursor-based pagination. Specifies the ID of the first item in the next page. - **limit** (integer) - Optional - Used for cursor-based pagination. Specifies the maximum number of items to return per page. #### Response ##### Success Response (200) - **data** (array) - List of applications. Each item contains `application_id`, `application_type`, `application_status`, `application_decision`, `business` (if applicable), `individuals` (if applicable), and `edd_id`. - **meta** (object) - Pagination metadata, including `has_more` and `next_url`. ##### Response Example { "data": [ { "application_id": "2hCjxJzUAW6JVRkZqaF9E0KpM3a", "application_type": "business", "application_status": "pending", "application_decision": "approved", "business": { "id": "2hCjxJzUAW6JVRkZqaF9E0KpM3a", "legal_name": "Acme Corp" }, "individuals": [ { "id": "2hCjxJzUAW6JVRkZqaF9E0KpM3b", "first_name": "John", "last_name": "Doe" } ], "edd_id": "2hCjxJzUAW6JVRkZqaF9E0KpM3c" } ], "meta": { "has_more": true, "next_url": "/applications?limit=10&starting_after=2hCjxJzUAW6JVRkZqaF9E0KpM3a" } } ``` -------------------------------- ### List Recipients using Rust Source: https://docs.dakota.xyz/documentation/destinations-recipients An asynchronous Rust example using `reqwest` to fetch recipients. This snippet shows how to configure headers, including the API key, for the GET request. Requires `customer_id` and `your-api-key`. ```rust use reqwest::header::{HeaderMap, HeaderValue}; #[tokio::main] async fn main() -> Result<(), Box> { let client = reqwest::Client::new(); let mut headers = HeaderMap::new(); headers.insert("X-API-Key", HeaderValue::from_static("your-api-key")); let response = client .get(&format!("https://api.platform.dakota.xyz/customers/{}/recipients", customer_id)) .headers(headers) .send() .await?; Ok(()) } ``` -------------------------------- ### List All Onboarding Applications Source: https://docs.dakota.xyz/api-reference/onboarding/list-all-onboarding-applications Retrieves a paginated list of all onboarding applications. Supports filtering by type and status, and cursor-based pagination. ```bash curl -X GET \ 'https://api.platform.sandbox.dakota.xyz/applications?type=business&status=approved&limit=10' \ -H 'accept: application/json' \ -H 'x-api-key: YOUR_API_KEY' ``` -------------------------------- ### List Recipients using JavaScript Source: https://docs.dakota.xyz/documentation/destinations-recipients Fetch recipient data using the JavaScript `fetch` API. This example demonstrates making a GET request and parsing the JSON response. Requires `customerId` and `your-api-key` to be set. ```javascript const response = await fetch(`https://api.platform.dakota.xyz/customers/${customerId}/recipients`, { headers: { 'X-API-Key': 'your-api-key' } }); const recipients = await response.json(); ``` -------------------------------- ### Register Customer with Idempotency Key Source: https://docs.dakota.xyz/documentation/testing This example demonstrates how to make a POST request to the customers endpoint, ensuring that the X-Idempotency-Key header is included. This header is required for all POST endpoints to ensure request idempotency. ```bash curl -X POST https://api.platform.sandbox.dakota.xyz/customers \ -H "X-API-Key: $DAKOTA_API_KEY" \ -H "X-Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{...}' ``` -------------------------------- ### Get an account Source: https://docs.dakota.xyz/llms.txt Get details for an account by ID. ```APIDOC ## GET /accounts/{account_id} ### Description Retrieves details for a specific account by its ID. ### Method GET ### Endpoint /accounts/{account_id} ### Parameters #### Path Parameters - **account_id** (string) - Required - The unique identifier of the account to retrieve. ``` -------------------------------- ### OpenAPI Specification Example Source: https://docs.dakota.xyz/api-reference/self-serve/list-prepaid-credit-ledger-entries This snippet shows an example of an OpenAPI specification, including an error message example for a routing number and security scheme definition. ```yaml example: Routing number must be exactly 9 digits code: type: string description: Machine-readable error code for this field. example: invalid_format securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-api-key ``` -------------------------------- ### Simulate Onboarding Transition Source: https://docs.dakota.xyz/api-reference/sandbox/simulate-an-onboarding-state-transition Initiates a state transition for an applicant's onboarding process. This is a POST request to the sandbox endpoint. ```APIDOC ## POST /sandbox/simulate/onboarding ### Description Simulates a state transition for an applicant's onboarding process. This endpoint is part of the sandbox environment and is not available in production. ### Method POST ### Endpoint /sandbox/simulate/onboarding ### Parameters #### Header Parameters - **x-idempotency-key** (string) - Required - Unique key to ensure request idempotency. If the same key is used within a certain time window, the original response will be returned. #### Request Body - **type** (string) - Required - The type of onboarding transition to simulate. Examples: `kyb_approve`, `kyb_reject`, `kyb_info_request`. - **applicant_id** (string) - Required - The onboarding application ID (from POST /applications). - **simulation_id** (string) - Required - Unique ID for this simulation (for idempotency and tracing). Min length: 1, Max length: 128. - **organization_id** (string) - Optional - Organization ID (for context; used for logging). - **reason_code** (string) - Optional - Reason code for reject/info_request transitions. - **info_request_fields** (array of strings) - Optional - Fields to request (for `*_info_request` types only). ### Request Example ```json { "type": "kyb_approve", "applicant_id": "01HABCDEFG1234567890XYZ", "simulation_id": "sim_kyb_approve_001" } ``` ### Response #### Success Response (200) - **simulation_id** (string) - The ID of the simulation. - **applicant_id** (string) - The ID of the applicant. - **previous_state** (string) - The KYB status before the transition. - **new_state** (string) - The KYB status after the transition. #### Response Example ```json { "simulation_id": "sim_kyb_approve_001", "applicant_id": "01HABCDEFG1234567890XYZ", "previous_state": "pending", "new_state": "approved" } ``` #### Error Responses - **400 Bad Request**: Invalid request. - **403 Forbidden**: Not available in production. - **404 Not Found**: Applicant not found. - **500 Internal Server Error**: Failed to apply transition. ``` -------------------------------- ### Create an Account Request Example Source: https://docs.dakota.xyz/api-reference/accounts/create-an-account Use this snippet to create a new account. It specifies the account type, capabilities, rail, and various destination and source details. Ensure you have valid authentication credentials and client context established. ```json { "account_type": "onramp", "capabilities": [ "ach", "fedwire" ], "rail": "ach", "crypto_destination_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi", "fiat_destination_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi", "destination_network_id": "ethereum-mainnet", "source_network_id": "ethereum-mainnet", "source_asset": "USDC", "destination_asset": "USDC", "return_address": { "network_id": "ethereum-mainnet", "crypto_address": "0x165cd37b4c644c2921454429e7f9358d18a45e14" }, "return_crypto_address": { "network_id": "ethereum-mainnet", "crypto_address": "0x165cd37b4c644c2921454429e7f9358d18a45e14" }, "developer_fee_bps": 50 } ```