> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to Chipi Pay API

> REST API for creating self-custodial wallets, executing gasless transactions, and purchasing services on Starknet.

## Base URL

```bash theme={null}
https://api.chipipay.com/v1
```

## Authentication

All API requests require two headers:

| Header | Value | Description |
| - | - | - |
| `x-api-key` | `pk_xxxx` | Your Chipi public API key |
| `Authorization` | `Bearer sk_prod_xxxx` | Your secret key (server-side) or user JWT (client-side) |

```bash theme={null}
curl -H "x-api-key: pk_xxxx" \
     -H "Authorization: Bearer sk_prod_xxxx" \
     https://api.chipipay.com/v1/skus
```

For detailed instructions on obtaining your API keys, see the [API Quickstart](/sdk/api/quickstart).

## API Endpoints

### Wallets

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/chipi-wallets/by-user`](/sdk/api/endpoint/get-wallet) | Get wallet by user ID |
| `GET` | [`/chipi-wallets/token-balance`](/sdk/api/endpoint/get-token-balance) | Get token balance |
| `PATCH` | [`/chipi-wallets/update-encryption-details`](/sdk/api/endpoint/update-wallet-encryption) | Update wallet encryption |

### Transactions

| Method | Endpoint | Description |
| - | - | - |
| `POST` | [`/transactions/record-send`](/sdk/api/endpoint/record-send-transaction) | Record a send transaction |
| `GET` | [`/transactions/transaction-list`](/sdk/api/endpoint/get-transaction-list) | Get transaction history |

### Services (SKUs)

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/skus`](/sdk/api/endpoint/get-skus) | List available services |
| `GET` | [`/skus/{id}`](/sdk/api/endpoint/get-sku) | Get a single service |
| `POST` | [`/sku-purchases`](/sdk/api/endpoint/buy-sku) | Purchase a service |
| `GET` | [`/sku-purchases/{id}`](/sdk/api/endpoint/get-sku-purchase) | Get purchase status |

### Exchanges

| Method | Endpoint | Description |
| - | - | - |
| `GET` | [`/exchanges/usd-amount`](/sdk/api/endpoint/get-usd-amount) | Convert currency to USD |

## Notifications and Webhooks

When you purchase a service, you'll receive status updates via webhooks or email at the URL and email address you configured in your dashboard.

### Steps to set up your webhook

* For setting up webhooks and email notifications, see the [API Quickstart](/sdk/api/quickstart).

## Rate Limits

> [!WARNING]
>
> API requests are limited to 100 requests per minute per API key.

## Error Handling

The API uses standard HTTP status codes to indicate success or failure:

* `200` - Success
* `400` - Bad Request
* `401` - Unauthorized
* `404` - Not Found
* `429` - Rate Limited
* `500` - Internal Server Error

Error responses include a JSON object with an `error` and `message` field:

```json theme={null}
{
  "error": "invalid_request",
  "message": "The request was invalid"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.