# API Integration Overview

The API integration gives you full programmatic control over the Banxa checkout experience. You make server-to-server REST API calls to fetch quotes, create orders, and manage your integration. The checkout URL is returned in the order response, and you redirect or embed it from there.

## When to use API integration

Choose API integration if you need any of the following:

- **Webhooks** — real-time order status notifications pushed to your endpoint.
- **Quote UI** — show customers a price comparison within your own interface before they enter checkout.
- **KYC sharing** — pass verified customer identity data to Banxa to reduce checkout friction.
- **Order history** — look up past orders programmatically.
- **Programmatic control** — control which payment methods, currencies, and crypto assets are presented to each customer.


## API groups

The Banxa v2 API is organised into the following groups:

### Order API

Create buy and sell orders from your backend. Returns a checkout URL to redirect or embed for the customer.

`POST /{partnerRef}/v2/buy` · `POST /{partnerRef}/v2/sell`

### Quote API

Retrieve current pricing for any combination of crypto, fiat, and payment method. Call this before every order to ensure customers see accurate pricing.

`GET /{partnerRef}/v2/quotes/{orderType}`

### Payment Methods API

Retrieve the full list of payment methods available to your customers.

`GET /{partnerRef}/v2/payment-methods`

### Countries & Currencies API

Retrieve supported countries, fiat currencies, and cryptocurrencies.

`GET /{partnerRef}/v2/countries` · `GET /{partnerRef}/v2/fiats` · `GET /{partnerRef}/v2/crypto`

### Identity API

Share verified KYC data with Banxa before order creation to streamline the checkout experience for returning customers.

`POST /{partnerRef}/v2/identities/token/share`

## Typical buy (on-ramp) flow


```
1. GET  /v2/quotes          → Show customer a price
2. POST /v2/buy             → Create order, receive checkoutUrl
3. Redirect customer        → To checkoutUrl (redirect or iFrame)
4. Webhook notification     → Banxa POSTs order status to your endpoint
```

→ Detailed steps: [Get a Quote](/products/hosted-checkout/docs/api-integration/get-a-quote) · [Create Buy Order](/products/hosted-checkout/docs/api-integration/create-buy-order) · [Redirecting to Checkout](/products/hosted-checkout/docs/api-integration/redirecting-to-checkout)

## Typical sell (off-ramp) flow


```
1. GET  /v2/quotes          → Show customer a price
2. POST /v2/sell            → Create order, receive checkoutUrl
3. Redirect customer        → To checkoutUrl (redirect or iFrame)
4. Webhook notification     → Banxa POSTs order status to your endpoint
```

→ Detailed steps: [Create Sell Order](/products/hosted-checkout/docs/api-integration/create-sell-order)

## Authentication

All v2 API requests require your API key in the request header:


```
x-api-key: YOUR_API_KEY
```

The identity endpoint uses HMAC authentication. → See [Authentication & Environments](/products/hosted-checkout/docs/getting-started/authentication-and-environments).

## Base URLs

| Environment | Base URL |
|  --- | --- |
| Sandbox | `https://api.banxa-sandbox.com/{partnerRef}` |
| Production | `https://api.banxa.com/{partnerRef}` |