DjaoApp API Reference

Once you have registered an account on djaodjin.com and created a site, the following Application Programmable Interface (API) will be available on your site will to provide profiles, billing and service access control - i.e. the administrative features required to run Software, as-a-Service, on the Internet.

Most API end points require authentication. DjaoApp supports three methods of authentication:

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Browse the API endpoints by ...


By workflows

Auth & credentials

Billing

Metrics

Profile

Roles & rules

Subscriptions

Themes

This section contains APIs to upload new templates for all pages, from login to checkout, or reset to the default theme.


By roles

Visitors

Users

Subscribers

Providers

Broker


By datamodels

Users

Profiles

This section contains APIs related to billing profiles.

A billing, sometimes called an organization profile, has no login credentials. It typically represents a legal entity that can be charged for service. Users can operate on billing profiles (ex: subscribe the organization to a plan) though roles they hold on an billing profile.

Depending on its relationship within a workflow, a billing profile is referred as either a subscriber, a provider or the broker.

Roles

This section contains APIs related to roles.

A role is a relationship between a user and a billing or personal profile - shorten to profile later on - that grant the user certain permissions to act on the profile. Permissions are not directly tied to the Role object, but rather to an abstract representation of the role called a RoleDescription.

It is not uncommon in casual conversation to use role to mean RoleDescription when talking about permissions as the end result is about the same. None-the-less, the workflows involved to grant a role to a user, such as opt-ins and double opt-ins can only be set on the RoleDescription, affecting all role objects using that RoleDescription.

Plans

This section contains APIs related to subscription plans.

Billing profiles subscribe to one or many provider plans, hence becoming subscribers of that provider.

Subscriptions

Carts

This section contains APIs related to cart items.

In order to pay for a subscription, a billing profile will add plans to a cart, then checkout that cart, entering a payment method in the process.

Charges

This section contains APIs related to charges.

Payments for subscriptions results in charges on the payment processor.

Coupons

Transactions

Site


Alphabetical

API version

GET /api

Retrieves version of the API

Responses
version
string

Version of the API being used

Examples

curl https://livedemo.djaoapp.com/api
responds
{
  "version": "2020-10-05"
}

Searches profile and user accounts

GET /api/accounts/

Returns a list of 5 candidate profiles or user accounts based of a search criteria (q).

The API is designed to be used in typeahead input fields. As such it only returns results when the number of candidates is less than 5.

If you need to list all profiles, please see Lists billing profiles

The queryset can be further refined by a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used in pages for the support team to quickly locate an account. For example, it is used within the HTML provider dashboard page as present in the default theme.

Query parameters
start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name

o
string

sort by full_name, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the results

results
array

items in the queryset

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts/?q=xi
responds
{
  "count": 1,
  "results": [
    {
      "slug": "xia",
      "full_name": "Xia Lee",
      "email": "xia@localhost.localdomain",
      "created_at": "2016-01-14T23:16:55Z",
      "printable_name": "Xia Lee"
    }
  ]
}

Searches profiles

GET /api/accounts/profiles/

Returns a list of 5 candidate profiles based of a search criteria (q).

The API is designed to be used in typeahead input fields. As such it only returns results when the number of candidates is less than 5.

If you need to list all profiles, please see Lists billing profiles

The queryset can be further refined by a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML connected profiles page as present in the default theme.

Query parameters
start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name

o
string

sort by full_name, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the results

results
array

items in the queryset

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts/profiles/?q=xi
responds
{
  "count": 1,
  "results": [
    {
      "slug": "xia",
      "full_name": "Xia Lee",
      "email": "xia@localhost.localdomain",
      "created_at": "2016-01-14T23:16:55Z",
      "printable_name": "Xia Lee"
    }
  ]
}

Searches users

GET /api/accounts/users/

Returns a list of 5 candidate users based of a search criteria (q).

The API is designed to be used in typeahead input fields. As such it only returns results when the number of candidates is less than 5.

If you need to list all users, please see Lists user accounts

The queryset can be further refined by a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML profile role page as present in the default theme.

Query parameters
start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

o
string

sort by first_name, last_name, email, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in first_name, last_name, email

Responses
count
integer

Total number of items in the results

results
array

items in the queryset

slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts/users/?q=ali
responds
{
  "count": 1,
  "results": [
    {
      "slug": "alice",
      "created_at": "2014-01-01T00:00:00Z",
      "email": "alice@djaodjin.com",
      "full_name": "Alice Cooper",
      "printable_name": "Alice Cooper",
      "username": "alice"
    }
  ]
}

Authenticates a user

POST /api/auth/

Returns a JSON Web Token that can be used in HTTP requests that require authentication.

The API is typically used within an HTML login page as present in the default theme.

Request body
username
string required

Username, e-mail address or phone number to identify the account

password
string required

Secret password for the account

code
integer

One-time code. This field will be checked against an expected code when multi-factor authentication (MFA) is enabled.

Responses
token
string

Token used to authenticate user on every HTTP request

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"username": "donny", "password": "yoyo"}' https://livedemo.djaoapp.com/api/auth/
responds
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImRvbm55IiwiZW1haWwiOiJzbWlyb2xvKzRAZGphb2RqaW4uY29tIiwiZnVsbF9uYW1lIjoiRG9ubnkgQ29vcGVyIiwiZXhwIjoxNTI5NjU4NzEwfQ.F2y1iwj5NHlImmPfSff6IHLN7sUXpBFmX0qjCbFTe6A"
}

Retrieves an activation key

GET /api/auth/activate/{verification_key}/

This API is typically used to pre-populate a registration form when a user was invited to the site by another user.

The response is usually presented in an HTML activate page as present in the default theme.

Responses
slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

Examples

curl https://livedemo.djaoapp.com/api/auth/activate/16793aa72a4c7ae94b50b20c2eca52df5b0fe2c6/
responds
{
  "slug": "joe1",
  "username": "joe1",
  "email": "joe1@localhost.localdomain",
  "full_name": "Joe Act",
  "printable_name": "Joe Act",
  "created_at": "2020-05-30T00:00:00Z"
}

Activates a user

POST /api/auth/activate/{verification_key}/

Activates a new user and returns a JSON Web Token that can subsequently be used to authenticate the new user in HTTP requests.

Request body
username
string

Username to identify the account

new_password
string

Password with which a user can authenticate with the service

full_name
string

Full name (effectively first name followed by last name)

Responses
token
string

Token used to authenticate user on every HTTP request

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"username": "joe1", "new_password": "yoyo", "full_name": "Joe Card1"}' https://livedemo.djaoapp.com/api/auth/activate/16793aa72a4c7ae94b50b20c2eca52df5b0fe2c6/
responds
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6    ImpvZTEiLCJlbWFpbCI6ImpvZSsxQGRqYW9kamluLmNvbSIsImZ1bGxfbmFtZ    SI6IkpvZSAgQ2FyZDEiLCJleHAiOjE1Mjk2NTUyMjR9.GFxjU5AvcCQbVylF1P    JwcBUUMECj8AKxsHtRHUSypco"
}

Logs a user out

POST /api/auth/logout/

Removes all cookies associated with the session.

This API endpoint is only useful when the user is using Cookie-based authentication. Tokens expire; they cannot be revoked.

Responses

200

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/auth/logout/

Sends a password reset link

POST /api/auth/recover/

The user is uniquely identified by her email address.

The API is typically used within an HTML recover credentials page as present in the default theme.

Request body
email
string required

Email or phone number to recover the account

Responses
email
string

Email or phone number to recover the account

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"email": "xia@localhost.localdomain"}' https://livedemo.djaoapp.com/api/auth/recover/
responds
{
  "email": "xia@localhost.localdomain"
}

Registers a user

POST /api/auth/register/

Creates a new user and returns a JSON Web Token that can subsequently be used to authenticate the new user in HTTP requests.

The API is typically used within an HTML register page as present in the default theme.

Request body
slug
string

Username

username
string

Username to identify the account

email
string

Primary e-mail to contact user

phone
string

Primary phone number to contact user

full_name
string required

Full name (effectively first name followed by last name)

lang
string

Preferred communication language

password
string

Password with which a user can authenticate with the service

organization_name
string

Organization name that owns the billing, registered with the user as profile manager

street_address
string

Street address for the billing profile

locality
string

City/Town for the billing profile

region
string

State/Province/County for the billing profile

postal_code
string

Zip/Postal Code for the billing profile

country
string

Country for the billing profile

type
string

Type of the accounts being registered

terms-of-use
string

Terms Of Use

security
string

Security Policy

Responses
token
string

Token used to authenticate user on every HTTP request

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"username": "joe1", "password": "yoyo", "email": "joe+1@example.com", "full_name": "Joe Card1"}' https://livedemo.djaoapp.com/api/auth/register/
responds
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImpvZTEiLCJlbWFpbCI6ImpvZSsxQGRqYW9kamluLmNvbSIsImZ1bGxfbmFtZSI6IkpvZSAgQ2FyZDEiLCJleHAiOjE1Mjk2NTUyMjR9.GFxjU5AvcCQbVylF1PJwcBUUMECj8AKxsHtRHUSypco"
}

Confirms a password reset

POST /api/auth/reset/{uidb64}/{token}/

Sets a new password after a recover password was triggered and returns a JSON Web Token that can subsequently be used to authenticate the new user in HTTP requests.

The API is typically used within an HTML reset password page as present in the default theme.

Request body
new_password
string required

New password for the user referenced in the URL

Responses
token
string

Token used to authenticate user on every HTTP request

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"new_password": "yoyo", "new_password2": "yoyo"}' https://livedemo.djaoapp.com/api/auth/reset/0123456789abcef0123456789abcef/abc123/
responds
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImpvZTEiLCJlbWFpbCI6ImpvZSsxQGRqYW9kamluLmNvbSIsImZ1bGxfbmFtZSI6IkpvZSAgQ2FyZDEiLCJleHAiOjE1Mjk2NTUyMjR9.GFxjU5AvcCQbVylF1PJwcBUUMECj8AKxsHtRHUSypco"
}

Refreshes a JSON Web Token

POST /api/auth/tokens/

Refreshes a JSON Web Token by verifying the token and creating a new one that expires further in the future.

The authenticated user and the user associated to the token should be identical.

Request body
token
string required

Token used to authenticate user on every HTTP request

Responses
token
string

