# Resell

## Introduction

This tutorial will teach you how to manage your clients and their pricing plans through the uberall API.

## Common Endpoints

| Method | Endpoint | Description |
|  --- | --- | --- |
| POST | `/businesses` | Creates a new business |
| GET | `/businesses` | Search and filter businesses |
| GET | `/productplans` | Gets a list of available product plans |
| PATCH | `/businesses/$id` | Edit details of the given business |


## Businesses/accounts

You can use POST `/businesses` and GET `/businesses` to create new businesses and retrieve them. See "Business/accounts" in the “Sync” tutorial if you need more explanation. Use the `identifier` field to input your internal identifier. You can then query by your internal identifier like in the following example.


```bash
curl -X GET -H "Content-Type: application/json" -H "privateKey: $privateKey" -H "Cache-Control: no-cache" 'https://sandbox.uberall.com/api/businesses/?identifier=bus_0000001'
```

## Product plans

Use GET `/productplans` to get the list of available product plans for your accounts.


```bash
curl -X GET 'https://sandbox.uberall.com/api/productplans' -H 'privateKey:$privateKey' -H 'Cache-Control: no-cache'
```

This is what a productPlan looks like.


```json
{
  "id": 489,
  "name": "basic",
  "features": [
    "SUPPORT",
    "AUTOMATION",
    "INBOX",
    "UPGRADE",
  ],
  "updatedDirectories": [
    "GOOGLE"
  ],
  "countryPrice": [
    {
      "country": "DE",
      "price": 1500
    }
  ]
}
```

## Upgrading/downgrading

Upgrading or downgrading works simply by changing the product plan on the business. You can do by using PATCH /businesses/$id request.


```bash
curl -H "Content-Type: application/json" 'https://dev.uberall.com/api/businesses/30899' -X PATCH -d '{
    "productPlan": $planID
}' -H 'privateKey:$privateKey' -H 'Cache-Control: no-cache'
```