# 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](https://docs.defi.b2binpay.com/user-guide/account#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](https://docs.defi.b2binpay.com/user-guide/account#view-credit-balance-and-pricing) and [Top up the credit balance](https://docs.defi.b2binpay.com/user-guide/account#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](https://docs.defi.b2binpay.com/api-guide/account) 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`.