Token used to authenticate user on every HTTP request

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImRvbm55IiwiZW1haWwiOiJzbWlyb2xvKzRAZGphb2RqaW4uY29tIiwiZnVsbF9uYW1lIjoiRG9ubnkgQ29vcGVyIiwiZXhwIjoxNTI5NjU4NzEwfQ.F2y1iwj5NHlImmPfSff6IHLN7sUXpBFmX0qjCbFTe6A"}' https://livedemo.djaoapp.com/api/auth/tokens/
responds
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImRvbm55IiwiZW1haWwiOiJzbWlyb2xvKzRAZGphb2RqaW4uY29tIiwiZnVsbF9uYW1lIjoiRG9ubnkgQ29vcGVyIiwiZXhwIjoxNTI5Njk1NjA1fQ.-uuZb8R68jWw1Tc9FJocOWe1KHFklRffXbH0Rg6d_0c"
}

Verifies a JSON Web Token

POST /api/auth/tokens/verify/

The authenticated user and the user associated to the token should be identical.

Request body
token
string required

Token used to authenticate user on every HTTP request

Responses
token
string

Token used to authenticate user on every HTTP request

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImRvbm55IiwiZW1haWwiOiJzbWlyb2xvKzRAZGphb2RqaW4uY29tIiwiZnVsbF9uYW1lIjoiRG9ubnkgQ29vcGVyIiwiZXhwIjoxNTI5NjU4NzEwfQ.F2y1iwj5NHlImmPfSff6IHLN7sUXpBFmX0qjCbFTe6A"}' https://livedemo.djaoapp.com/api/auth/tokens/verify/
responds
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImRvbm55IiwiZW1haWwiOiJzbWlyb2xvKzRAZGphb2RqaW4uY29tIiwiZnVsbF9uYW1lIjoiRG9ubnkgQ29vcGVyIiwiZXhwIjoxNTI5NjU4NzEwfQ.F2y1iwj5NHlImmPfSff6IHLN7sUXpBFmX0qjCbFTe6A"
}

Lists processor charges

GET /api/billing/charges/

Returns a list of 25 charges that were created on the payment processor (ex: Stripe).

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

o
string

sort by description, amount, Full name, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in description, processor_key, customer__full_name

Responses
balance_amount
integer

The sum of all record amounts (in unit)

balance_unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

amount
integer

Total amount in currency unit

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

readable_amount
string

Amount and unit in a commonly accepted readable format

description
string

Description for the charge as appears on billing statements

last4
string

Last 4 digits of the credit card used

exp_date
string

Expiration date of the credit card used

processor_key
string

Unique identifier returned by the payment processor

state
string

Current state (i.e. created, done, failed, disputed)

detail
string

Feedback for the user in plain text

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/charges/?start_at=2015-07-05T07:00:00.000Z\&o=date\&ot=desc
responds
{
  "count": 1,
  "balance_amount": "112120",
  "balance_unit": "usd",
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2016-01-01T00:00:02Z",
      "readable_amount": "$1121.20",
      "amount": 112120,
      "unit": "usd",
      "description": "Charge for subscription to cowork open-space",
      "last4": "1234",
      "exp_date": "2016-06-01",
      "processor_key": "ch_XAb124EF",
      "state": "DONE"
    }
  ]
}

Retrieves a processor charge

GET /api/billing/charges/{organization}/

Pass through to the processor and returns details about a Charge.

Responses
created_at
string

Date/time of creation (in ISO format)

amount
integer

Total amount in currency unit

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

readable_amount
string

Amount and unit in a commonly accepted readable format

description
string

Description for the charge as appears on billing statements

last4
string

Last 4 digits of the credit card used

exp_date
string

Expiration date of the credit card used

processor_key
string

Unique identifier returned by the payment processor

state
string

Current state (i.e. created, done, failed, disputed)

detail
string

Feedback for the user in plain text

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/charges/ch_XAb124EF/
responds
{
  "created_at": "2016-01-01T00:00:01Z",
  "readable_amount": "$1121.20",
  "amount": 112120,
  "unit": "usd",
  "description": "Charge for subscription to cowork open-space",
  "last4": "1234",
  "exp_date": "2016-06-01",
  "processor_key": "ch_XAb124EF",
  "state": "DONE"
}

Re-sends a charge receipt

POST /api/billing/charges/{organization}/email/

Email the charge receipt to the customer email address on file.

The service sends a duplicate e-mail receipt for charge ch_XAb124EF to the e-mail address of the customer, i.e. joe@localhost.localdomain.

Responses
charge_id
string

Charge identifier (i.e. matches the URL {charge} parameter)

email
string

E-mail address to which the receipt was sent.

detail
string

Feedback for the user in plain text

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/billing/charges/ch_XAb124EF/email/
responds
{
  "charge_id": "ch_XAb124EF",
  "email": "joe@localhost.localdomain"
}

Refunds a processor charge

POST /api/billing/charges/{organization}/refund/

Partially or totally refund all or a subset of line items on a Charge.

Request body
lines
array required

Line items in a charge to be refunded

num
integer required

Line item index counting from zero.

refunded_amount
integer

The amount to refund cannot be higher than the amount of the line item minus the total amount already refunded on that line item.

Responses
created_at
string

Date/time of creation (in ISO format)

amount
integer

Total amount in currency unit

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

readable_amount
string

Amount and unit in a commonly accepted readable format

description
string

Description for the charge as appears on billing statements

last4
string

Last 4 digits of the credit card used

exp_date
string

Expiration date of the credit card used

processor_key
string

Unique identifier returned by the payment processor

state
string

Current state (i.e. created, done, failed, disputed)

detail
string

Feedback for the user in plain text

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"lines": [{"num": 0, "refunded_amount": 4000}, {"num": 1, "refunded_amount": 82120}]}' https://livedemo.djaoapp.com/api/billing/charges/ch_XAb124EF/refund/
responds
{
  "created_at": "2016-01-01T00:00:05Z",
  "readable_amount": "$1121.20",
  "amount": 112120,
  "unit": "usd",
  "description": "Charge for subscription to cowork open-space",
  "last4": "1234",
  "exp_date": "2016-06-01",
  "processor_key": "ch_XAb124EF",
  "state": "DONE"
}

Lists ledger transactions

GET /api/billing/transactions/

Returns a list of 25 transactions.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in descr, orig_organization__full_name, dest_organization__full_name

o
string

sort by description, amount, dest_organization, dest_account, orig_organization, orig_account, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
start_at
string

Start of the date range for which the balance was computed

ends_at
string

End of the date range for which the balance was computed

balance_amount
integer

Balance of all transactions in cents (i.e. 100ths) of unit

balance_unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/transactions/?start_at=2015-07-05T07:00:00.000Z\&o=date\&ot=desc
responds
{
  "start_at": "2015-07-05T07:00:00.000Z",
  "ends_at": "2017-03-30T18:10:12.962859Z",
  "balance_amount": 11000,
  "balance_unit": "usd",
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2017-02-01T00:00:00Z",
      "description": "Charge for 4 periods",
      "amount": "($356.00)",
      "is_debit": true,
      "orig_account": "Liability",
      "orig_organization": "xia",
      "orig_amount": 112120,
      "orig_unit": "usd",
      "dest_account": "Funds",
      "dest_organization": "stripe",
      "dest_amount": 112120,
      "dest_unit": "usd"
    }
  ]
}

Retrieves a customer balance

GET /api/billing/{organization}/balance/

Get the statement balance due for an organization.

Responses
balance_amount
integer

balance of all transactions in cents (i.e. 100ths) of unit

balance_unit
integer

three-letter ISO 4217 code for currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/xia/balance/
responds
{
  "balance_amount": "1200",
  "balance_unit": "usd"
}

Cancels a balance due

DELETE /api/billing/{organization}/balance/

Cancel the balance due by profile {organization}. This will create a transaction for this balance cancellation. A provider manager can use this endpoint to cancel balance dues that is known impossible to be recovered (e.g. an external bank or credit card company act).

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/billing/xia/balance/

Retrieves a payout account

GET /api/billing/{organization}/bank/

Pass through that calls the payment processor API to retrieve some details about the deposit account associated to a provider (if that information is available through the payment processor backend API).

This API does not trigger payment of a subscriber to a provider. Checkout of a subscription cart is done either through the HTML page or API end point.

Responses
bank_name
string

Name of the deposit account

last4
string

Last 4 characters of the deposit account identifier

balance_amount
integer

Amount available to transfer to the provider deposit account

balance_unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/cowork/bank/
responds
{
  "bank_name": "Stripe Test Bank",
  "last4": "***-htrTZ",
  "balance_amount": 0,
  "balance_unit": "usd"
}

Retrieves a payment method

GET /api/billing/{organization}/card/

Pass through to the payment processor to retrieve some details about the payment method (ex: credit card) associated to a subscriber.

When you wish to update the payment method on file through a Strong Customer Authentication (SCA) workflow, the payment processor will require a token generated by the server. That token can be retrieved in the processor.STRIPE_INTENT_SECRET field when the API is called with ?update=1 query parameters.

The API is typically used within an HTML update payment method page as present in the default theme.

Responses
processor
object

Keys to authenticate the client with the payment processor

STRIPE_PUB_KEY
string

Processor public key (Stripe)

STRIPE_INTENT_SECRET
string

PaymentIntent or SetupIntent secret for SCA (Stripe)

STRIPE_ACCOUNT
string

Connected account identifier (Stripe)

last4
string

Last 4 digits of the credit card on file

exp_date
string

Expiration date of the credit card on file

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/xia/card/
responds
{
  "last4": "1234",
  "exp_date": "12/2019"
}

Updates a payment method

PUT /api/billing/{organization}/card/

Pass through to the payment processor to update some details about the payment method (ex: credit card) associated to a subscriber.

The API is typically used within an HTML update payment method page as present in the default theme.

Request body
token
string required

Processor token to retrieve the payment method

full_name
string

Full name

email
string

E-mail address for the account

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

Responses
processor
object

Keys to authenticate the client with the payment processor

STRIPE_PUB_KEY
string

Processor public key (Stripe)

STRIPE_INTENT_SECRET
string

PaymentIntent or SetupIntent secret for SCA (Stripe)

STRIPE_ACCOUNT
string

Connected account identifier (Stripe)

last4
string

Last 4 digits of the credit card on file

exp_date
string

