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

# API Reference

> Complete reference for the Transaction API

## Base URL

```
https://api.transaction.gg
```

## Authentication

Transaction API supports two authentication methods:

### JWT Authentication

Most endpoints require JWT authentication via the `Authorization` header:

```
Authorization: Bearer <jwt_token>
```

### API Key Authentication

Some endpoints use API key authentication:

```
Authorization: Bearer <api_key>
```

**API Key Types:**

* `public` - For payment creation (pk\_\*)
* `secret` - For merchant operations (sk\_\*)
* `any` - For webhook logs (either key type)

## Response Format

All responses follow this format:

```json theme={null}
{
  "success": boolean,
  "error": {
    "status": number,
    "code": string,
    "message": string
  } | null,
  "data": any | null
}
```

## Error Codes

| Code                       | Status | Description                       |
| -------------------------- | ------ | --------------------------------- |
| `UNAUTHORISED`             | 401    | Invalid or missing authentication |
| `NOT_FOUND`                | 404    | Resource not found                |
| `VALIDATION_INVALID`       | 400    | Invalid input data                |
| `INVALID_CREDENTIALS`      | 401    | Invalid login credentials         |
| `DUPLICATE_ENTRY`          | 400    | Duplicate resource detected       |
| `EMAIL_ALREADY_REGISTERED` | 400    | Email already exists              |
| `MERCHANT_NOT_FOUND`       | 404    | Merchant not found                |
| `PAYMENT_NOT_FOUND`        | 404    | Payment not found                 |
| `PRODUCT_NOT_FOUND`        | 404    | Product not found                 |
| `PRICE_NOT_FOUND`          | 404    | Price not found                   |
| `CUSTOMER_NOT_FOUND`       | 404    | Customer not found                |
| `INSUFFICIENT_BALANCE`     | 400    | Insufficient wallet balance       |
| `RATE_LIMITED`             | 429    | Too many requests                 |

## ID Formats

All entity IDs use prefixed formats:

| Entity   | Format              | Example                                | Length |
| -------- | ------------------- | -------------------------------------- | ------ |
| Customer | `cus_` + 16 chars   | `cus_V6n6SN2KnsIFCuQU`                 | 20     |
| Product  | `prod_` + 16 chars  | `prod_X4dUuzsMaruQ4UsX`                | 21     |
| Price    | `price_` + 16 chars | `price_i62wKFQ8sGnLxQ5G`               | 22     |
| Payment  | `pay_` + 16 chars   | `pay_abc123def456`                     | 19     |
| Merchant | UUID                | `a086a795-a411-4160-81e4-44e92dbc02bf` | 36     |

## Rate Limits

* **Authentication endpoints**: 5 requests per minute
* **Payment creation**: 10 requests per minute
* **Other endpoints**: 100 requests per minute

## Supported Currencies

**Fiat Currencies:** USD, EUR, GBP, CAD, AUD, JPY, CHF, CNY, INR, BRL, MXN, KRW, SGD, HKD, NOK, SEK, DKK, PLN, CZK, HUF, RON, BGN, HRK, ISK, LTL, LVL, EEK, TRY, RUB, UAH, BYN, KZT, AZN, GEL, AMD, KGS, TJS, UZS, MNT, KHR, LAK, VND, THB, MYR, IDR, PHP, SGD, BND, MMK, LKR, NPR, BDT, PKR, AFN, IRR, IQD, SYP, JOD, LBP, ILS, AED, QAR, BHD, KWD, OMR, YER, SAR, EGP, LYD, TND, DZD, MAD, ETB, KES, UGX, TZS, ZAR, BWP, SZL, LSL, NAD, ZMW, MWK, MZN, AOA, GMD, GHS, NGN, XOF, XAF, CDF, RWF, BIF, DJF, KMF, SCR, MUR, SLL, GNF, LRD, CVE, STN, SHP, FKP, GBP, EUR, USD

**Cryptocurrencies:** BTC, ETH, LTC, SOL
