API

Introduction

This documentation aims to provide all the information you need to work with our API.

Base URL

https://upzelo.com

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can get your AppID and API key from the Developer section of Upzelo.

Customers

List all Customers

GET
api/customers

Lists the Customers that exist on Upzelo

Request

Requires authentication
Query Parameters
limit integer optional

How many results to fetch. (max 100)

cursor string optional

The cursor to use.

Example request
curl --request GET \
--get "https://upzelo.com/api/customers?limit=1&cursor=null" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/customers"
);

const params = {
    "limit": 1,
    "cursor": null,
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/customers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'limit' => 1,
            'cursor' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/customers'
params = {
  'limit': '1',
  'cursor': 'null',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    Unique ID for the Customer.

  • name string

    The name of the Customer. (nullable)

  • email string

    The email for the Customer. (nullable)

  • metadata object

    Metadata for the Customer. Key value array

  • pagination['has_more'] boolean

    If the response has more results or not.

  • pagination['next_cursor'] string

    The cursor for the next set of results. (nullable)

  • pagination['previous_cursor'] string

    The cursor for the previous set of results. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "customers": [
            {
                "id": "upz_cus_224148bd7eea86d3e443be21",
                "name": "Richard Hendricks",
                "email": "richard@piedpiper.com",
                "metadata": {
                    "signup-source": "facebook",
                    "marketing-campaign": "summer-2022"
                }
            }
        ]
    },
    "pagination": {
        "has_more": true,
        "next_cursor": "eyJjdXN0b21lcnMuaWQiOjEsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
        "previous_cursor": null
    }
}
                                                                        

Create a Customer

POST
api/customers

Request

Requires authentication

Body Parameters

  • id string|int

    The ID of the Customer. (your internal identifier)

  • name string optional

    The name of the Customer.

  • email string optional

    The email of the Customer.

  • description string optional

    A description for the Customer.

  • created string optional

    The date the Customer was created, Must be a valid date.

  • phone string optional

    Phone number for the Customer.

  • metadata object optional

    Metadata for the Customer. Key value array

