Endpoint reference
Learn more about Pliro's API endpoints and how to use them.
This page lists all API endpoints sectioned by object type. You can set the following variables in your shell to allow copying and pasting the examples below:
Customers
Customers represent your publication's potential, current, and past subscribers.
The customer object
Properties
id
string
A unique identifier for this customer.
email
nullable string
The customer's email address.
name
nullable string
The customer's full name.
newsletter_slugs
array of strings
An array of slugs for newsletters the customer subscribe to.
plan_slug
nullable string
The slug of the plan the customer has an active subscription for.
List all customers
Parameters
limit
integer
The maximum number of customers to retrieve. Can range from 1 to 100 and defaults to 10.
page
string
Omit this parameter to request the first page. Use the next_page
value returned in a previous response to request the next page.
Returns
A page of customer objects or an error.
Create a customer
Parameters
email
string Required conditionally
The customer's email address. Required unless activation_code
is provided.
name
string
The customer's full name.
activation_code
string
A code that can be used to add an email address to this customer via the customer activation flow. Must be unique and at least eight characters long.
Returns
A customer object or an error.
Subscriptions
Subscriptions allow charging customers on a recurring basis.
The subscription object
Properties
id
string
A unique identifier for this subscription.
status
string
Possible values are active
and canceled
.
customer_id
string
The ID of the customer who owns this subscription.
plan_id
string
The ID of the plan that this subscription is for.
price_id
nullable string
The ID of the price that dictates the cost and recurrence interval of this subscription.
complimentary
boolean
Whether or not this subscription is provided to the customer free of charge. If complimentary
is true
, then price_id
will be null
.
Create a subscription
Parameters
customer_id
string Required
The ID of the customer who should own this subscription.
plan_id
string Required
The ID of the plan that this subscription should be for.
price_id
string Required conditionally
The ID of the price that should dictate the cost and recurrence interval of this subscription. Required unless complimentary
is true
.
complimentary
boolean
Whether or not this subscription should be provided to the customer free of charge. This parameter defaults to false
. If complimentary
is true
, then price_id
must be null
.
Returns
A subscription object or an error.
Cancel a subscription
Parameters
No parameters.
Returns
A subscription object or an error.
Last updated