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

> ## Agent Instructions
> OwnPay is licensed under AGPL-3.0 and is completely free - no licensing fees.
> Production docs URL: https://ownpay.org/docs - append .md to any page URL for clean markdown.
> OwnPay requires PHP 8.3+, MySQL/MariaDB, and Redis.
> MCP server available at https://ownpay.org/docs/mcp for programmatic documentation queries.
> Use root-relative links (e.g. /quickstart) for internal navigation - do NOT include /docs prefix.
> Plugin development: consult /developer/plugin-types/ pages for correct interfaces and manifests.

# Merchant API Reference - Payments, Refunds, and Webhooks

> Merchant REST API endpoints for creating payments, managing customers, issuing refunds, and configuring webhooks per brand in OwnPay.

The Merchant API is the primary API for integrating payment processing into your application. It provides endpoints for creating payments, managing customers, handling refunds, and configuring webhooks.

## Base URL

```text theme={null}
https://{brand_domain}/api/v1
```

## Authentication

All endpoints require a Bearer token in the Authorization header:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

API keys can have the following scopes:

* `read` - Read-only access to resources
* `write` - Create and modify resources
* `admin` - Full administrative access

## Key Endpoints

| Endpoint                    | Description                 |
| --------------------------- | --------------------------- |
| `POST /payment-intents`     | Create a new payment intent |
| `GET /payment-intents/{id}` | Retrieve a payment intent   |
| `POST /refunds`             | Create a refund             |
| `GET /customers`            | List customers              |
| `POST /webhooks`            | Register a webhook endpoint |
| `GET /health`               | System health check         |

## Quick Start

```bash theme={null}
curl -X POST https://pay.example.com/api/v1/payment-intents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1500,
    "currency": "USD",
    "description": "Order #1042"
  }'
```

<Note>
  Full API documentation is auto-generated from the OpenAPI specification. Browse the sidebar for detailed endpoint documentation.
</Note>


## Related topics

- [Retrieve Refund](/docs/api-reference/retrieve-refund.md)
- [List Refunds](/docs/api-reference/list-refunds.md)
- [Request Transaction Refund](/docs/api-reference/request-transaction-refund.md)
- [Node.js SDK - TypeScript-First Payment Integration](/docs/developer/integration/nodejs.md)
- [Initiate Payment Intent](/docs/api-reference/initiate-payment-intent.md)