Expiration date of the credit card on file

Examples

curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"token": "xyz"}' https://livedemo.djaoapp.com/api/billing/xia/card/
responds
{
  "last4": "1234",
  "exp_date": "12/2019"
}

Deletes a payment method

DELETE /api/billing/{organization}/card/

Pass through to the payment processor to remove the payment method (ex: credit card) associated to a subscriber.

The API is typically used within an HTML update payment method page as present in the default theme.

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/billing/xia/card/

Retrieves a cart for checkout

GET /api/billing/{organization}/checkout/

Get a list indexed by plans of items that will be charged (lines) and options that could be charged instead.

In many subscription businesses, it is possible to buy multiple period in advance at a discount. The options reflects that.

The API is typically used within an HTML checkout page as present in the default theme.

Responses
processor
object

Keys to authenticate the client with the payment processor

STRIPE_PUB_KEY
string

Processor public key (Stripe)

STRIPE_INTENT_SECRET
string

PaymentIntent or SetupIntent secret for SCA (Stripe)

STRIPE_ACCOUNT
string

Connected account identifier (Stripe)

results
array

Items that will be charged

subscription
object

Subscription lines and options refer to.

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

lines
array

Line items to charge on checkout.

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

options
array

Options to replace line items.

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/xia/checkout/
responds
{
  "results": [
    {
      "subscription": {
        "created_at": "2016-06-21T23:24:09.242925Z",
        "ends_at": "2016-10-21T23:24:09.229768Z",
        "description": null,
        "organization": {
          "slug": "xia",
          "full_name": "Xia",
          "printable_name": "Xia",
          "created_at": "2012-08-14T23:16:55Z",
          "email": "xia@localhost.localdomain"
        },
        "plan": {
          "slug": "basic",
          "title": "Basic",
          "description": "Basic Plan",
          "is_active": true,
          "setup_amount": 0,
          "period_amount": 2000,
          "period_type": "monthly",
          "app_url": "/app/"
        },
        "auto_renew": true
      },
      "lines": [
        {
          "created_at": "2016-06-21T23:42:13.863739Z",
          "description": "Subscription to basic until 2016/11/21 (1 month)",
          "amount": "$20.00",
          "is_debit": false,
          "orig_account": "Receivable",
          "orig_organization": "cowork",
          "orig_amount": 2000,
          "orig_unit": "usd",
          "dest_account": "Payable",
          "dest_organization": "xia",
          "dest_amount": 2000,
          "dest_unit": "usd"
        }
      ],
      "options": []
    }
  ]
}

Checkouts a cart

POST /api/billing/{organization}/checkout/

Places an order for the subscription items in the cart and creates a Charge on the {organization} payment card.

If the charge fails a balance is due, to be collected later.

The cart is manipulated through various API endpoints:

The API is typically used within an HTML checkout page as present in the default theme.

Request body
items
array

List of indices, one per subscription that has multiple advance discount options

option
integer required

selected plan option during checkout

remember_card
boolean

attaches the payment method to the profile when true

processor_token
string

one-time token generated by the processorfrom the payment card.

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

Responses
created_at
string

Date/time of creation (in ISO format)

amount
integer

Total amount in currency unit

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

readable_amount
string

Amount and unit in a commonly accepted readable format

description
string

Description for the charge as appears on billing statements

last4
string

Last 4 digits of the credit card used

exp_date
string

Expiration date of the credit card used

processor_key
string

Unique identifier returned by the payment processor

state
string

Current state (i.e. created, done, failed, disputed)

detail
string

Feedback for the user in plain text

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"remember_card": true, "processor_token": "tok_23prgoqpstf56todq"}' https://livedemo.djaoapp.com/api/billing/xia/checkout/
responds
{
  "created_at": "2016-06-21T23:42:44.270977Z",
  "processor_key": "pay_5lK5TacFH3gbKe",
  "amount": 2000,
  "unit": "usd",
  "description": "Charge pay_5lK5TacFH3gblP on credit card of Xia",
  "last4": "1234",
  "exp_date": "2016-06-01",
  "state": "created"
}

Lists discount codes

GET /api/billing/{organization}/coupons/

Returns a list of 25 coupons for provider {organization}.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML coupons page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

o
string

sort by code, created_at, description, ends_at, discount_type, amount. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in code, description, amount, organization__full_name

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

code
string

Unique identifier per provider, typically used in URLs

discount_type
string

Type of discount ('percentage', 'currency', or 'period')

discount_value
integer

Amount of the discount

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time at which the coupon code expires (in ISO format)

description
string

Free-form text description for the coupon

nb_attempts
integer

Number of times the coupon can be used

plan
string

Coupon will only apply to this plan

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/cowork/coupons/?o=code\&ot=asc\&q=DIS
responds
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "code": "DIS100",
      "discount_type": "percentage",
      "discount_value": 10000,
      "created_at": "2014-01-01T09:00:00Z",
      "ends_at": null,
      "description": null
    },
    {
      "code": "DIS50",
      "discount_type": "percentage",
      "discount_value": 5000,
      "created_at": "2014-01-01T09:00:00Z",
      "ends_at": null,
      "description": null
    }
  ]
}

Creates a discount code

POST /api/billing/{organization}/coupons/

Customers will be able to use the code until ends_at to subscribe to plans from the Coupon's provider at a discount.

The API is typically used within an HTML coupons page as present in the default theme.

Request body
code
string required

Unique identifier per provider, typically used in URLs

discount_type
string required

Type of discount ('percentage', 'currency', or 'period')

discount_value
integer required

Amount of the discount

ends_at
string

Date/time at which the coupon code expires (in ISO format)

description
string

Free-form text description for the coupon

nb_attempts
integer

Number of times the coupon can be used

plan
string

Coupon will only apply to this plan

Responses
code
string

Unique identifier per provider, typically used in URLs

discount_type
string

Type of discount ('percentage', 'currency', or 'period')

discount_value
integer

Amount of the discount

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time at which the coupon code expires (in ISO format)

description
string

Free-form text description for the coupon

nb_attempts
integer

Number of times the coupon can be used

plan
string

Coupon will only apply to this plan

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"code": "DIS100", "discount_type": "percentage", "discount_value": 10000, "ends_at": null, "description": null}' https://livedemo.djaoapp.com/api/billing/cowork/coupons/
responds
{
  "code": "DIS100",
  "discount_type": "percentage",
  "discount_value": 10000,
  "ends_at": null,
  "description": null
}

Retrieves a discount code

GET /api/billing/{organization}/coupons/{coupon}/

The API is typically used within an HTML coupons page as present in the default theme.

Responses
code
string

Unique identifier per provider, typically used in URLs

discount_type
string

Type of discount ('percentage', 'currency', or 'period')

discount_value
integer

Amount of the discount

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time at which the coupon code expires (in ISO format)

description
string

Free-form text description for the coupon

nb_attempts
integer

Number of times the coupon can be used

plan
string

Coupon will only apply to this plan

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/cowork/coupons/DIS100/
responds
{
  "code": "DIS100",
  "discount_type": "percentage",
  "discount_value": 10000,
  "created_at": "2014-01-01T09:00:00Z",
  "ends_at": null,
  "description": null
}

Updates a discount code

PUT /api/billing/{organization}/coupons/{coupon}/

The API is typically used within an HTML coupons page as present in the default theme.

Request body
code
string

Unique identifier per provider, typically used in URLs

discount_type
string required

Type of discount ('percentage', 'currency', or 'period')

discount_value
integer

Amount of the discount

ends_at
string

Date/time at which the coupon code expires (in ISO format)

description
string

Free-form text description for the coupon

nb_attempts
integer

Number of times the coupon can be used

plan
string

Coupon will only apply to this plan

Responses
code
string

Unique identifier per provider, typically used in URLs

discount_type
string

Type of discount ('percentage', 'currency', or 'period')

discount_value
integer

Amount of the discount

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time at which the coupon code expires (in ISO format)

description
string

Free-form text description for the coupon

nb_attempts
integer

Number of times the coupon can be used

plan
string

Coupon will only apply to this plan

Examples

curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"discount_type": "percentage", "discount_value": 10000, "ends_at": null, "description": null}' https://livedemo.djaoapp.com/api/billing/cowork/coupons/DIS100/
responds
{
  "code": "DIS100",
  "discount_type": "percentage",
  "discount_value": 10000,
  "ends_at": null,
  "description": null
}

Deletes a discount code

DELETE /api/billing/{organization}/coupons/{coupon}/

Only coupons which have never been applied to an oder will be permanently deleted. Coupons which have already be used at least once will be de-activated and still available for performance measurements.

The API is typically used within an HTML coupons page as present in the default theme.

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/billing/cowork/coupons/DIS100/

Lists subscriber transactions

GET /api/billing/{organization}/history/

Returns a list of 25 transactions associated to {organization} while the profile acts as a subscriber.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML billing history page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in descr, orig_organization__full_name, dest_organization__full_name

o
string

sort by description, amount, dest_organization, dest_account, orig_organization, orig_account, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
start_at
string

Start of the date range for which the balance was computed

ends_at
string

End of the date range for which the balance was computed

balance_amount
integer

Balance of all transactions in cents (i.e. 100ths) of unit

balance_unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/xia/history/?start_at=2015-07-05T07:00:00.000Z
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "start_at": "2015-01-01T00:00:00Z",
  "ends_at": "2016-01-01T00:00:00Z",
  "balance_unit": "usd",
  "balance_amount": 11000,
  "results": [
    {
      "created_at": "2015-08-01T00:00:00Z",
      "description": "Charge for 4 periods",
      "amount": "($356.00)",
      "is_debit": true,
      "orig_account": "Liability",
      "orig_organization": "xia",
      "orig_amount": 112120,
      "orig_unit": "usd",
      "dest_account": "Funds",
      "dest_organization": "stripe",
      "dest_amount": 112120,
      "dest_unit": "usd"
    }
  ]
}

Lists provider receivables

GET /api/billing/{organization}/receivables/

Returns a list of 25 transactions marked as receivables associated to to {organization} while the profile acts as a provider.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

This API endpoint is typically used to find all sales for {organization} whether it was paid or not.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in descr, orig_organization__full_name, dest_organization__full_name

o
string

sort by description, amount, dest_organization, dest_account, orig_organization, orig_account, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
balance_amount
integer

The sum of all record amounts (in unit)