Example request
curl --request POST \
"https://upzelo.com/api/customers" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"customer-1233\",
    \"name\": \"Richard Hendricks\",
    \"email\": \"richard@piedpiper.com\",
    \"description\": \"Created middle-out compression\",
    \"created\": \"2022-08-05T09:31:02\",
    \"phone\": \"+447123456789\",
    \"metadata\": {
        \"signup-source\": \"facebook\",
        \"marketing-campaign\": \"summer-2022\"
    }
}"
Example request
const url = new URL(
    "https://upzelo.com/api/customers"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "customer-1233",
    "name": "Richard Hendricks",
    "email": "richard@piedpiper.com",
    "description": "Created middle-out compression",
    "created": "2022-08-05T09:31:02",
    "phone": "+447123456789",
    "metadata": {
        "signup-source": "facebook",
        "marketing-campaign": "summer-2022"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://upzelo.com/api/customers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'customer-1233',
            'name' => 'Richard Hendricks',
            'email' => 'richard@piedpiper.com',
            'description' => 'Created middle-out compression',
            'created' => '2022-08-05T09:31:02',
            'phone' => '+447123456789',
            'metadata' => [
                'signup-source' => 'facebook',
                'marketing-campaign' => 'summer-2022',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/customers'
payload = {
    "id": "customer-1233",
    "name": "Richard Hendricks",
    "email": "richard@piedpiper.com",
    "description": "Created middle-out compression",
    "created": "2022-08-05T09:31:02",
    "phone": "+447123456789",
    "metadata": {
        "signup-source": "facebook",
        "marketing-campaign": "summer-2022"
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Response

  • id string

    Unique ID for the Customer.

  • name string

    The name of the Customer. (nullable)

  • email string

    The email for the Customer. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "customer": {
            "id": "upz_cus_f71131445dc150e5dfab1752",
            "name": "Richard Hendricks",
            "email": "richard@piedpiper.com",
            "metadata": {
                "signup-source": "facebook",
                "marketing-campaign": "summer-2022"
            }
        }
    }
}
                                                                        

Retrieve a single Customer

GET
api/customers/{id}

Request

Requires authentication
URL Parameters
id string optional

The Upzelo Customer ID

Example request
curl --request GET \
--get "https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528'
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Response

  • id string

    Unique ID for the Customer.

  • name string

    The name of the Customer. (nullable)

  • email string

    The email for the Customer. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "customer": {
            "id": "upz_cus_f71131445dc150e5dfab1752",
            "name": "Richard Hendricks",
            "email": "richard@piedpiper.com",
            "metadata": {
                "signup-source": "facebook",
                "marketing-campaign": "summer-2022"
            }
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_cus_doesntexist"
        }
    ]
}
                                                                        

Update a Customer

PUT
api/customers/{id}

Request

Requires authentication
URL Parameters
id string optional

The Upzelo Customer ID

Body Parameters

  • id string|int

    The ID of the Customer. (your internal identifier)

  • name string optional

    The name of the Customer.

  • email string optional

    The email of the Customer.

  • description string optional

    A description for the Customer.

  • created string optional

    The date the Customer was created, Must be a valid date.

  • phone string optional

    Phone number for the Customer.

  • metadata object optional

    Metadata for the Customer. Key value array

Example request
curl --request PUT \
"https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"customer-1233\",
    \"name\": \"Richard Hendricks\",
    \"email\": \"richard@piedpiper.com\",
    \"description\": \"Created middle-out compression\",
    \"created\": \"2022-08-05T09:31:02\",
    \"phone\": \"+447123456789\",
    \"metadata\": {
        \"signup-source\": \"facebook\",
        \"marketing-campaign\": \"summer-2022\"
    }
}"
Example request
const url = new URL(
    "https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "customer-1233",
    "name": "Richard Hendricks",
    "email": "richard@piedpiper.com",
    "description": "Created middle-out compression",
    "created": "2022-08-05T09:31:02",
    "phone": "+447123456789",
    "metadata": {
        "signup-source": "facebook",
        "marketing-campaign": "summer-2022"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'customer-1233',
            'name' => 'Richard Hendricks',
            'email' => 'richard@piedpiper.com',
            'description' => 'Created middle-out compression',
            'created' => '2022-08-05T09:31:02',
            'phone' => '+447123456789',
            'metadata' => [
                'signup-source' => 'facebook',
                'marketing-campaign' => 'summer-2022',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/customers/upz_cus_76061f3bfae24e02ef3e7528'
payload = {
    "id": "customer-1233",
    "name": "Richard Hendricks",
    "email": "richard@piedpiper.com",
    "description": "Created middle-out compression",
    "created": "2022-08-05T09:31:02",
    "phone": "+447123456789",
    "metadata": {
        "signup-source": "facebook",
        "marketing-campaign": "summer-2022"
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Response

  • id string

    Unique ID for the Customer.

  • name string

    The name of the Customer. (nullable)

  • email string

    The email for the Customer. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "customer": {
            "id": "upz_cus_f71131445dc150e5dfab1752",
            "name": "Richard Hendricks",
            "email": "richard@piedpiper.com",
            "metadata": {
                "signup-source": "facebook",
                "marketing-campaign": "summer-2022"
            }
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_cus_doesntexist"
        }
    ]
}
                                                                        

Discounts

List all Discounts

GET
api/discounts

Lists the Discounts that exist on Upzelo

Request

Requires authentication
Query Parameters
limit integer optional

How many results to fetch. (max 100)

cursor string optional

The cursor to use.

Example request
curl --request GET \
--get "https://upzelo.com/api/discounts?limit=1&cursor=null" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/discounts"
);

const params = {
    "limit": 1,
    "cursor": null,
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/discounts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'limit' => 1,
            'cursor' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/discounts'
params = {
  'limit': '1',
  'cursor': 'null',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    Unique ID for the Discount.

  • name string

    The name of the Discount. (nullable).

  • duration string

    The type of Discount duration. once|repeating|forever.

  • duration_in_months integer

    The duration of the Discount in months, null unless duration is repeating.

  • amount_off integer

    The amount off in cent value (100 = $1 for example), null if percent_off is set.

  • percent_off integer

    The amount off in percent, null if amount_off is set.

  • currency string

    ISO4217 formatted currency code. Example: GBP

  • pagination['has_more'] boolean

    If the response has more results or not.

  • pagination['next_cursor'] string

    The cursor for the next set of results. (nullable)

  • pagination['previous_cursor'] string

    The cursor for the previous set of results. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "discounts": [
            {
                "id": null,
                "name": "Upzelo template money offer",
                "duration": "once",
                "duration_in_months": null,
                "amount_off": 1000,
                "percent_off": null,
                "currency": "GBP"
            }
        ]
    },
    "pagination": {
        "has_more": true,
        "next_cursor": "eyJjb3Vwb25zLmlkIjo3LCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
        "previous_cursor": null
    }
}
                                                                        

Create a Discount

POST
api/discounts

Request

Requires authentication

Body Parameters

  • id int|string

    The ID of the Discount (your internal identifier)

  • name string

    The name for the Discount

  • duration string

    Must be one of once, forever, or repeating.

  • duration_in_months string optional

    This field is required when duration is repeating.

  • amount_off integer optional

    This field is required when percent_off is null.

  • percent_off integer optional

    This field is required when amount_off is null.

  • currency string

    ISO4217 formatted currency code.

Example request
curl --request POST \
"https://upzelo.com/api/discounts" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"maxime\",
    \"name\": \"aliquid\",
    \"duration\": \"repeating\",
    \"amount_off\": 3,
    \"percent_off\": 8,
    \"currency\": \"GBP\"
}"
Example request
const url = new URL(
    "https://upzelo.com/api/discounts"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "maxime",
    "name": "aliquid",
    "duration": "repeating",
    "amount_off": 3,
    "percent_off": 8,
    "currency": "GBP"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://upzelo.com/api/discounts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'maxime',
            'name' => 'aliquid',
            'duration' => 'repeating',
            'amount_off' => 3,
            'percent_off' => 8,
            'currency' => 'GBP',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/discounts'
payload = {
    "id": "maxime",
    "name": "aliquid",
    "duration": "repeating",
    "amount_off": 3,
    "percent_off": 8,
    "currency": "GBP"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Response

  • id string

    Unique ID for the Discount.

  • name string

    The name of the Discount. (nullable).

  • duration string

    The type of Discount duration. (once|repeating|forever).

  • duration_in_months integer

    The duration of the Discount in months, null unless duration is repeating.

  • amount_off integer

    The amount off in cent value (100 = $1 for example), null if percent_off is set.

  • percent_off integer

    The amount off in percent, null if amount_off is set.

  • currency string

    ISO4217 formatted currency code. Example: GBP

Example response
200
                                                    
                                                                                        {
    "data": {
        "discount": {
            "id": "upz_dis_64ed0421075ef4bbd0e4bcbd",
            "name": "Test Discount",
            "duration": "forever",
            "duration_in_months": null,
            "amount_off": 1,
            "percent_off": null,
            "currency": "gbp"
        }
    }
}
                                                                        

Retrieve a single Discount

GET
api/discounts/{id}

Request

Requires authentication
URL Parameters
id string optional

The Upzelo Discount id

Example request
curl --request GET \
--get "https://upzelo.com/api/discounts/upz_dis_64ed0421075ef4bbd0e4bcbd" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/discounts/upz_dis_64ed0421075ef4bbd0e4bcbd"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/discounts/upz_dis_64ed0421075ef4bbd0e4bcbd',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/discounts/upz_dis_64ed0421075ef4bbd0e4bcbd'
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Response

  • id string

    Unique ID for the Discount.

  • name string

    The name of the Discount. (nullable).

  • duration string

    The type of Discount duration. (once|repeating|forever).

  • duration_in_months integer

    The duration of the Discount in months, null unless duration is repeating.

  • amount_off integer

    The amount off in cent value (100 = $1 for example), null if percent_off is set.

  • percent_off integer

    The amount off in percent, null if amount_off is set.

  • currency string

    ISO4217 formatted currency code. Example: GBP

Example response
200
                                                    
                                                                                        {
    "data": {
        "discount": {
            "id": "upz_dis_64ed0421075ef4bbd0e4bcbd",
            "name": "Test Discount",
            "duration": "forever",
            "duration_in_months": null,
            "amount_off": 1,
            "percent_off": null,
            "currency": "gbp"
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_dis_doesntexist"
        }
    ]
}
                                                                        

Invoices

List all Invoices

GET
api/invoices

Request

Requires authentication
Query Parameters
limit integer optional

How many results to fetch. (max 100)

cursor string optional

The cursor to use. (nullable)

include string optional

The entities to include. (line_items,subscription,customer) (nullable)

Example request
curl --request GET \
--get "https://upzelo.com/api/invoices?limit=1&cursor=null&include=rerum" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/invoices"
);

const params = {
    "limit": 1,
    "cursor": null,
    "include": "rerum",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/invoices',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'limit' => 1,
            'cursor' => null,
            'include' => 'rerum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/invoices'
params = {
  'limit': '1',
  'cursor': 'null',
  'include': 'rerum',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    The unique ID for the Invoice.

  • total integer

    The Invoice total.

  • created integer

    The Invoice creation time.

  • period_start integer

    The start period for the Invoice.

  • period_end integer

    The end period for the Invoice.

  • currency string

    ISO4217 formatted currency code.

  • customer_id string

    The ID of the Customer the Invoice belongs to.

  • subscription_id string

    The ID of the Subscription the Invoice belongs to.

  • pagination['has_more'] boolean

    If the response has more results or not.

  • pagination['next_cursor'] string

    The cursor for the next set of results. (nullable)

  • pagination['previous_cursor'] string

    The cursor for the previous set of results. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "invoices": [
            {
                "id": "upz_inv_eb40633bea97dbeff689909e",
                "total": 10000,
                "created": 1586044800,
                "period_start": 1586044800,
                "period_end": 1588636800,
                "currency": "GBP",
                "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
                "subscription_id": "upz_sub_3256ab69668e527ac869532f"
            }
        ]
    },
    "pagination": {
        "has_more": true,
        "next_cursor": "eyJpbnZvaWNlcy5pZCI6NTMsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
        "previous_cursor": null
    }
}
                                                                        

Create an Invoice

POST
api/invoices

Request

Requires authentication

Body Parameters

  • id int|string

    The ID of the Invoice. (your internal identifier)

  • total integer

    The cent value of the Invoice. (100 = $1 for example)

  • created string

    Must be a valid date.

  • period_start string

    Must be a valid date.

  • period_end string

    Must be a valid date.

  • currency string

    ISO4217 formatted currency code.

  • customer_id string

    The Upzelo Customer ID that the Invoice belongs to.

  • subscription_id string

    The Upzelo Subscription ID that the Invoice belongs to.

  • discounts string[] optional

    An array of Upzelo Discount ID's that are used on this Invoice.

    • line_items object[] optional
      line_items[].id string
      line_items[].amount integer
      line_items[].currency string
      line_items[].quantity integer
      line_items[].discount_amount integer
      line_items[].tax_amount integer
      line_items[].period_start string

      Must be a valid date.

      line_items[].period_end string

      Must be a valid date.

      line_items[].interval string

      Must be one of day, week, month, or year.

      line_items[].interval_count integer
      line_items[].type string

      Must be one of recurring or one_time.

Example request
curl --request POST \
"https://upzelo.com/api/invoices" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"in\",
    \"total\": 6,
    \"created\": \"2022-08-16T11:38:47\",
    \"period_start\": \"2022-08-16T11:38:47\",
    \"period_end\": \"2022-08-16T11:38:47\",
    \"currency\": \"GBP\",
    \"customer_id\": \"modi\",
    \"subscription_id\": \"alias\",
    \"discounts\": [
        \"aut\"
    ],
    \"line_items\": [
        {
            \"id\": \"iure\",
            \"amount\": 8,
            \"currency\": \"aut\",
            \"quantity\": 6,
            \"discount_amount\": 18,
            \"tax_amount\": 18,
            \"period_start\": \"2022-08-16T11:38:47\",
            \"period_end\": \"2022-08-16T11:38:47\",
            \"interval\": \"week\",
            \"interval_count\": 20,
            \"type\": \"one_time\"
        }
    ]
}"
Example request
const url = new URL(
    "https://upzelo.com/api/invoices"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "in",
    "total": 6,
    "created": "2022-08-16T11:38:47",
    "period_start": "2022-08-16T11:38:47",
    "period_end": "2022-08-16T11:38:47",
    "currency": "GBP",
    "customer_id": "modi",
    "subscription_id": "alias",
    "discounts": [
        "aut"
    ],
    "line_items": [
        {
            "id": "iure",
            "amount": 8,
            "currency": "aut",
            "quantity": 6,
            "discount_amount": 18,
            "tax_amount": 18,
            "period_start": "2022-08-16T11:38:47",
            "period_end": "2022-08-16T11:38:47",
            "interval": "week",
            "interval_count": 20,
            "type": "one_time"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://upzelo.com/api/invoices',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'in',
            'total' => 6,
            'created' => '2022-08-16T11:38:47',
            'period_start' => '2022-08-16T11:38:47',
            'period_end' => '2022-08-16T11:38:47',
            'currency' => 'GBP',
            'customer_id' => 'modi',
            'subscription_id' => 'alias',
            'discounts' => [
                'aut',
            ],
            'line_items' => [
                [
                    'id' => 'iure',
                    'amount' => 8,
                    'currency' => 'aut',
                    'quantity' => 6,
                    'discount_amount' => 18,
                    'tax_amount' => 18,
                    'period_start' => '2022-08-16T11:38:47',
                    'period_end' => '2022-08-16T11:38:47',
                    'interval' => 'week',
                    'interval_count' => 20,
                    'type' => 'one_time',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/invoices'
payload = {
    "id": "in",
    "total": 6,
    "created": "2022-08-16T11:38:47",
    "period_start": "2022-08-16T11:38:47",
    "period_end": "2022-08-16T11:38:47",
    "currency": "GBP",
    "customer_id": "modi",
    "subscription_id": "alias",
    "discounts": [
        "aut"
    ],
    "line_items": [
        {
            "id": "iure",
            "amount": 8,
            "currency": "aut",
            "quantity": 6,
            "discount_amount": 18,
            "tax_amount": 18,
            "period_start": "2022-08-16T11:38:47",
            "period_end": "2022-08-16T11:38:47",
            "interval": "week",
            "interval_count": 20,
            "type": "one_time"
        }
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Response

  • id string

    The unique ID for the Invoice.

  • total integer

    The Invoice total.

  • created integer

    The Invoice creation time.

  • period_start integer

    The start period for the Invoice.

  • period_end integer

    The end period for the Invoice.

  • currency string

    ISO4217 formatted currency code.

  • customer_id string

    The ID of the Customer the Invoice belongs to.

  • subscription_id string

    The ID of the Subscription the Invoice belongs to.

Example response
200
                                                    
                                                                                        {
    "data": {
        "invoice": {
            "id": "upz_inv_e4a7a78ef8627d991b50ea1b",
            "total": 10000,
            "created": 1586044800,
            "period_start": 1586044800,
            "period_end": 1588636800,
            "currency": "GBP",
            "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
            "subscription_id": "upz_sub_3256ab69668e527ac869532f"
        }
    }
}
                                                                        

Fetch a single Invoice

GET
api/invoices/{id}

Request

Requires authentication
URL Parameters
id integer

The ID of the invoice.

Query Parameters
include string optional

The entities to include (line_items,subscription,customer) (nullable)

Example request
curl --request GET \
--get "https://upzelo.com/api/invoices/1?include=culpa" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/invoices/1"
);

const params = {
    "include": "culpa",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/invoices/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'include' => 'culpa',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/invoices/1'
params = {
  'include': 'culpa',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    The unique ID for the Invoice.

  • total integer

    The Invoice total.

  • created integer

    The Invoice creation time.

  • period_start integer

    The start period for the Invoice.

  • period_end integer

    The end period for the Invoice.

  • currency string

    ISO4217 formatted currency code.

  • customer_id string

    The ID of the Customer the Invoice belongs to.

  • subscription_id string

    The ID of the Subscription the Invoice belongs to.

Example response
200
                                                    
                                                                                        {
    "data": {
        "invoice": {
            "id": "upz_inv_e4a7a78ef8627d991b50ea1b",
            "total": 10000,
            "created": 1586044800,
            "period_start": 1586044800,
            "period_end": 1588636800,
            "currency": "GBP",
            "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
            "subscription_id": "upz_sub_3256ab69668e527ac869532f"
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_inv_doesntexist"
        }
    ]
}
                                                                        

Prices

List all Prices

GET
api/prices

Request

Requires authentication
Query Parameters
limit integer optional

How many results to fetch. (max 100)

cursor string optional

The cursor to use.

Example request
curl --request GET \
--get "https://upzelo.com/api/prices?limit=1&cursor=null" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/prices"
);

const params = {
    "limit": 1,
    "cursor": null,
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/prices',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'limit' => 1,
            'cursor' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/prices'
params = {
  'limit': '1',
  'cursor': 'null',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    The unique ID for the Price.

  • title string

    The name of the Price.

  • currency string

    ISO4217 formatted currency code. Example: GBP

  • price integer

    The cent value of the Price. (100 = $1 for example)

  • tiered boolean

    If the Price is tiered or not.

  • type string

    The type of Price.

  • interval string

    The interval of the Price.

  • interval_count integer

    The interval.

Example response
200
                                                    
                                                                                        {
    "data": {
        "prices": [
            {
                "id": "upz_prc_a8292ec8135580e2392fb015",
                "title": null,
                "currency": "gbp",
                "price": 1000,
                "tiered": false,
                "type": "recurring",
                "interval": "month",
                "interval_count": 1
            }
        ]
    },
    "pagination": {
        "has_more": true,
        "next_cursor": "eyJwcmljZXMuaWQiOjUxLCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
        "previous_cursor": null
    }
}
                                                                        

Create a Price

POST
api/prices

Request

Requires authentication

Body Parameters

  • id string|int

    The ID of the Price. (your internal ID)

  • product_id string

    The Upzelo Product ID that the Price belongs to.

  • title string optional

    The name of the Price.

  • currency string

    ISO4217 formatted currency code.

  • price integer

    The Price in cent value. (100 = $1)

  • type string

    The type of Price, must be one of recurring or one_time.

  • interval string optional

    The interval of the Price. Must be one of day, week, month, year. Required if type is recurring.

  • interval_count integer optional

    The interval count for the Price. Required if type is recurring

Example request
curl --request POST \
"https://upzelo.com/api/prices" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"price-1233\",
    \"product_id\": \"upz_prod_12374\",
    \"title\": \"middle-out-gbp\",
    \"currency\": \"GBP\",
    \"price\": 4900,
    \"type\": \"recurring\",
    \"interval\": \"month\",
    \"interval_count\": 1
}"
Example request
const url = new URL(
    "https://upzelo.com/api/prices"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "price-1233",
    "product_id": "upz_prod_12374",
    "title": "middle-out-gbp",
    "currency": "GBP",
    "price": 4900,
    "type": "recurring",
    "interval": "month",
    "interval_count": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://upzelo.com/api/prices',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'price-1233',
            'product_id' => 'upz_prod_12374',
            'title' => 'middle-out-gbp',
            'currency' => 'GBP',
            'price' => 4900,
            'type' => 'recurring',
            'interval' => 'month',
            'interval_count' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/prices'
payload = {
    "id": "price-1233",
    "product_id": "upz_prod_12374",
    "title": "middle-out-gbp",
    "currency": "GBP",
    "price": 4900,
    "type": "recurring",
    "interval": "month",
    "interval_count": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Response

  • id string

    The unique ID for the Price.

  • title string

    The name of the Price.

  • currency string

    The currency of the Price.

  • price integer

    The cent value of the Price. (100 = $1 for example)

  • tiered boolean

    If the Price is tiered or not.

  • type string

    The type of Price.

  • interval string

    The interval of the Price.

  • interval_count integer

    The interval.

Example response
200
                                                    
                                                                                        {
    "data": {
        "price": {
            "id": "upz_prc_96f6081bdd7a8cec76b91d70",
            "title": null,
            "currency": "gbp",
            "price": 1000,
            "tiered": false,
            "type": "recurring",
            "interval": "month",
            "interval_count": 1
        }
    }
}
                                                                        

Retrieve a single Price

GET
api/prices/{id}

Request

Requires authentication
URL Parameters
id string optional

The Upzelo Price ID.

Example request
curl --request GET \
--get "https://upzelo.com/api/prices/upz_prc_96f6081bdd7a8cec76b91d70" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/prices/upz_prc_96f6081bdd7a8cec76b91d70"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/prices/upz_prc_96f6081bdd7a8cec76b91d70',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/prices/upz_prc_96f6081bdd7a8cec76b91d70'
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Response

  • id string

    The unique ID for the Price.

  • title string

    The name of the Price.

  • currency string

    The currency of the Price.

  • price integer

    The cent value of the Price. (100 = $1 for example)

  • tiered boolean

    If the Price is tiered or not.

  • type string

    The type of Price.

  • interval string

    The interval of the Price.

  • interval_count integer

    The interval.

Example response
200
                                                    
                                                                                        {
    "data": {
        "price": {
            "id": "upz_prc_96f6081bdd7a8cec76b91d70",
            "title": null,
            "currency": "gbp",
            "price": 1000,
            "tiered": false,
            "type": "recurring",
            "interval": "month",
            "interval_count": 1
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_prc_doesntexist"
        }
    ]
}
                                                                        

Products

List all Products

GET
api/products

Request

Requires authentication
Query Parameters
limit integer optional

How many results to fetch. (max 100)

cursor string optional

The cursor to use

include string optional

The entities to include. (prices) (nullable)

Example request
curl --request GET \
--get "https://upzelo.com/api/products?limit=1&cursor=null&include=voluptatem" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/products"
);

const params = {
    "limit": 1,
    "cursor": null,
    "include": "voluptatem",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/products',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'limit' => 1,
            'cursor' => null,
            'include' => 'voluptatem',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/products'
params = {
  'limit': '1',
  'cursor': 'null',
  'include': 'voluptatem',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    Unique ID for the Product.

  • name string

    The name of the Product.

  • pagination['has_more'] boolean

    If the response has more results or not.

  • pagination['next_cursor'] string

    The cursor for the next set of results. (nullable)

  • pagination['previous_cursor'] string

    The cursor for the previous set of results. (nullable)

Example response
200
                                                    
                                                                                        {
    "data": {
        "products": [
            {
                "id": "upz_prod_cff859051a9c67c58b9f196",
                "name": "Test Product"
            }
        ]
    },
    "pagination": {
        "has_more": true,
        "next_cursor": "eyJwcm9kdWN0cy5pZCI6MTYsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
        "previous_cursor": null
    }
}
                                                                        

Create a Product

POST
api/products

Request

Requires authentication

Body Parameters

  • id string|int

    The ID of the Product. (your internal ID)

  • name string

    The name of the Product.

Example request
curl --request POST \
"https://upzelo.com/api/products" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"product-1233\",
    \"name\": \"Middle out compression\"
}"
Example request
const url = new URL(
    "https://upzelo.com/api/products"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "product-1233",
    "name": "Middle out compression"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://upzelo.com/api/products',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'product-1233',
            'name' => 'Middle out compression',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/products'
payload = {
    "id": "product-1233",
    "name": "Middle out compression"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Response

  • id string

    Unique ID for the Product.

  • name string

    The name of the Product.

Example response
200
                                                    
                                                                                        {
    "data": {
        "product": {
            "id": "upz_prod_d500626f627e3d4a9023486",
            "name": "Test Product"
        }
    }
}
                                                                        

Retrieve a single Product

GET
api/products/{id}

Request

Requires authentication
URL Parameters
id integer

The ID of the product.

Query Parameters
include string optional

The entities to include. (prices) (nullable)

Example request
curl --request GET \
--get "https://upzelo.com/api/products/1?include=tempore" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/products/1"
);

const params = {
    "include": "tempore",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/products/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'include' => 'tempore',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/products/1'
params = {
  'include': 'tempore',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    Unique ID for the Product.

  • name string

    The name of the Product.

Example response
200
                                                    
                                                                                        {
    "data": {
        "product": {
            "id": "upz_prod_d500626f627e3d4a9023486",
            "name": "Test Product"
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_prod_doesntexist"
        }
    ]
}
                                                                        

Subscriptions

List all Subscriptions

GET
api/subscriptions

Request

Requires authentication
Query Parameters
limit integer optional

How many results to fetch. (max 100)

cursor string optional

The cursor to use.

Example request
curl --request GET \
--get "https://upzelo.com/api/subscriptions?limit=1&cursor=null" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/subscriptions"
);

const params = {
    "limit": 1,
    "cursor": null,
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/subscriptions',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'query' => [
            'limit' => 1,
            'cursor' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/subscriptions'
params = {
  'limit': '1',
  'cursor': 'null',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Response

  • id string

    The unique ID of the Subscription.

  • customer_id string

    The unique Upzelo ID of the Customer.

  • current_period_start integer

    The start of the current billing period.

  • current_period_end integer

    The end of the current billing period.

  • cancel_at_period_end boolean

    If the Subscription is due to cancel.

  • status string

    The status of the Subscription.

  • start_date integer

    The start date of the Subscription.

  • canceled_at ?int

    The date the Subscription was canceled.

Example response
200
                                                    
                                                                                        {
    "data": {
        "subscriptions": [
            {
                "id": "upz_sub_3256ab69668e527ac869532f",
                "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
                "current_period_start": 1659182400,
                "current_period_end": 1661860800,
                "cancel_at_period_end": false,
                "status": "active",
                "start_date": 1659182400,
                "canceled_at": null
            }
        ]
    },
    "pagination": {
        "has_more": true,
        "next_cursor": "eyJzdWJzY3JpcHRpb25zLmlkIjoyNCwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
        "previous_cursor": null
    }
}
                                                                        

Create a Subscription

POST
api/subscriptions

Request

Requires authentication

Body Parameters

  • id int|string

    The ID for the Subscription (Your internal ID).

  • customer_id string optional

    The Upzelo Customer id the Subscription belongs to.

    • customer object optional
      customer.id string optional
      customer.name string optional
      customer.email string optional

      Must be a valid email address.

      customer.description string optional
      customer.created string optional

      Must be a valid date.

      customer.phone string optional
  • current_period_start string optional

    The date that the current billing period starts.

  • current_period_end string optional

    The date that the current billing period ends.

  • cancel_at_period_end boolean

    Whether the Subscription cancels at the end of the current period.

  • status string

    The status of the Subscription. Must be one of: incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid.

  • start_date string

    The date that the Subscription started.

  • canceled_at ?string optional

    The date that the Subscription was canceled.

  • created string optional

    The date the Subscription was created.

  • price_id string

    The Upzelo Price ID that the Customer is Subscribing to.

  • metadata object optional

    Metadata for the Subscription. (Key value array format)

Example request
curl --request POST \
"https://upzelo.com/api/subscriptions" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"id\": \"subscription-1233\",
    \"customer_id\": \"upz_cus_123344\",
    \"customer\": {
        \"id\": \"ut\",
        \"name\": \"debitis\",
        \"email\": \"kunde.abbie@example.org\",
        \"description\": \"a\",
        \"created\": \"2022-08-16T11:38:47\",
        \"phone\": \"ut\"
    },
    \"current_period_start\": \"ipsa\",
    \"current_period_end\": \"aliquam\",
    \"cancel_at_period_end\": false,
    \"status\": \"minima\",
    \"start_date\": \"maxime\",
    \"canceled_at\": \"autem\",
    \"created\": \"quo\",
    \"price_id\": \"sed\",
    \"metadata\": []
}"
Example request
const url = new URL(
    "https://upzelo.com/api/subscriptions"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "id": "subscription-1233",
    "customer_id": "upz_cus_123344",
    "customer": {
        "id": "ut",
        "name": "debitis",
        "email": "kunde.abbie@example.org",
        "description": "a",
        "created": "2022-08-16T11:38:47",
        "phone": "ut"
    },
    "current_period_start": "ipsa",
    "current_period_end": "aliquam",
    "cancel_at_period_end": false,
    "status": "minima",
    "start_date": "maxime",
    "canceled_at": "autem",
    "created": "quo",
    "price_id": "sed",
    "metadata": []
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://upzelo.com/api/subscriptions',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'id' => 'subscription-1233',
            'customer_id' => 'upz_cus_123344',
            'customer' => [
                'id' => 'ut',
                'name' => 'debitis',
                'email' => 'kunde.abbie@example.org',
                'description' => 'a',
                'created' => '2022-08-16T11:38:47',
                'phone' => 'ut',
            ],
            'current_period_start' => 'ipsa',
            'current_period_end' => 'aliquam',
            'cancel_at_period_end' => false,
            'status' => 'minima',
            'start_date' => 'maxime',
            'canceled_at' => 'autem',
            'created' => 'quo',
            'price_id' => 'sed',
            'metadata' => [],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/subscriptions'
payload = {
    "id": "subscription-1233",
    "customer_id": "upz_cus_123344",
    "customer": {
        "id": "ut",
        "name": "debitis",
        "email": "kunde.abbie@example.org",
        "description": "a",
        "created": "2022-08-16T11:38:47",
        "phone": "ut"
    },
    "current_period_start": "ipsa",
    "current_period_end": "aliquam",
    "cancel_at_period_end": false,
    "status": "minima",
    "start_date": "maxime",
    "canceled_at": "autem",
    "created": "quo",
    "price_id": "sed",
    "metadata": []
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Response

  • id string

    The unique ID of the Subscription.

  • customer_id string

    The unique Upzelo ID of the Customer.

  • current_period_start integer

    The start of the current billing period.

  • current_period_end integer

    The end of the current billing period.

  • cancel_at_period_end boolean

    If the Subscription is due to cancel.

  • status string

    The status of the Subscription.

  • start_date integer

    The start date of the Subscription.

  • canceled_at ?int

    The date the Subscription was canceled.

Example response
200
                                                    
                                                                                        {
    "data": {
        "subscription": {
            "id": "upz_sub_15178e786c1d72e393555e69",
            "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
            "current_period_start": 1659182400,
            "current_period_end": 1661860800,
            "cancel_at_period_end": false,
            "status": "active",
            "start_date": 1659182400,
            "canceled_at": null
        }
    }
}
                                                                        

Retrieve a single Subscription

GET
api/subscriptions/{id}

Request

Requires authentication
URL Parameters
id integer

The ID of the subscription.

Example request
curl --request GET \
--get "https://upzelo.com/api/subscriptions/1" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}"
Example request
const url = new URL(
    "https://upzelo.com/api/subscriptions/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://upzelo.com/api/subscriptions/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/subscriptions/1'
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('GET', url, headers=headers)
response.json()

Response

  • id string

    The unique ID of the Subscription.

  • customer_id string

    The unique Upzelo ID of the Customer.

  • current_period_start integer

    The start of the current billing period.

  • current_period_end integer

    The end of the current billing period.

  • cancel_at_period_end boolean

    If the Subscription is due to cancel.

  • status string

    The status of the Subscription.

  • start_date integer

    The start date of the Subscription.

  • canceled_at ?int

    The date the Subscription was canceled.

Example response
200
                                                    
                                                                                        {
    "data": {
        "subscription": {
            "id": "upz_sub_15178e786c1d72e393555e69",
            "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
            "current_period_start": 1659182400,
            "current_period_end": 1661860800,
            "cancel_at_period_end": false,
            "status": "active",
            "start_date": 1659182400,
            "canceled_at": null
        }
    }
}
                                                                        
404
                                                    
                                                                                        {
    "errors": [
        {
            "code": 404,
            "title": "Entity not found",
            "detail": "We cannot find an entity with an id matching upz_sub_doesntexist"
        }
    ]
}
                                                                        

Update a Subscription

PUT
api/subscriptions/{id}

Request

Requires authentication
URL Parameters
id string optional

The Upzelo Subscription ID.

Body Parameters

  • current_period_start string optional

    The date that the current billing period starts.

  • current_period_end string optional

    The date that the current billing period ends.

  • cancel_at_period_end boolean

    Whether the Subscription cancels at the end of the current period.

  • status string

    The status of the Subscription. Must be one of: incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid.

  • canceled_at ?string optional

    The date that the Subscription was canceled.

  • metadata object optional

    Metadata for the Subscription (Key value array format)

Example request
curl --request PUT \
"https://upzelo.com/api/subscriptions/upz_sub_7d061f3bfaf25e06e7327439" \
    --header "Authorization: Bearer {YOUR_API_KEY}" \
        --header "Content-Type: application/json" \
        --header "Accept: application/json" \
        --header "x-app-id: {YOUR_APP_ID}" \
                --data "{
    \"current_period_start\": \"occaecati\",
    \"current_period_end\": \"labore\",
    \"cancel_at_period_end\": false,
    \"status\": \"nemo\",
    \"canceled_at\": \"ducimus\",
    \"metadata\": []
}"
Example request
const url = new URL(
    "https://upzelo.com/api/subscriptions/upz_sub_7d061f3bfaf25e06e7327439"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "x-app-id": "{YOUR_APP_ID}",
};

let body = {
    "current_period_start": "occaecati",
    "current_period_end": "labore",
    "cancel_at_period_end": false,
    "status": "nemo",
    "canceled_at": "ducimus",
    "metadata": []
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
Example request
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://upzelo.com/api/subscriptions/upz_sub_7d061f3bfaf25e06e7327439',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'x-app-id' => '{YOUR_APP_ID}',
        ],
        'json' => [
            'current_period_start' => 'occaecati',
            'current_period_end' => 'labore',
            'cancel_at_period_end' => false,
            'status' => 'nemo',
            'canceled_at' => 'ducimus',
            'metadata' => [],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example request
import requests
import json

url = 'https://upzelo.com/api/subscriptions/upz_sub_7d061f3bfaf25e06e7327439'
payload = {
    "current_period_start": "occaecati",
    "current_period_end": "labore",
    "cancel_at_period_end": false,
    "status": "nemo",
    "canceled_at": "ducimus",
    "metadata": []
}
headers = {
  'Authorization': 'Bearer {YOUR_API_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-app-id': '{YOUR_APP_ID}'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Response

  • id string

    The unique ID of the Subscription.

  • customer_id string

    The unique Upzelo ID of the Customer.

  • current_period_start integer

    The start of the current billing period.

  • current_period_end integer

    The end of the current billing period.

  • cancel_at_period_end boolean

    If the Subscription is due to cancel.

  • status string

    The status of the Subscription.

  • start_date integer

    The start date of the Subscription.

  • canceled_at ?int

    The date the Subscription was canceled.

Example response
200
                                                    
                                                                                        {
    "data": {
        "subscription": {
            "id": "upz_sub_15178e786c1d72e393555e69",
            "customer_id": "upz_cus_76061f3bfae24e02ef3e7528",
            "current_period_start": 1659182400,
            "current_period_end": 1661860800,
            "cancel_at_period_end": false,
            "status": "active",
            "start_date": 1659182400,
            "canceled_at": null
        }
    }
}