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

# Partnero REST API reference

> Complete API reference for integrating affiliate tracking, partner management, and referral programs. RESTful API with JSON responses.

The Partnero REST API lets you programmatically manage your affiliate and referral programs. Use it to create partners, track customers, record transactions, and automate your partner operations.

## Base URL

All API requests should use the following base URL:

```
https://api.partnero.com/v1/
```

## Authentication

All API requests require authentication using a Bearer token in the `Authorization` header:

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

See [Authentication](/api-reference/authentication) for details on obtaining and using API keys.

## Response Format

All responses are returned in JSON format with a `status` field indicating success (1) or failure.

```json theme={null}
{
  "data": { ... },
  "status": 1
}
```

## HTTP Status Codes

Partnero returns standard HTTP response codes:

| Code | Name                  | Description                       |
| ---- | --------------------- | --------------------------------- |
| 200  | OK                    | Request was successful            |
| 201  | Created               | Resource was created successfully |
| 400  | Bad Request           | Invalid request parameters        |
| 401  | Unauthorized          | Invalid or missing API token      |
| 403  | Forbidden             | Action not allowed for this token |
| 404  | Not Found             | Resource does not exist           |
| 422  | Unprocessable Entity  | Validation error                  |
| 429  | Too Many Requests     | Rate limit exceeded               |
| 500  | Internal Server Error | Server error                      |

## Rate Limiting

API requests are rate-limited to ensure fair usage. If you exceed the rate limit, you'll receive a `429 Too Many Requests` response.

## Pagination

List endpoints support pagination with the following query parameters:

| Parameter | Type    | Default | Description                        |
| --------- | ------- | ------- | ---------------------------------- |
| `limit`   | integer | 15      | Number of results per page (1-250) |
| `page`    | integer | 1       | Page number                        |

Paginated responses include `links` and `meta` objects:

```json theme={null}
{
  "data": [...],
  "links": {
    "first": "https://api.partnero.com/v1/partners?page=1",
    "last": null,
    "prev": null,
    "next": "https://api.partnero.com/v1/partners?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "path": "https://api.partnero.com/v1/partners",
    "per_page": 15,
    "to": 15
  },
  "status": 1
}
```

## Quick Start

<Steps>
  <Step title="Get your API key">
    1. Go to your program in [Partnero](https://app.partnero.com)
    2. Navigate to **Integration → API**
    3. Click **Create API key**
    4. Copy the generated key (you won't be able to see it again)
  </Step>

  <Step title="Make your first request">
    Test your connection by listing partners:

    ```bash theme={null}
    curl --location 'https://api.partnero.com/v1/partners' \
      --header 'Authorization: Bearer YOUR_API_KEY'
    ```
  </Step>

  <Step title="Explore the API">
    Browse the sidebar to explore all available endpoints.
  </Step>
</Steps>

## Error Handling

Error responses include a message explaining what went wrong:

```json theme={null}
{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email field is required."]
  },
  "status": 0
}
```

## Need Help?

<CardGroup cols={2}>
  <Card title="JavaScript SDK" icon="js" href="/guides/tracking/javascript-tracking">
    Client-side tracking integration
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api-reference/webhooks/overview">
    Real-time event notifications
  </Card>
</CardGroup>

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What's the difference between partners and customers?">
    **Partners** are affiliates who promote your product and earn commissions. **Customers** are end-users who sign up through partner referral links. Partners bring in customers, and you pay partners commissions on customer purchases.
  </Accordion>

  <Accordion title="Do I need the API if I use payment integrations?">
    Partially. Payment integrations (Stripe, Paddle, Shopify) automatically track **transactions**, but you still need to create **customers** using the API or [JavaScript SDK](/guides/tracking/javascript-tracking). The customer links sign-ups to the referring partner, and the integration handles sales tracking from there.
  </Accordion>

  <Accordion title="How do I test the API?">
    Use your API key from the Partnero dashboard. All endpoints work the same in test and production—there's no separate sandbox environment. We recommend creating a test program for development.
  </Accordion>
</AccordionGroup>