balance_unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/cowork/receivables/?start_at=2015-07-05T07:00:00.000Z
responds
{
  "count": 1,
  "balance_amount": "112120",
  "balance_unit": "usd",
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2015-08-01T00:00:00Z",
      "description": "Charge <a href='/billing/cowork/receipt/1123'>1123</a> distribution for demo562-premium",
      "amount": "112120",
      "is_debit": false,
      "orig_account": "Funds",
      "orig_organization": "stripe",
      "orig_amount": 112120,
      "orig_unit": "usd",
      "dest_account": "Funds",
      "dest_organization": "cowork",
      "dest_amount": 112120,
      "dest_unit": "usd"
    }
  ]
}

Lists provider payouts

GET /api/billing/{organization}/transfers/

Returns a list of 25 transactions associated to {organization} while the profile acts as a provider.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML funds page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in descr, orig_organization__full_name, dest_organization__full_name

o
string

sort by description, amount, dest_organization, dest_account, orig_organization, orig_account, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/cowork/transfers/?start_at=2015-07-05T07:00:00.000Z
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2015-08-01T00:00:00Z",
      "description": "Charge <a href='/billing/cowork/receipt/1123'>1123</a> distribution for demo562-premium",
      "amount": "$1121.20",
      "is_debit": false,
      "orig_account": "Funds",
      "orig_organization": "stripe",
      "orig_amount": 112120,
      "orig_unit": "usd",
      "dest_account": "Funds",
      "dest_organization": "cowork",
      "dest_amount": 112120,
      "dest_unit": "usd"
    }
  ]
}

Creates an offline transaction

POST /api/billing/{organization}/transfers/import/

The primary purpose of this API call is for a provider to keep accurate metrics for the performance of the product sold, regardless of payment options (online or offline).

Request body
subscription
string required

The subscription the offline transaction refers to.

created_at
string required

Date/time of creation (in ISO format)

amount
string required

descr
string

Free-form text description for the transaction

Responses
detail
string

Describes the result of the action in human-readable form

results
array

transactions being created by the import

created_at
string

Date/time of creation (in ISO format)

description
string

Free-form text description for the transaction

amount
string

Amount being transfered

is_debit
string

True if the transaction is indentified as a debit in the API context

orig_account
string

Source account from which funds are withdrawn

orig_organization
string

Billing profile from which funds are withdrawn

orig_amount
integer

Amount withdrawn from source in orig_unit

orig_unit
string

Three-letter ISO 4217 code for source currency unit (ex: usd)

dest_account
string

Target account to which funds are deposited

dest_organization
string

Billing profile to which funds are deposited

dest_amount
integer

Amount deposited into target in dest_unit

dest_unit
string

Three-letter ISO 4217 code for target currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"created_at": "2020-05-30T00:00:00Z", "amount": "10.00", "descr": "Paid by check", "subscription": "xia:premium"}' https://livedemo.djaoapp.com/api/billing/cowork/transfers/import/
responds
{
  "detail": "Transaction imported successfully.",
  "results": [
    {
      "created_at": "2020-05-30T00:00:00Z",
      "description": "Paid by check (alice)",
      "amount": "$10.00",
      "is_debit": false,
      "orig_account": "Receivable",
      "orig_organization": "djaoapp",
      "orig_amount": 1000,
      "orig_unit": "usd",
      "dest_account": "Payable",
      "dest_organization": "xia",
      "dest_amount": 1000,
      "dest_unit": "usd"
    },
    {
      "created_at": "2020-05-30T00:00:00Z",
      "description": "Paid by check (alice)",
      "amount": "$10.00",
      "is_debit": false,
      "orig_account": "Liability",
      "orig_organization": "xia",
      "orig_amount": 1000,
      "orig_unit": "usd",
      "dest_account": "Funds",
      "dest_organization": "djaoapp",
      "dest_amount": 1000,
      "dest_unit": "usd"
    },
    {
      "created_at": "2020-05-30T00:00:00Z",
      "description": "Keep a balanced ledger",
      "amount": "$10.00",
      "is_debit": false,
      "orig_account": "Payable",
      "orig_organization": "xia",
      "orig_amount": 1000,
      "orig_unit": "usd",
      "dest_account": "Liability",
      "dest_organization": "xia",
      "dest_amount": 1000,
      "dest_unit": "usd"
    },
    {
      "created_at": "2020-05-30T00:00:00Z",
      "description": "Paid by check (alice)",
      "amount": "$10.00",
      "is_debit": false,
      "orig_account": "Backlog",
      "orig_organization": "djaoapp",
      "orig_amount": 1000,
      "orig_unit": "usd",
      "dest_account": "Receivable",
      "dest_organization": "djaoapp",
      "dest_amount": 1000,
      "dest_unit": "usd"
    },
    {
      "created_at": "2020-05-30T00:00:00Z",
      "description": "Paid by check (alice) - Keep a balanced ledger",
      "amount": "$0.20",
      "is_debit": false,
      "orig_account": "Funds",
      "orig_organization": "djaoapp",
      "orig_amount": 20,
      "orig_unit": "usd",
      "dest_account": "Offline",
      "dest_organization": "djaoapp",
      "dest_amount": 20,
      "dest_unit": "usd"
    }
  ]
}

Adds an item to the request user cart

POST /api/cart/

Adds a plan into the cart of the user identified through the HTTP request.

The cart can later be checked out and paid by a billing profile, either through the HTML checkout page or API end point.

This end point is typically used when a user is presented with a list of add-ons that she can subscribes to in one checkout screen. The end-point works in both cases, authenticated or anonymous users. For authenticated users, the cart is stored in the database as CartItem objects. For anonymous users, the cart is stored in an HTTP Cookie.

The end-point accepts a single item or a list of items.

option is optional. When it is not specified, subsquent checkout screens will provide choices to pay multiple periods in advance.

When additional full_name and sync_on are specified, payment can be made by one billing profile for another profile to be subscribed (see GroupBuy orders).

Request body
plan
string required

The plan to add into the request.user cart.

option
integer

Index in the list of discounts for advance payments

full_name
string

Full name of the person that will benefit from the subscription (GroupBuy)

sync_on
string

identifier of the person that will benefit from the subscription (GroupBuy)

email
string

e-mail of the person that will benefit from the subscription (GroupBuy)

Responses
created_at
string

Date/time of creation (in ISO format)

plan
string

The plan to add into the request.user cart.

option
integer

Index in the list of discounts for advance payments

full_name
string

Full name of the person that will benefit from the subscription (GroupBuy)

sync_on
string

identifier of the person that will benefit from the subscription (GroupBuy)

email
string

e-mail of the person that will benefit from the subscription (GroupBuy)

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"plan": "premium", "option": 1}' https://livedemo.djaoapp.com/api/cart/
responds
{
  "plan": "premium",
  "option": 1
}

Removes an item from the request user cart

DELETE /api/cart/

Removes an item from the request.user cart.

Responses

204 No Content

Examples

curl -X DELETE https://livedemo.djaoapp.com/api/cart/?plan=premium

Redeems a discount code

POST /api/cart/redeem/

Redeems a Coupon and applies the discount to the eligible items in the cart.

Request body
code
string required

Coupon code to redeem

Responses
detail
string

Describes the reason for the error in plain text

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"code": "LABORDAY"}' https://livedemo.djaoapp.com/api/cart/redeem/
responds
{
  "detail": "Coupon 'LABORDAY' was successfully applied."
}

Uploads multiple items into a cart

POST /api/cart/{plan}/upload/

Add a Plan into the subscription cart of multiple users as per the content of an uploaded file.

This works bulk fashion of /cart/ endpoint. The uploaded file must be a CSV containing the fields first_name, last_name and email. The CSV file must not contain a header line, only data.

Responses
created
array

created_at
string

Date/time of creation (in ISO format)

user
object

User the cart belongs to

slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

plan
string

Item in the cart (if plan)

option
integer

Index in the list of discounts for advance payments

full_name
string

Full name of the person that will benefit from the subscription (GroupBuy)

sync_on
string

identifier of the person that will benefit from the subscription (GroupBuy)

email
string

e-mail of the person that will benefit from the subscription (GroupBuy)

updated
array

created_at
string

Date/time of creation (in ISO format)

user
object

User the cart belongs to

slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

plan
string

Item in the cart (if plan)

option
integer

Index in the list of discounts for advance payments

full_name
string

Full name of the person that will benefit from the subscription (GroupBuy)

sync_on
string

identifier of the person that will benefit from the subscription (GroupBuy)

email
string

e-mail of the person that will benefit from the subscription (GroupBuy)

failed
array

created_at
string

Date/time of creation (in ISO format)

user
object

User the cart belongs to

slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

plan
string

Item in the cart (if plan)

option
integer

Index in the list of discounts for advance payments

full_name
string

Full name of the person that will benefit from the subscription (GroupBuy)

sync_on
string

identifier of the person that will benefit from the subscription (GroupBuy)

email
string

e-mail of the person that will benefit from the subscription (GroupBuy)

Examples

curl -X POST https://livedemo.djaoapp.com/api/cart/basic/upload/
responds
{
  "created": [
    {
      "first_name": "Joe",
      "last_name": "Smith",
      "email": "joesmith@example.com",
      "plan": "basic"
    },
    {
      "first_name": "Marie",
      "last_name": "Johnson",
      "email": "mariejohnson@example.com",
      "plan": "basic"
    }
  ],
  "updated": [],
  "failed": []
}

Sends a contact-us message

POST /api/contact/

Emails a free form contact-us message from a customer to the provider

The API is typically used within an HTML contact page as present in the default theme.

Request body
full_name
string required

Full name the sender of the message wishes to be addressed as

email
string required

Email address to reply to the sender

message
string

Description of the reason for contacting the provider

Responses
detail
string

Describes the reason for the error in plain text

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"email": "joe+1@example.com", "full_name": "Joe Card1", "message": "Can I request a demo?"}' https://livedemo.djaoapp.com/api/contact/
responds
{
  "detail": "Your request has been sent. We will reply within24 hours. Thank you."
}

Lists activities for a user

GET /api/contacts/{user}/activities/

Returns a list of 25 activity records for user account {user}.

Query parameters
page
integer

A page number within the paginated result set.

q
string

search for matching text in text

o
string

sort by created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

created_by
string

User that created the activity

text
string

Free form text description of the activity

account
string

