# API overview

The **B2BINPAY DeFi API** allows you to integrate B2BINPAY DeFi app features into your own systems.

You can manage accounts, create invoices, monitor transactions, and inspect callbacks using a unified REST interface.

{% hint style="info" %}
Before you start working with the B2BINPAY DeFi API, you need to generate API keys required for request authentication.

Refer to [Configure a callback secret and API keys](/user-guide/account.md#configure-a-callback-secret-and-api-keys) for step-by-step instructions.
{% endhint %}

{% hint style="warning" %}
B2BINPAY DeFi charges credits for using API: access the **Credits** page to view the detailed pricing.

Refer to [View credit balance and pricing](/user-guide/credits.md#view-credit-balance-and-pricing) and [Top up the credit balance](/user-guide/credits.md#top-up-the-credit-balance) for step-by-step instructions.
{% endhint %}

## General information

* **Base URL**: `https://api.defi.b2binpay.com/api/v1`.
* **Format**: All endpoints use JSON for requests and responses.

## Required headers

* `x-api-key: {Your API key}` — required for all endpoints.
* `Accept: application/json` — required for all endpoints.
* `Content-Type: application/json` — required for requests with a body.

## HTTP response codes

* `2xx` — success (`200 OK`, `201 Created`).
* `400` — validation error (`Invalid input`).
* `401` — `Invalid or missing token` or `Invalid or expired token`.
* `403` — permission issues (for example, *You are not a member of this account or deployment*).
* `404` — resource not found (transaction, invoice, account, etc.).
* `409` — conflicts (for example, invoice with the same tracking ID already exists).
* `503` — service unavailable (for example, failing health check).

## Deployment ID

To obtain the `deploymentId` parameter value which is used in many API calls, use the `GET [base]/api/v1/accounts/{accountId}` method. Refer to [Account methods](/api-guide/account.md) for details.

## Date-time values

All date-time values are specified as per [ISO 8601-1:2019](https://www.iso.org/standard/70907.html), with milliseconds precision and timezone included: `YYYY-MM-DDThh:mm:ss[.SSSSSS]±hh:mm`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defi.b2binpay.com/api-guide/api-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