Account the activity is associated to

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/contacts/xia/activities/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2018-01-01T00:00:00Z",
      "created_by": "alice",
      "text": "Phone call",
      "account": null
    },
    {
      "created_at": "2018-01-02T00:00:00Z",
      "created_by": "alice",
      "text": "Follow up e-mail",
      "account": "cowork"
    }
  ]
}

Records new activity with a user

POST /api/contacts/{user}/activities/
Request body
text
string

Free form text description of the activity

account
string required

Account the activity is associated to

Responses
created_at
string

Date/time of creation (in ISO format)

created_by
string

User that created the activity

text
string

Free form text description of the activity

account
string

Account the activity is associated to

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"text": "Phone call", "account": null}' https://livedemo.djaoapp.com/api/contacts/xia/activities/
responds
{
  "text": "Phone call",
  "account": null
}

Signs a consent agreement

POST /api/legal/{agreement}/sign/

Indicates the request user has signed the required consent agreement.

The API is typically used within an HTML legal agreement page as present in the default theme.

Request body
read_terms
boolean required

I have read and understand these terms and conditions

Responses
read_terms
boolean

I have read and understand these terms and conditions

last_signed
string

Date/time of signature (in ISO format)

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"read_terms": true}' https://livedemo.djaoapp.com/api/legal/terms-of-use/sign/
responds
{
  "read_terms": true,
  "last_signed": "2019-01-01T00:00:00Z"
}

Retrieves a balance sheet

GET /api/metrics/balances/{report}/

Queries a balance sheet named {report} for the broker.

To add lines in the report see /api/metrics/balances/{report}/lines/.

Query parameters
start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

title
string

Title for the table

table
array

Data series

key
string

Unique key in the table for the data series

selector
string

Filter on transaction accounts

values
array

List of (datetime, integer) couples that represents the data serie

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/balances/taxes/
responds
{
  "scale": 0.01,
  "unit": "usd",
  "title": "Balances: taxes",
  "table": [
    {
      "key": "Sales",
      "selector": "Receivable",
      "values": [
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          0
        ],
        [
          "2015-11-01T00:00:00Z",
          0
        ],
        [
          "2016-02-01T00:00:00Z",
          0
        ],
        [
          "2016-05-01T00:00:00Z",
          0
        ],
        [
          "2016-05-16T21:08:15.637Z",
          0
        ]
      ]
    }
  ]
}

Retrieves row headers for a balance sheet

GET /api/metrics/balances/{report}/lines/

Queries the list of rows reported on a balance sheet named {report}.

Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

title
string

Title for the row

selector
string

Filter on transaction accounts

rank
integer

Absolute position of the row in the list of rows for the table

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/balances/taxes/lines/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "title": "Sales",
      "selector": "Receivable",
      "rank": 1
    }
  ]
}

Creates a row in a balance sheet

POST /api/metrics/balances/{report}/lines/

Adds a new row on the {report} balance sheet.

Request body
title
string required

Title for the row

selector
string

Filter on transaction accounts

rank
integer required

Absolute position of the row in the list of rows for the table

Responses
title
string

Title for the row

selector
string

Filter on transaction accounts

rank
integer

Absolute position of the row in the list of rows for the table

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Sales", "selector": "Receivable", "rank": 1}' https://livedemo.djaoapp.com/api/metrics/balances/taxes/lines/
responds
{
  "title": "Sales",
  "selector": "Receivable",
  "rank": 1
}

Retrieves a row in a balance sheet

GET /api/metrics/balances/{report}/lines/{rank}/

Describes a row reported on a balance sheet named {report}.

Responses
title
string

Title for the row

selector
string

Filter on transaction accounts

rank
integer

Absolute position of the row in the list of rows for the table

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/balances/taxes/lines/1/
responds
{
  "title": "Sales",
  "selector": "Receivable",
  "rank": 1
}

Updates a row in a balance sheet

PUT /api/metrics/balances/{report}/lines/{rank}/

Updates a row reported on a balance sheet named {report}.

Request body
title
string required

Title for the row

selector
string

Filter on transaction accounts

rank
integer required

Absolute position of the row in the list of rows for the table

Responses
title
string

Title for the row

selector
string

Filter on transaction accounts

rank
integer

Absolute position of the row in the list of rows for the table

Examples

curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Sales", "selector": "Receivable", "rank": 1}' https://livedemo.djaoapp.com/api/metrics/balances/taxes/lines/1/
responds
{
  "title": "Sales",
  "selector": "Receivable",
  "rank": 1
}

Deletes a row in a balance sheet

DELETE /api/metrics/balances/{report}/lines/{rank}/

Deletes a row reported on a balance sheet named {report}.

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/metrics/balances/taxes/lines/1/

Lists top of funnel registered users

GET /api/metrics/registered/

Returns a list of 25 users which have no associated role or a role to a profile which has no subscription, active or inactive.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML subscribers page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

o
string

sort by first_name, last_name, email, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in first_name, last_name, email

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/registered/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "alice",
      "created_at": "2014-01-01T00:00:00Z",
      "email": "alice@djaodjin.com",
      "full_name": "Alice Cooper",
      "printable_name": "Alice Cooper",
      "username": "alice"
    }
  ]
}

Lists active subscriptions

GET /api/metrics/{organization}/active/

Lists all Subscription to a plan whose provider is {organization} and which are currently in progress.

Optionnaly when an ends_at query parameter is specified, returns a queryset of Subscription that were active at ends_at. When a start_at query parameter is specified, only considers Subscription that were created after start_at.

The queryset can be filtered for at least one field to match a search term (q).

Query results can be ordered by natural fields (o) in either ascending or descending order (ot).

The API is typically used within an HTML subscribers page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

o
string

sort by organization, plan, created_at, ends_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in organization__slug, organization__full_name, organization__email, organization__phone, organization__street_address, organization__locality, organization__region, organization__postal_code, organization__country, plan__title

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

accept_request_api_url
string

URL API endpoint to grant the subscription

remove_api_url
string

URL API endpoint to remove the subscription grant or request

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/active/?o=created_at\&ot=desc
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2016-01-14T23:16:55Z",
      "ends_at": "2017-01-14T23:16:55Z",
      "description": null,
      "organization": {
        "slug": "xia",
        "printable_name": "Xia Lee"
      },
      "plan": {
        "slug": "open-space",
        "title": "Open Space",
        "description": "open space desk, High speed internet- Ethernet or WiFi, Unlimited printing,Unlimited scanning, Unlimited fax service(send and receive)",
        "is_active": true,
        "setup_amount": 0,
        "period_amount": 17999,
        "interval": 4,
        "app_url": "http://localhost:8020/app"
      },
      "auto_renew": true
    }
  ]
}

Retrieves 12-month trailing deferred balances

GET /api/metrics/{organization}/balances/

Generate a table of revenue (rows) per months (columns) for a default balance sheet (Income, Backlog, Receivable).

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

title
string

Title for the table

table
array

Data series

key
string

Unique key in the table for the data series

selector
string

Filter on transaction accounts

values
array

List of (datetime, integer) couples that represents the data serie

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/balances/
responds
{
  "title": "Balances",
  "scale": 0.01,
  "unit": "usd",
  "table": [
    {
      "key": "Income",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          0
        ],
        [
          "2014-10-01T00:00:00Z",
          1532624
        ],
        [
          "2014-11-01T00:00:00Z",
          2348340
        ],
        [
          "2014-12-01T00:00:00Z",
          3244770
        ],
        [
          "2015-01-01T00:00:00Z",
          5494221
        ],
        [
          "2015-02-01T00:00:00Z",
          7214221
        ],
        [
          "2015-03-01T00:00:00Z",
          8444221
        ],
        [
          "2015-04-01T00:00:00Z",
          9784221
        ],
        [
          "2015-05-01T00:00:00Z",
          12784221
        ],
        [
          "2015-06-01T00:00:00Z",
          14562341
        ],
        [
          "2015-07-01T00:00:00Z",
          16567341
        ],
        [
          "2015-08-01T00:00:00Z",
          17893214
        ],
        [
          "2015-08-06T02:24:50.485Z",
          221340
        ]
      ]
    },
    {
      "key": "Backlog",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          1712624
        ],
        [
          "2014-10-01T00:00:00Z",
          3698340
        ],
        [
          "2014-11-01T00:00:00Z",
          7214770
        ],
        [
          "2014-12-01T00:00:00Z",
          10494221
        ],
        [
          "2015-01-01T00:00:00Z",
          14281970
        ],
        [
          "2015-02-01T00:00:00Z",
          18762845
        ],
        [
          "2015-03-01T00:00:00Z",
          24258765
        ],
        [
          "2015-04-01T00:00:00Z",
          31937741
        ],
        [
          "2015-05-01T00:00:00Z",
          43002401
        ],
        [
          "2015-06-01T00:00:00Z",
          53331444
        ],
        [
          "2015-07-01T00:00:00Z",
          64775621
        ],
        [
          "2015-08-01T00:00:00Z",
          75050033
        ],
        [
          "2015-08-06T02:24:50.485Z",
          89156321
        ]
      ]
    },
    {
      "key": "Receivable",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          0
        ],
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          0
        ],
        [
          "2015-02-01T00:00:00Z",
          0
        ],
        [
          "2015-03-01T00:00:00Z",
          0
        ],
        [
          "2015-04-01T00:00:00Z",
          0
        ],
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-06-01T00:00:00Z",
          0
        ],
        [
          "2015-07-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          0
        ],
        [
          "2015-08-06T02:24:50.485Z",
          0
        ]
      ]
    }
  ]
}

Lists churned subscriptions

GET /api/metrics/{organization}/churned/

Returns a list of 25 subscriptions to a plan whose provider is {organization} which have ended already.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML subscribers page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

o
string

sort by organization, plan, created_at, ends_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in organization__slug, organization__full_name, organization__email, organization__phone, organization__street_address, organization__locality, organization__region, organization__postal_code, organization__country, plan__title

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

accept_request_api_url
string

URL API endpoint to grant the subscription

remove_api_url
string

URL API endpoint to remove the subscription grant or request

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/churned/?o=created_at\&ot=desc
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2016-01-14T23:16:55Z",
      "ends_at": "2017-01-14T23:16:55Z",
      "description": null,
      "organization": {
        "slug": "xia",
        "printable_name": "Xia Lee"
      },
      "plan": {
        "slug": "open-space",
        "title": "Open Space",
        "description": "open space desk, High speed internet- Ethernet or WiFi, Unlimited printing,Unlimited scanning, Unlimited fax service(send and receive)",
        "is_active": true,
        "setup_amount": 0,
        "period_amount": 17999,
        "interval": 4,
        "app_url": "http://localhost:8020/app"
      },
      "auto_renew": true
    }
  ]
}

Retrieves performance of a discount code

GET /api/metrics/{organization}/coupons/{coupon}/

Returns a list of 25 cart items on which coupon with code {coupon} was used. Coupon {coupon} must have been created by provider {organization}.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

Query parameters
start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

o
string

sort by user__username, plan, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in user__username, user__first_name, user__last_name, user__email

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

user
object

User the cart belongs to

slug
string

Username

username
string

Username

printable_name
string

Name that can be safely used for display in HTML pages

created_at
string

date at which the account was created

picture
string

URL location of the profile picture

email
string

Primary e-mail to contact user

credentials
boolean

True if the user has valid login credentials

plan
string

Item in the cart (if plan)

option
integer

Index in the list of discounts for advance payments

full_name
string

Full name of the person that will benefit from the subscription (GroupBuy)

sync_on
string

identifier of the person that will benefit from the subscription (GroupBuy)

email
string

e-mail of the person that will benefit from the subscription (GroupBuy)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/coupons/DIS100/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "user": {
        "slug": "xia",
        "created_at": "2012-09-14T23:16:55Z",
        "email": "xia@localhost.localdomain",
        "full_name": "Xia Doe",
        "printable_name": "Xia Doe",
        "username": "xia"
      },
      "plan": "basic",
      "created_at": "2014-01-01T09:00:00Z"
    }
  ]
}

Retrieves 12-month trailing customer counts

GET /api/metrics/{organization}/customers/

The API is typically used within an HTML revenue page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

title
string

Title for the table

table
array

Data series

key
string

Unique key in the table for the data series

selector
string

Filter on transaction accounts

values
array

List of (datetime, integer) couples that represents the data serie

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/customers/
responds
{
  "title": "Customers",
  "table": [
    {
      "key": "Total # of Customers",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          15
        ],
        [
          "2014-11-01T00:00:00Z",
          17
        ],
        [
          "2014-12-01T00:00:00Z",
          19
        ],
        [
          "2015-01-01T00:00:00Z",
          19
        ],
        [
          "2015-02-01T00:00:00Z",
          25
        ],
        [
          "2015-03-01T00:00:00Z",
          29
        ],
        [
          "2015-04-01T00:00:00Z",
          37
        ],
        [
          "2015-05-01T00:00:00Z",
          43
        ],
        [
          "2015-06-01T00:00:00Z",
          46
        ],
        [
          "2015-07-01T00:00:00Z",
          48
        ],
        [
          "2015-08-01T00:00:00Z",
          54
        ],
        [
          "2015-08-06T05:20:24.537Z",
          60
        ]
      ]
    },
    {
      "key": "# of new Customers",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          2
        ],
        [
          "2014-11-01T00:00:00Z",
          2
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          6
        ],
        [
          "2015-02-01T00:00:00Z",
          4
        ],
        [
          "2015-03-01T00:00:00Z",
          8
        ],
        [
          "2015-04-01T00:00:00Z",
          6
        ],
        [
          "2015-05-01T00:00:00Z",
          3
        ],
        [
          "2015-06-01T00:00:00Z",
          2
        ],
        [
          "2015-07-01T00:00:00Z",
          6
        ],
        [
          "2015-08-01T00:00:00Z",
          7
        ],
        [
          "2015-08-06T05:20:24.537Z",
          0
        ]
      ]
    },
    {
      "key": "# of churned Customers",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          0
        ],
        [
          "2015-02-01T00:00:00Z",
          0
        ],
        [
          "2015-03-01T00:00:00Z",
          0
        ],
        [
          "2015-04-01T00:00:00Z",
          0
        ],
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-06-01T00:00:00Z",
          0
        ],
        [
          "2015-07-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          1
        ],
        [
          "2015-08-06T05:20:24.537Z",
          60
        ]
      ]
    },
    {
      "key": "Net New Customers",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          2
        ],
        [
          "2014-11-01T00:00:00Z",
          2
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          6
        ],
        [
          "2015-02-01T00:00:00Z",
          4
        ],
        [
          "2015-03-01T00:00:00Z",
          8
        ],
        [
          "2015-04-01T00:00:00Z",
          6
        ],
        [
          "2015-05-01T00:00:00Z",
          3
        ],
        [
          "2015-06-01T00:00:00Z",
          2
        ],
        [
          "2015-07-01T00:00:00Z",
          6
        ],
        [
          "2015-08-01T00:00:00Z",
          6
        ],
        [
          "2015-08-06T05:20:24.537Z",
          -60
        ]
      ]
    }
  ],
  "extra": [
    {
      "key": "% Customer Churn",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0.0
        ],
        [
          "2014-12-01T00:00:00Z",
          0.0
        ],
        [
          "2015-01-01T00:00:00Z",
          0.0
        ],
        [
          "2015-02-01T00:00:00Z",
          0.0
        ],
        [
          "2015-03-01T00:00:00Z",
          0.0
        ],
        [
          "2015-04-01T00:00:00Z",
          0.0
        ],
        [
          "2015-05-01T00:00:00Z",
          0.0
        ],
        [
          "2015-06-01T00:00:00Z",
          0.0
        ],
        [
          "2015-07-01T00:00:00Z",
          0.0
        ],
        [
          "2015-08-01T00:00:00Z",
          2.08
        ],
        [
          "2015-08-06T05:20:24.537Z",
          111.11
        ]
      ]
    }
  ]
}

Retrieves 12-month trailing revenue

GET /api/metrics/{organization}/funds/

Produces sales, payments and refunds over a period of time.

The API is typically used within an HTML revenue page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

title
string

Title for the table

table
array

Data series

key
string

Unique key in the table for the data series

selector
string

Filter on transaction accounts

values
array

List of (datetime, integer) couples that represents the data serie

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/funds/
responds
{
  "title": "Amount",
  "scale": 0.01,
  "unit": "usd",
  "table": [
    {
      "key": "Total Sales",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          1985716
        ],
        [
          "2014-11-01T00:00:00Z",
          3516430
        ],
        [
          "2014-12-01T00:00:00Z",
          3279451
        ],
        [
          "2015-01-01T00:00:00Z",
          3787749
        ],
        [
          "2015-02-01T00:00:00Z",
          4480875
        ],
        [
          "2015-03-01T00:00:00Z",
          5495920
        ],
        [
          "2015-04-01T00:00:00Z",
          7678976
        ],
        [
          "2015-05-01T00:00:00Z",
          11064660
        ],
        [
          "2015-06-01T00:00:00Z",
          10329043
        ],
        [
          "2015-07-01T00:00:00Z",
          11444177
        ],
        [
          "2015-08-01T00:00:00Z",
          10274412
        ],
        [
          "2015-08-06T04:59:14.721Z",
          14106288
        ]
      ]
    },
    {
      "key": "New Sales",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          0
        ],
        [
          "2015-02-01T00:00:00Z",
          0
        ],
        [
          "2015-03-01T00:00:00Z",
          0
        ],
        [
          "2015-04-01T00:00:00Z",
          0
        ],
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-06-01T00:00:00Z",
          0
        ],
        [
          "2015-07-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          0
        ],
        [
          "2015-08-06T04:59:14.721Z",
          0
        ]
      ]
    },
    {
      "key": "Churned Sales",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          0
        ],
        [
          "2015-02-01T00:00:00Z",
          0
        ],
        [
          "2015-03-01T00:00:00Z",
          0
        ],
        [
          "2015-04-01T00:00:00Z",
          0
        ],
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-06-01T00:00:00Z",
          0
        ],
        [
          "2015-07-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          0
        ],
        [
          "2015-08-06T04:59:14.721Z",
          0
        ]
      ]
    },
    {
      "key": "Payments",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          1787144
        ],
        [
          "2014-11-01T00:00:00Z",
          3164787
        ],
        [
          "2014-12-01T00:00:00Z",
          2951505
        ],
        [
          "2015-01-01T00:00:00Z",
          3408974
        ],
        [
          "2015-02-01T00:00:00Z",
          4032787
        ],
        [
          "2015-03-01T00:00:00Z",
          4946328
        ],
        [
          "2015-04-01T00:00:00Z",
          6911079
        ],
        [
          "2015-05-01T00:00:00Z",
          9958194
        ],
        [
          "2015-06-01T00:00:00Z",
          9296138
        ],
        [
          "2015-07-01T00:00:00Z",
          10299759
        ],
        [
          "2015-08-01T00:00:00Z",
          9246970
        ],
        [
          "2015-08-06T04:59:14.721Z",
          12695659
        ]
      ]
    },
    {
      "key": "Refunds",
      "values": [
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          0
        ],
        [
          "2015-02-01T00:00:00Z",
          0
        ],
        [
          "2015-03-01T00:00:00Z",
          0
        ],
        [
          "2015-04-01T00:00:00Z",
          0
        ],
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-06-01T00:00:00Z",
          0
        ],
        [
          "2015-07-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          0
        ],
        [
          "2015-08-06T04:59:14.721Z",
          0
        ]
      ]
    }
  ]
}

Retrieves customers lifetime value

GET /api/metrics/{organization}/lifetimevalue/
Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Since when is the profile a subscriber

ends_at
string

Current end date for the contract

contract_value
integer

Total value to be collected from the profile

cash_payments
integer

Cash payments collected from the profile

deferred_revenue
integer

The deferred revenue for the profile

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/lifetimevalue/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "xia",
      "email": "xia@localhost.localdomain",
      "full_name": "Xia Doe",
      "created_at": "2014-01-01T09:00:00Z",
      "ends_at": "2014-01-01T09:00:00Z",
      "unit": "usd",
      "contract_value": 10000,
      "cash_payments": 10000,
      "deferred_revenue": 10000
    }
  ]
}

Retrieves 12-month trailing plans performance

GET /api/metrics/{organization}/plans/

The API is typically used within an HTML plans metrics page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

title
string

Title for the table

table
array

Data series

key
string

Unique key in the table for the data series

selector
string

Filter on transaction accounts

values
array

List of (datetime, integer) couples that represents the data serie

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/plans/
responds
{
  "title": "Active Subscribers",
  "table": [
    {
      "is_active": true,
      "key": "open-space",
      "location": "/profile/plan/open-space/",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          4
        ],
        [
          "2014-10-01T00:00:00Z",
          5
        ],
        [
          "2014-11-01T00:00:00Z",
          6
        ],
        [
          "2014-12-01T00:00:00Z",
          6
        ],
        [
          "2015-01-01T00:00:00Z",
          6
        ],
        [
          "2015-02-01T00:00:00Z",
          9
        ],
        [
          "2015-03-01T00:00:00Z",
          9
        ],
        [
          "2015-04-01T00:00:00Z",
          9
        ],
        [
          "2015-05-01T00:00:00Z",
          11
        ],
        [
          "2015-06-01T00:00:00Z",
          11
        ],
        [
          "2015-07-01T00:00:00Z",
          14
        ],
        [
          "2015-08-01T00:00:00Z",
          16
        ],
        [
          "2015-08-06T05:37:50.004Z",
          16
        ]
      ]
    },
    {
      "is_active": true,
      "key": "open-plus",
      "location": "/profile/plan/open-plus/",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          7
        ],
        [
          "2014-10-01T00:00:00Z",
          8
        ],
        [
          "2014-11-01T00:00:00Z",
          9
        ],
        [
          "2014-12-01T00:00:00Z",
          9
        ],
        [
          "2015-01-01T00:00:00Z",
          12
        ],
        [
          "2015-02-01T00:00:00Z",
          13
        ],
        [
          "2015-03-01T00:00:00Z",
          18
        ],
        [
          "2015-04-01T00:00:00Z",
          19
        ],
        [
          "2015-05-01T00:00:00Z",
          19
        ],
        [
          "2015-06-01T00:00:00Z",
          20
        ],
        [
          "2015-07-01T00:00:00Z",
          23
        ],
        [
          "2015-08-01T00:00:00Z",
          25
        ],
        [
          "2015-08-06T05:37:50.014Z",
          25
        ]
      ]
    },
    {
      "is_active": true,
      "key": "private",
      "location": "/profile/plan/private/",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          3
        ],
        [
          "2014-10-01T00:00:00Z",
          3
        ],
        [
          "2014-11-01T00:00:00Z",
          3
        ],
        [
          "2014-12-01T00:00:00Z",
          3
        ],
        [
          "2015-01-01T00:00:00Z",
          6
        ],
        [
          "2015-02-01T00:00:00Z",
          7
        ],
        [
          "2015-03-01T00:00:00Z",
          10
        ],
        [
          "2015-04-01T00:00:00Z",
          15
        ],
        [
          "2015-05-01T00:00:00Z",
          16
        ],
        [
          "2015-06-01T00:00:00Z",
          17
        ],
        [
          "2015-07-01T00:00:00Z",
          17
        ],
        [
          "2015-08-01T00:00:00Z",
          18
        ],
        [
          "2015-08-06T05:37:50.023Z",
          18
        ]
      ]
    }
  ],
  "extra": [
    {
      "key": "churn",
      "values": [
        [
          "2014-09-01T00:00:00Z",
          0
        ],
        [
          "2014-10-01T00:00:00Z",
          0
        ],
        [
          "2014-11-01T00:00:00Z",
          0
        ],
        [
          "2014-12-01T00:00:00Z",
          0
        ],
        [
          "2015-01-01T00:00:00Z",
          0
        ],
        [
          "2015-02-01T00:00:00Z",
          0
        ],
        [
          "2015-03-01T00:00:00Z",
          0
        ],
        [
          "2015-04-01T00:00:00Z",
          0
        ],
        [
          "2015-05-01T00:00:00Z",
          0
        ],
        [
          "2015-06-01T00:00:00Z",
          0
        ],
        [
          "2015-07-01T00:00:00Z",
          0
        ],
        [
          "2015-08-01T00:00:00Z",
          1
        ],
        [
          "2015-08-06T05:37:50.031Z",
          1
        ]
      ]
    }
  ]
}

Sends a test notification e-mail

POST /api/notifications/{template}/
Responses
detail
string

Describes the result of the API call in plain text

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/notifications/contact_requested_notice/
responds
{
  "detail": "Test email sent to xia@example.com"
}

Lists active pricing plans

GET /api/pricing/

Returns a list of 25 plans which are active and can be subscribed to.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

The API is typically used within an HTML pricing page as present in the default theme.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

o
string

sort by title, period_amount, is_active, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

Examples

curl https://livedemo.djaoapp.com/api/pricing/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "managed",
      "title": "Managed",
      "description": "Ideal for growing organizations",
      "is_active": true,
      "setup_amount": 0,
      "period_amount": 2900,
      "period_length": 1,
      "period_type": "monthly",
      "unit": "usd",
      "is_not_priced": false,
      "renewal_type": "auto-renew",
      "created_at": "2019-01-01T00:00:00Z",
      "organization": "cowork",
      "extra": null,
      "skip_optin_on_grant": false,
      "optin_on_request": false
    }
  ]
}

Lists billing profiles

GET /api/profile/

Returns a list of 25 profile and user accounts.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

q
string

search for matching text in slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name

o
string

sort by full_name, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

nick_name
string

Short casual name used to address the contact (only available for 'personal' and 'user' accounts)

lang
string

Preferred communication language (only available for 'personal' and 'user' accounts)

Examples

curl https://livedemo.djaoapp.com/api/profile/?o=created_at\&ot=desc
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "xia",
      "full_name": "Xia Lee",
      "email": "xia@localhost.localdomain",
      "created_at": "2016-01-14T23:16:55Z",
      "printable_name": "Xia Lee"
    }
  ]
}

Creates a billing profile

POST /api/profile/
Request body
slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

Responses
slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

nick_name
string

Short casual name used to address the contact (only available for 'personal' and 'user' accounts)

lang
string

Preferred communication language (only available for 'personal' and 'user' accounts)

Examples

curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"email": "xia@locahost.localdomain", "full_name": "Xia Lee", "type": "personal"}' https://livedemo.djaoapp.com/api/profile/
responds
{
  "slug": "xia",
  "email": "xia@locahost.localdomain",
  "full_name": "Xia Lee",
  "printable_name": "Xia Lee",
  "type": "personal",
  "credentials": true,
  "default_timezone": "America/Los_Angeles",
  "phone": "",
  "street_address": "",
  "locality": "",
  "region": "",
  "postal_code": "",
  "country": "US",
  "is_bulk_buyer": false,
  "extra": null
}

Retrieves a billing profile

GET /api/profile/{organization}/

The API is typically used within an HTML contact information page as present in the default theme.

Responses
slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

subscriptions
array

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

plan
string

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

nick_name
string

Short casual name used to address the contact (only available for 'personal' and 'user' accounts)

lang
string

Preferred communication language (only available for 'personal' and 'user' accounts)

activities
array

Activities related to the account (only available for 'personal' and 'user' accounts)

created_at
string

Date/time of creation (in ISO format)

created_by
string

User that created the activity

text
string

Free form text description of the activity

account
string

Account the activity is associated to

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/
responds
{
  "created_at": "2018-01-01T00:00:00Z",
  "email": "xia@locahost.localdomain",
  "full_name": "Xia Lee",
  "printable_name": "Xia Lee",
  "slug": "xia",
  "phone": "555-555-5555",
  "street_address": "185 Berry St #550",
  "locality": "San Francisco",
  "region": "CA",
  "postal_code": "",
  "country": "US",
  "default_timezone": "Europe/Kiev",
  "is_provider": false,
  "is_bulk_buyer": false,
  "type": "",
  "picture": "",
  "subscriptions": [
    {
      "created_at": "2018-01-01T00:00:00Z",
      "ends_at": "2019-01-01T00:00:00Z",
      "plan": "open-space",
      "auto_renew": true
    }
  ]
}

Updates a billing profile

PUT /api/profile/{organization}/
Request body
slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

picture
string

URL location of the profile picture

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

Responses
slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

subscriptions
array

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

plan
string

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

nick_name
string

Short casual name used to address the contact (only available for 'personal' and 'user' accounts)

lang
string

Preferred communication language (only available for 'personal' and 'user' accounts)

activities
array

Activities related to the account (only available for 'personal' and 'user' accounts)

created_at
string

Date/time of creation (in ISO format)

created_by
string

User that created the activity

text
string

Free form text description of the activity

account
string

Account the activity is associated to

Examples

curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"email": "xia@locahost.localdomain", "full_name": "Xia Lee"}' https://livedemo.djaoapp.com/api/profile/xia/
responds
{
  "email": "xia@locahost.localdomain",
  "full_name": "Xia Lee",
  "type": "personal"
}

Deletes a billing profile

DELETE /api/profile/{organization}/

We anonymize the profile instead of purely deleting it from the database because we don't want to loose history on subscriptions and transactions.

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/xia/

Lists a provider plans

GET /api/profile/{organization}/plans/

Returns a list of 25 plans managed by provider {organization}.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

o
string

sort by title, period_amount, is_active, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "managed",
      "title": "Managed",
      "description": "Ideal for growing organizations",
      "is_active": true,
      "setup_amount": 0,
      "period_amount": 2900,
      "period_length": 1,
      "period_type": "monthly",
      "unit": "usd",
      "is_not_priced": false,
      "renewal_type": "auto-renew",
      "created_at": "2019-01-01T00:00:00Z",
      "organization": "cowork",
      "extra": null,
      "skip_optin_on_grant": false,
      "optin_on_request": false
    }
  ]
}

Creates a plan

POST /api/profile/{organization}/plans/

Creates a new subscription plan that belongs to provider {organization}.

Request body
slug
string

Unique identifier shown in the URL bar

title
string required

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string required

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

Responses
slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Popup Desk", "description": "A desk in our coworking space", "is_active": false, "period_amount": 12000, "interval": "monthly"}' https://livedemo.djaoapp.com/api/profile/cowork/plans/
responds
{
  "title": "Popup Desk",
  "description": "A desk in our coworking space",
  "is_active": false,
  "period_amount": 12000,
  "interval": "monthly"
}

Retrieves a plan

GET /api/profile/{organization}/plans/{plan}/

Returns the {plan} for provider {organization}

The is_active boolean is used to activate a plan, enabling users to subscribe to it, or deactivate a plan, disabling users from subscribing to it.

The API is typically used within an HTML update plan page as present in the default theme.

Responses
slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/
responds
{
  "title": "Open Space",
  "description": "A desk in our coworking space",
  "is_active": false,
  "period_amount": 12000,
  "interval": "monthly"
}

Updates a plan

PUT /api/profile/{organization}/plans/{plan}/

Updates fields for {plan}. If the period_amount is modified, all subscriptions to this plan will be charged the period_amount on renewal.

The is_active boolean is used to activate a plan, enabling users to subscribe to it, or deactivate a plan, disabling users from subscribing to it.

The API is typically used within an HTML update plan page as present in the default theme.

Request body
slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string required

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

Responses
slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

Examples

curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Open Space"}' https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/
responds
{
  "title": "Open Space",
  "description": "A desk in our coworking space",
  "is_active": false,
  "period_amount": 12000,
  "interval": "monthly"
}

Deletes a plan

DELETE /api/profile/{organization}/plans/{plan}/

A plan can only be deleted when there are no subscriptions to it. Even if all subscriptions to a plan have expired, the plan cannot be deleted. It should be de-activated instead such that no customers can subscribes to it.

The API is typically used within an HTML update plan page as present in the default theme.

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/

Lists subscriptions to a plan

GET /api/profile/{organization}/plans/{plan}/subscriptions/

Returns a list of 25 subscriptions to {plan} provided by {organization}.

The queryset can be further refined to match a search filter (q) and/or a range of dates ([start_at, ends_at]), and sorted on specific fields (o).

Query parameters
page
integer

A page number within the paginated result set.

o
string

sort by organization, plan, created_at, ends_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

q
string

search for matching text in organization__slug, organization__full_name, organization__email, organization__phone, organization__street_address, organization__locality, organization__region, organization__postal_code, organization__country, plan__title

start_at
string

date/time in ISO format after which records were created.

ends_at
string

date/time in ISO format before which records were created.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

accept_request_api_url
string

URL API endpoint to grant the subscription

remove_api_url
string

URL API endpoint to remove the subscription grant or request

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/premium/subscriptions/
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "xia",
      "full_name": "Xia Lee",
      "created_at": "2016-01-14T23:16:55Z",
      "ends_at": "2017-01-14T23:16:55Z"
    }
  ]
}

Grants a subscription

POST /api/profile/{organization}/plans/{plan}/subscriptions/

Subscribes a customer to the {plan} provided by {organization}.

Request body
organization
object required

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

message
string

Message to send along the invitation

Responses
created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

accept_request_api_url
string

URL API endpoint to grant the subscription

remove_api_url
string

URL API endpoint to remove the subscription grant or request

Examples

curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"organization": {"slug": "xia"}}' https://livedemo.djaoapp.com/api/profile/cowork/plans/premium/subscriptions/
responds
{
  "created_at": "2016-01-14T23:16:55Z",
  "ends_at": "2017-01-14T23:16:55Z",
  "description": null,
  "organization": {
    "slug": "xia",
    "printable_name": "Xia Lee"
  },
  "plan": {
    "slug": "open-space",
    "title": "Open Space",
    "description": "open space desk, High speed internet- Ethernet or WiFi, Unlimited printing,Unlimited scanning, Unlimited fax service(send and receive)",
    "is_active": true,
    "setup_amount": 0,
    "period_amount": 17999,
    "interval": "monthly",
    "app_url": "http://localhost:8020/app"
  },
  "auto_renew": true
}

Retrieves a subscription to a provider plan

GET /api/profile/{organization}/plans/{plan}/subscriptions/{subscriber}/

Returns the subscription of {subscriber} to {plan} from provider {organization}.

Responses
created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

accept_request_api_url
string

URL API endpoint to grant the subscription

remove_api_url
string

URL API endpoint to remove the subscription grant or request

Examples

curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/subscriptions/xia/
responds
{
  "created_at": "2019-01-01T00:00:00Z",
  "ends_at": "2020-01-01T00:00:00Z",
  "description": null,
  "organization": {
    "slug": "xia",
    "created_at": "2019-01-01T00:00:00Z",
    "full_name": "Xia Lee",
    "email": "xia@localhost.localdomain",
    "phone": "555-555-5555",
    "street_address": "350 Bay St.",
    "locality": "San Francisco",
    "region": "CA",
    "postal_code": "94133",
    "country": "US",
    "default_timezone": "UTC",
    "printable_name": "Xia Lee",
    "is_provider": false,
    "is_bulk_buyer": false,
    "type": "personal",
    "credentials": true,
    "extra": null
  },
  "plan": {
    "slug": "open-space",
    "title": "Open Space",
    "description": "open space desk",
    "is_active": true,
    "setup_amount": 0,
    "period_amount": 17999,
    "period_length": 1,
    "interval": "monthly",
    "unit": "cad",
    "organization": "cowork",
    "renewal_type": "auto-renew",
    "is_not_priced": false,
    "created_at": "2019-01-01T00:00:00Z",
    "skip_optin_on_grant": false,
    "optin_on_request": false,
    "extra": null
  },
  "auto_renew": true,
  "editable": true,
  "extra": null,
  "grant_key": null,
  "request_key": null
}

Updates a subscription to a provider plan

PUT /api/profile/{organization}/plans/{plan}/subscriptions/{subscriber}/

Updates the subscription of {subscriber} to {plan} from provider {organization}.

Request body
ends_at
string required

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

extra
string

Extra meta data (can be stringify JSON)

Responses
created_at
string

Date/time of creation (in ISO format)

ends_at
string

Date/time when the subscription period currently ends (in ISO format)

description
string

Free-form text description for the subscription

organization
object

Profile subscribed to the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

created_at
string

Date/time of creation (in ISO format)

email
string

E-mail address

phone
string

Phone number

street_address
string

Street address

locality
string

City/Town

region
string

State/Province/County

postal_code
string

Zip/Postal code

country
string

Country

default_timezone
string

Timezone to use when reporting metrics

is_provider
boolean

The profile can fulfill the provider side of a subscription.

is_bulk_buyer
boolean

Enable GroupBuy

extra
string

Extra meta data (can be stringify JSON)

detail
string

Describes the result of the action in human-readable form

plan
object

Plan the profile is subscribed to

slug
string

Unique identifier shown in the URL bar

title
string

Title for the plan

description
string

Free-form text description for the plan

is_active
boolean

True when customers can subscribe to the plan

setup_amount
integer

One-time amount to pay when the subscription starts

period_amount
integer

Amount billed every period

period_type
string

Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)

app_url
string

URL to the homepage for the profile associated to the plan

advance_discounts
array

Discounts when periods are paid in advance.

discount_type
string

Type of discount (periods, percentage or currency unit)

discount_value
integer

Amount of the discount

length
integer

Contract length associated with the period

unit
string

Three-letter ISO 4217 code for currency unit (ex: usd)

organization
object

Provider of the plan

slug
string

Unique identifier shown in the URL bar

full_name
string

Full name

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

type
string

One of 'organization', 'personal' or 'user'

credentials
boolean

True if the account has valid login credentials

extra
string

Extra meta data (can be stringify JSON)

period_length
integer

Number of periods for a subscription to the plan (defaults to 1)

renewal_type
string

What happens at the end of a subscription period (one-time, auto-renew, repeat)

is_not_priced
boolean

created_at
string

Date/time of creation (in ISO format)

skip_optin_on_grant
boolean

True when a subscriber can automatically be subscribed to the plan by its provider. Otherwise the subscriber must manually accept the subscription. (defaults to False)

optin_on_request
boolean

True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)

discounted_period_amount
string

Discounted amount for the first period

is_cart_item
string

The plan is part of the cart to checkout

detail
string

Describes the result of the action in human-readable form

auto_renew
boolean

The subscription is set to auto-renew at the end of the period

editable
string

True if the request user is able to update the subscription. Typically a manager for the plan provider.

extra
string

Extra meta data (can be stringify JSON)

grant_key
string

request_key
string

accept_request_api_url
string

URL API endpoint to grant the subscription

remove_api_url
string

URL API endpoint to remove the subscription grant or request

Examples

curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"ends_at": "2020-01-01T00:00:00Z", "description": "extended after call with customer"}' https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/subscriptions/xia/
responds
{
  "created_at": "2019-01-01T00:00:00Z",
  "ends_at": "2020-01-01T00:00:00Z",
  "description": null,
  "organization": {
    "slug": "xia",
    "created_at": "2019-01-01T00:00:00Z",
    "full_name": "Xia Lee",
    "email": "xia@localhost.localdomain",
    "phone": "555-555-5555",
    "street_address": "350 Bay St.",
    "locality": "San Francisco",
    "region": "CA",
    "postal_code": "94133",
    "country": "US",
    "default_timezone": "UTC",
    "printable_name": "Xia Lee",
    "is_provider": false,
    "is_bulk_buyer": false,
    "type": "personal",
    "credentials": true,
    "extra": null
  },
  "plan": {
    "slug": "open-space",
    "title": "Open Space",
    "description": "open space desk",
    "is_active": true,
    "setup_amount": 0,
    "period_amount": 17999,
    "period_length": 1,
    "interval": "monthly",
    "unit": "cad",
    "organization": "cowork",
    "renewal_type": "auto-renew",
    "is_not_priced": false,
    "created_at": "2019-01-01T00:00:00Z",
    "skip_optin_on_grant": false,
    "optin_on_request": false,
    "extra": null
  },
  "auto_renew": true,
  "editable": true,
  "extra": null,
  "grant_key": null,
  "request_key": null
}

Deletes a subscription to a provider plan

DELETE /api/profile/{organization}/plans/{plan}/subscriptions/{subscriber}/

Unsubscribes {subscriber} from {plan} provided by {organization}.

Responses

204 No Content

Examples

curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/subscriptions/xia/

Lists users and their role on an profile

GET /api/profile/{organization}/roles/
Query parameters
page
integer

A page number within the paginated result set.

q
string

search for matching text in organization__slug, organization__full_name, organization__email, user__username, user__email, role_description__title, role_description__slug

o
string

sort by full_name, username, role_name, grant_key, request_key, created_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
invited_count
integer

Number of user invited to have a role

requested_count
integer

Number of user requesting a role

count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

created_at
string

Date/time of creation (in ISO format)

user
object

User with the role

slug
string

Username