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 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:
- JSON Web Token through the Authentication API
- HTTP Cookie through the Login HTML page
- API Key downloaded from a user profile page
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
Browse the API endpoints by ...
roles
models
By workflows
Auth & credentials
- Activates a user
- Authenticates a user
- Enables multi-factor authentication
- Logs a user out
- Refreshes a JSON Web Token
- Registers a user
- Resets a user password
- Resets a user secret API key
- Retrieves contact from an activation key
- Sends a verification link
- Sends an activation link
- Updates a user password
- Updates a user public RSA key
- Verifies a JSON Web Token
This section contains APIs related to authenticating users such as registration, login, updating a user password, etc.
Billing
- Adds an item to the user cart
- Adds to the order balance
- Cancels a balance due
- Checkouts a cart
- Creates a discount code
- Creates an offline transaction
- Deletes a discount code
- Deletes a payment method
- Lists discount codes
- Lists ledger transactions
- Lists processor charges
- Lists provider payouts
- Lists provider receivables
- Lists subscriber transactions
- Re-sends a charge receipt
- Redeems a discount code
- Refunds a processor charge
- Removes an item from the user cart
- Retrieves a cart for checkout
- Retrieves a customer balance
- Retrieves a discount code
- Retrieves a payment method
- Retrieves a payout account
- Retrieves a processor charge
- Updates a discount code
- Updates a payment method
- Uploads multiple items into a user cart
This section contains APIs to manage the checkout, billing and accounting workflows, including shopping carts, coupons, charges and balance statements.
Metrics
- Creates a row in a balance sheet
- Deletes a row in a balance sheet
- Lists top of funnel registered users
- Retrieves 12-month trailing customer counts
- Retrieves 12-month trailing deferred balances
- Retrieves 12-month trailing plans performance
- Retrieves 12-month trailing revenue
- Retrieves a balance sheet
- Retrieves a row in a balance sheet
- Retrieves churned vs. new subscribers for a federation
- Retrieves customers lifetime value
- Retrieves performance of a discount code
- Retrieves recently active users
- Retrieves row headers for a balance sheet
- Retrieves shared profiles within a federation
- Updates a row in a balance sheet
The metrics APIs crunch the numbers and return various insight into the performance for the business. They are used to implement a balances dashboard for example.
Profile
- Changes a user notifications preferences
- Creates a connected profile
- Creates a shadow profile
- Creates a user account
- Deletes a billing profile
- Deletes a user account
- Lists a user notifications preferences
- Lists activities for a user
- Lists billing profiles
- Lists billing profiles with a user as a profile manager
- Lists user accounts
- Records new activity with a user
- Retrieves a billing profile
- Retrieves a login profile
- Retrieves a profile summary
- Searches profile and user accounts
- Searches profiles
- Searches users
- Signs a consent agreement
- Updates a billing profile
- Updates a user account
This section contains APIs to manage the identity, such as name or email address, of users and organizations registered to the site.
Roles & rules
- Accepts role invite
- Creates a connected profile
- Creates a role
- Creates a role type
- Creates an access rule
- Deletes a role
- Deletes a role by type
- Deletes a role type
- Deletes an access rule
- Grants a subscription request
- Lists access rules
- Lists billing profiles with a user as a profile manager
- Lists role types
- Lists roles by user
- Lists roles of a specific type
- Lists roles of specific type by user
- Lists users and their role on an profile
- Requests a role
- Requests a role of a specified type
- Retrieves a role type
- Retrieves an access rule
- Retrieves engagement metrics
- Retrieves example session
- Retrieves forward end-point
- Retrieves users engagement
- Rotates session encoding key
- Sends invite notification for a role
- Sends request notification for role
- Updates a role type
- Updates an access rule
- Updates forward end-point
This section contains APIs to manage roles and access rules.
Subscriptions
- Cancels subscription
- Creates a plan
- Deletes a plan
- Grants a subscription
- Lists a provider plans
- Lists engaged subscribers
- Lists expired subscriptions
- Lists inactive subscribers
- Lists plan active subscriptions
- Lists plan churned subscriptions
- Lists plan subscriptions
- Lists present subscriptions
- Lists pricing plans
- Lists provider active subscriptions
- Lists provider churned subscriptions
- Lists provider subscriptions
- Lists subscribers
- Retrieves a plan
- Retrieves a plan subscription
- Retrieves a subscriber subscription
- Unsubscribes at a future date
- Unsubscribes now
- Updates a plan
- Updates a plan subscription
This section contains APIs to manage 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
- API version
- Activates a user
- Adds an item to the user cart
- Authenticates a user
- List legal agreements
- Lists pricing plans
- Redeems a discount code
- Registers a user
- Removes an item from the user cart
- Resets a user password
- Retrieves a legal agreement
- Retrieves contact from an activation key
- Sends a contact-us message
- Sends a verification link
This section contains APIs related to unauthenticated users.
Users
- Accepts role invite
- Changes a user notifications preferences
- Creates a connected profile
- Creates a shadow profile
- Deletes a user account
- Enables multi-factor authentication
- Lists a user notifications preferences
- Lists billing profiles with a user as a profile manager
- Lists roles by user
- Lists roles of specific type by user
- Logs a user out
- Refreshes a JSON Web Token
- Requests a role
- Requests a role of a specified type
- Resets a user secret API key
- Retrieves a login profile
- Searches profile and user accounts
- Searches profiles
- Searches users
- Sends an activation link
- Sends request notification for role
- Signs a consent agreement
- Updates a user account
- Updates a user password
- Updates a user public RSA key
- Verifies a JSON Web Token
This section contains APIs related to authenticated users.
Subscribers
- Adds to the order balance
- Checkouts a cart
- Creates a role
- Creates a role type
- Deletes a billing profile
- Deletes a payment method
- Deletes a role
- Deletes a role type
- Lists expired subscriptions
- Lists present subscriptions
- Lists role types
- Lists subscriber transactions
- Lists users and their role on an profile
- Re-sends a charge receipt
- Retrieves a billing profile
- Retrieves a cart for checkout
- Retrieves a customer balance
- Retrieves a payment method
- Retrieves a processor charge
- Retrieves a profile summary
- Retrieves a role type
- Retrieves a subscriber subscription
- Sends invite notification for a role
- Unsubscribes at a future date
- Unsubscribes now
- Updates a billing profile
- Updates a payment method
- Updates a role type
This section contains APIs related to subscribers.
Providers
- Cancels a balance due
- Cancels subscription
- Creates a discount code
- Creates a plan
- Creates an offline transaction
- Deletes a discount code
- Deletes a plan
- Grants a subscription
- Grants a subscription request
- Lists a provider plans
- Lists discount codes
- Lists engaged subscribers
- Lists inactive subscribers
- Lists plan active subscriptions
- Lists plan churned subscriptions
- Lists plan subscriptions
- Lists provider active subscriptions
- Lists provider churned subscriptions
- Lists provider payouts
- Lists provider receivables
- Lists provider subscriptions
- Lists subscribers
- Refunds a processor charge
- Retrieves 12-month trailing customer counts
- Retrieves 12-month trailing deferred balances
- Retrieves 12-month trailing plans performance
- Retrieves 12-month trailing revenue
- Retrieves a discount code
- Retrieves a payout account
- Retrieves a plan
- Retrieves a plan subscription
- Retrieves churned vs. new subscribers for a federation
- Retrieves customers lifetime value
- Retrieves performance of a discount code
- Retrieves shared profiles within a federation
- Updates a discount code
- Updates a plan
- Updates a plan subscription
This section contains APIs related to providers.
Broker
- Creates a legal agreement
- Creates a row in a balance sheet
- Creates a user account
- Creates an access rule
- Deletes a legal agreement
- Deletes a row in a balance sheet
- Deletes an access rule
- List legal agreements (broker)
- Lists access rules
- Lists activities for a user
- Lists ledger transactions
- Lists processor charges
- Lists top of funnel registered users
- Lists user accounts
- Records new activity with a user
- Removes custom theme
- Retrieves a balance sheet
- Retrieves a legal agreement
- Retrieves a legal agreement (broker)
- Retrieves a row in a balance sheet
- Retrieves an access rule
- Retrieves engagement metrics
- Retrieves example session
- Retrieves forward end-point
- Retrieves recently active users
- Retrieves row headers for a balance sheet
- Retrieves users engagement
- Rotates session encoding key
- Sends a test notification e-mail
- Updates a legal agreement
- Updates a row in a balance sheet
- Updates an access rule
- Updates forward end-point
- Uploads a theme package
This section contains APIs related to the broker.
By datamodels
Users
- Activates a user
- Authenticates a user
- Changes a user notifications preferences
- Creates a connected profile
- Creates a user account
- Deletes a user account
- Enables multi-factor authentication
- Lists a user notifications preferences
- Lists activities for a user
- Lists billing profiles with a user as a profile manager
- Lists top of funnel registered users
- Lists user accounts
- Logs a user out
- Records new activity with a user
- Refreshes a JSON Web Token
- Registers a user
- Resets a user password
- Resets a user secret API key
- Retrieves a login profile
- Retrieves contact from an activation key
- Sends a verification link
- Sends an activation link
- Signs a consent agreement
- Updates a user account
- Updates a user password
- Updates a user public RSA key
- Verifies a JSON Web Token
This section contains APIs related to users.
A user represents a individual (or bot) with login credentials. Technically a user, after authentication, holds a session token that is passed to the server on each HTTP request. Users call API end points, and hold permissions to do so, through roles on organization and personal profiles.
Users are required to sign the terms of use of a site.
Profiles
- Deletes a billing profile
- Deletes a payment method
- Lists inactive subscribers
- Lists subscribers
- Retrieves 12-month trailing customer counts
- Retrieves a billing profile
- Retrieves a payment method
- Retrieves a payout account
- Retrieves a profile summary
- Retrieves customers lifetime value
- Updates a billing profile
- Updates a payment method
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
- Accepts role invite
- Creates a role
- Creates a role type
- Deletes a role
- Deletes a role type
- Lists engaged subscribers
- Lists role types
- Lists roles by user
- Lists roles of specific type by user
- Lists users and their role on an profile
- Requests a role
- Requests a role of a specified type
- Retrieves a role type
- Sends invite notification for a role
- Sends request notification for role
- Updates a role type
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
- Cancels subscription
- Grants a subscription
- Grants a subscription request
- Lists expired subscriptions
- Lists plan active subscriptions
- Lists plan churned subscriptions
- Lists plan subscriptions
- Lists present subscriptions
- Lists provider active subscriptions
- Lists provider churned subscriptions
- Lists provider subscriptions
- Retrieves a plan subscription
- Retrieves a subscriber subscription
- Unsubscribes at a future date
- Unsubscribes now
- Updates a plan subscription
This section contains APIs related to subscriptions.
The subscription model defines the relationship between a subscriber and a provider through a plan.
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
This section contains APIs related to ad-hoc discounts.
Transactions
- Cancels a balance due
- Creates a row in a balance sheet
- Creates an offline transaction
- Deletes a row in a balance sheet
- Lists ledger transactions
- Lists provider payouts
- Lists provider receivables
- Lists subscriber transactions
- Retrieves 12-month trailing deferred balances
- Retrieves 12-month trailing revenue
- Retrieves a balance sheet
- Retrieves a customer balance
- Retrieves a row in a balance sheet
- Retrieves row headers for a balance sheet
- Updates a row in a balance sheet
This section contains APIs related to transactions.
Transactions are recorded in an append-only double-entry book keeping ledger.
Site
- Creates an access rule
- Deletes an access rule
- Lists access rules
- Removes custom theme
- Retrieves an access rule
- Retrieves engagement metrics
- Retrieves example session
- Retrieves forward end-point
- Retrieves recently active users
- Retrieves users engagement
- Rotates session encoding key
- Updates an access rule
- Updates forward end-point
- Uploads a theme package
This section contains APIs related to site theme and operations.
API version
GET /api
Retrieves version of the API
Responses
Version of the API being used
curl https://livedemo.djaoapp.com/api
responds
{ "version": "2023-09-22" }
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
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name. searches all fields when unspecified.
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
Total number of items in the results
items in the queryset
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts?q=xi
responds
{ "count": 1, "results": [ { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true } ] }
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
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name. searches all fields when unspecified.
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
Total number of items in the results
items in the queryset
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts/profiles?q=xi
responds
{ "count": 1, "results": [ { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true } ] }
Creates a shadow profile
POST /api/accounts/profiles
Creates a profile that is not associated to any user.
Request body
Unique identifier shown in the URL bar
URL location of the profile picture
One of 'organization', 'personal' or 'user'
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Responses
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
curl -H 'Authorization: Bearer JWT auth token' -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/accounts/profiles
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 profile summary
GET /api/accounts/profiles/{profile}
While the profiles typeahead API returns a list of profiles summary based on search criteria, if you already know the unique slug of a profile, you can get the same summary by using this API.
Responses
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts/profiles/xia
responds
{ "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "organization", "credentials": true }
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
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: username, first_name, last_name, email, slug, full_name. searches all fields when unspecified.
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.
Responses
Total number of items in the results
items in the queryset
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/accounts/users?q=ali
responds
{ "count": 1, "results": [ { "slug": "alice", "username": "alice", "printable_name": "Alice Cooper", "picture": null } ] }
List legal agreements (broker)
GET /api/agreements
List all legal agreements a user might be requested to sign. This is a convenience API for authenticated broker profile managers. For listing legal agreements publicly, see GET /api/legal.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by title, updated_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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, title. searches all fields when unspecified.
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Short description of the agreement
Date/time the agreement was last updated (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/agreements
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "terms-of-use", "title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z" } ] }
Creates a legal agreement
POST /api/agreements
Creates a new legal agreement a user might be requested to sign.
All users visiting an URL decorated with an "Agreed to {agreement}" access control rule will be prompted to sign the agreement.
Request body
Short description of the agreement
Date/time of (in ISO format)
Responses
Unique identifier shown in the URL bar
Short description of the agreement
Date/time the agreement was last updated (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Terms of Use"}' https://livedemo.djaoapp.com/api/agreements
responds
{ "slug": "terms-of-use", "title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z" }
Retrieves a legal agreement (broker)
GET /api/agreements/{document}
Retrieves the text of legal agreement a user might be requested to sign. This is a convenience API for authenticated broker profile managers. For retrieving the text of a legal agreement publicly, see GET /api/legal/{agreement}.
Responses
Unique identifier shown in the URL bar
Short description of the agreement
Date/time the agreement was last updated (in ISO format)
Text of the agreement
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/agreements/terms-of-use
responds
{ "slug": "terms-of-use", "title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z", "text": "..." }
Updates a legal agreement
PUT /api/agreements/{document}
Updates the latest modification date of a legal agreement a user might be requested to sign.
All users visiting an URL decorated with an "Agreed to {agreement}" access control rule will be prompted to sign the agreement again if the last time they signed is older that the updated_at date set here.
Request body
Short description of the agreement
Date/time of (in ISO format)
Responses
Unique identifier shown in the URL bar
Short description of the agreement
Date/time the agreement was last updated (in ISO format)
Text of the agreement
curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z"}' https://livedemo.djaoapp.com/api/agreements/terms-of-use
responds
{ "slug": "terms-of-use", "title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z", "text": "..." }
Deletes a legal agreement
DELETE /api/agreements/{document}
Deletes a legal agreement a user might be requested to sign.
This will remove the agreement as well as all user signatures of it.
Responses
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/agreements/terms-of-use
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
Password of the user making the HTTP request
One-time code. This field will be checked against an expected code when multi-factor authentication (MFA) is enabled.
Email verification code.
Phone verification code.
Username, e-mail address or phone number to identify the account
Responses
Token used to authenticate user on every HTTP request
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 contact from an activation key
GET /api/auth/activate/{verification_key}
Retrieves information about a contact or user associated to the activation 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
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
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
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
Password with which a user can authenticate with the service
Responses
Token used to authenticate user on every HTTP request
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"username": "joe1", "email": "joe1@locahost.localdomain", "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
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/auth/logout
Sends a verification link
POST /api/auth/recover
Sends a one time code to verify an e-mail or phone number.
The user is uniquely identified by her email address or phone number.
The API is typically used within an HTML recover credentials page as present in the default theme.
Request body
Email or phone number to recover the account
Responses
Email or phone number to recover the account
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
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
Password with which a user can authenticate with the service
Organization name that owns the billing, registered with the user as profile manager
Street address for the billing profile
City/Town for the billing profile
State/Province/County for the billing profile
Zip/Postal Code for the billing profile
Country for the billing profile
Type of the accounts being registered
Terms Of Use
Security Policy
Responses
Token used to authenticate user on every HTTP request
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"email": "joe+1@example.com", "full_name": "Joe Card1", "new_password": "yoyo", "username": "joe1"}' https://livedemo.djaoapp.com/api/auth/register
responds
{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImpvZTEiLCJlbWFpbCI6ImpvZSsxQGRqYW9kamluLmNvbSIsImZ1bGxfbmFtZSI6IkpvZSAgQ2FyZDEiLCJleHAiOjE1Mjk2NTUyMjR9.GFxjU5AvcCQbVylF1PJwcBUUMECj8AKxsHtRHUSypco" }
Resets a user password
POST /api/auth/reset/{verification_key}
Resets a user password, hence triggering an activation workflow the next time a user attempts to login.
Responses
Describes the reason for the error in plain text
curl -X POST https://livedemo.djaoapp.com/api/auth/reset/16793aa72a4c7ae94b50b20c2eca52df5b0fe2c6
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 used to authenticate user on every HTTP request
Responses
Token used to authenticate user on every HTTP request
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 used to authenticate user on every HTTP request
Responses
Token used to authenticate user on every HTTP request
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 page_size 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, processor_key, customer__full_name. searches all fields when unspecified.
Responses
The sum of all record amounts (in unit)
Three-letter ISO 4217 code for currency unit (ex: usd)
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Total amount in currency unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Amount and unit in a commonly accepted readable format
Description for the charge as appears on billing statements
Last 4 digits of the credit card used
Expiration date of the credit card used
Unique identifier returned by the payment processor
Current state (i.e. created, done, failed, disputed)
Feedback for the user in plain text
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" } ] }
Lists ledger transactions
GET /api/billing/transactions
Returns a list of page_size 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, dest_profile, dest_profile__full_name, orig_profile, orig_profile__full_name. searches all fields when unspecified.
sort by description, amount, dest_profile, dest_profile__full_name, dest_account, orig_profile, orig_profile__full_name, 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 of the date range for which the balance was computed
End of the date range for which the balance was computed
Balance of all transactions in cents (i.e. 100ths) of unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
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_profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true }, "orig_amount": 112120, "orig_unit": "usd", "dest_account": "Funds", "dest_profile": { "slug": "stripe", "printable_name": "Stripe", "picture": null, "type": "organization", "credentials": false }, "dest_amount": 112120, "dest_unit": "usd" } ] }
Retrieves a customer balance
GET /api/billing/{profile}/balance
Get the statement balance due for a billing profile.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, dest_profile, dest_profile__full_name, orig_profile, orig_profile__full_name. searches all fields when unspecified.
sort by description, amount, dest_profile, dest_profile__full_name, dest_account, orig_profile, orig_profile__full_name, 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 of the date range for which the balance was computed
End of the date range for which the balance was computed
Balance of all transactions in cents (i.e. 100ths) of unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/xia/balance
responds
{ "balance_amount": "1200", "balance_unit": "usd", "start_at": "2023-01-01T00:00:00Z", "ends_at": "2023-06-01T23:42:13.863739Z", "count": 1, "next": null, "previous": null, "results": [ { "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_profile": { "slug": "cowork", "printable_name": "Coworking Space", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 2000, "orig_unit": "usd", "dest_account": "Payable", "dest_profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "dest_amount": 2000, "dest_unit": "usd" } ] }
Adds to the order balance
POST /api/billing/{profile}/balance
This API endpoint can be used to add use charges to a subscriber invoice while charging the subscriber at a later date.
Request body
The plan to add into the request.user cart.
Index in the list of discounts for advance payments
The use charge to add into the request.user cart.
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Responses
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"plan": "premium", "use": "requests"}' https://livedemo.djaoapp.com/api/billing/xia/balance
responds
{ "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_profile": { "slug": "cowork", "printable_name": "Coworking Space", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 2000, "orig_unit": "usd", "dest_account": "Payable", "dest_profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "dest_amount": 2000, "dest_unit": "usd" }
Cancels a balance due
DELETE /api/billing/{profile}/balance
Cancel the balance due by profile. 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).
Query parameters
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, dest_profile, dest_profile__full_name, orig_profile, orig_profile__full_name. searches all fields when unspecified.
sort by description, amount, dest_profile, dest_profile__full_name, dest_account, orig_profile, orig_profile__full_name, 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
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/billing/xia/balance
Retrieves a payout account
GET /api/billing/{profile}/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
Name of the deposit account
Last 4 characters of the deposit account identifier
Amount available to transfer to the provider deposit account
Three-letter ISO 4217 code for currency unit (ex: usd)
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/{profile}/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
Keys to authenticate the client with the payment processor
Processor public key (Stripe)
PaymentIntent or SetupIntent secret for SCA (Stripe)
Connected account identifier (Stripe)
Last 4 digits of the credit card on file
Expiration date of the credit card on file
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/{profile}/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
Processor token to retrieve the payment method
Full name
E-mail address for the account
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Responses
Keys to authenticate the client with the payment processor
Processor public key (Stripe)
PaymentIntent or SetupIntent secret for SCA (Stripe)
Connected account identifier (Stripe)
Last 4 digits of the credit card on file
Expiration date of the credit card on file
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/{profile}/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
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/billing/xia/card
Retrieves a processor charge
GET /api/billing/{profile}/charges/{charge}
Pass through to the processor and returns details about a Charge.
Responses
Date/time of creation (in ISO format)
Total amount in currency unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Amount and unit in a commonly accepted readable format
Description for the charge as appears on billing statements
Last 4 digits of the credit card used
Expiration date of the credit card used
Unique identifier returned by the payment processor
Current state (i.e. created, done, failed, disputed)
Feedback for the user in plain text
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/billing/xia/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/{profile}/charges/{charge}/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 identifier (i.e. matches the URL {charge} parameter)
E-mail address to which the receipt was sent.
Feedback for the user in plain text
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/billing/xia/charges/ch_XAb124EF/email
responds
{ "charge_id": "ch_XAb124EF", "email": "joe@localhost.localdomain" }
Refunds a processor charge
POST /api/billing/{profile}/charges/{charge}/refund
Partially or totally refund all or a subset of line items on a Charge.
Request body
Line items in a charge to be refunded
Line item index counting from zero.
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
Date/time of creation (in ISO format)
Total amount in currency unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Amount and unit in a commonly accepted readable format
Description for the charge as appears on billing statements
Last 4 digits of the credit card used
Expiration date of the credit card used
Unique identifier returned by the payment processor
Current state (i.e. created, done, failed, disputed)
Feedback for the user in plain text
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/xia/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" }
Retrieves a cart for checkout
GET /api/billing/{profile}/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
Keys to authenticate the client with the payment processor
Processor public key (Stripe)
PaymentIntent or SetupIntent secret for SCA (Stripe)
Connected account identifier (Stripe)
Items that will be charged
Subscription lines and options refer to.
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
Line items to charge on checkout.
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
Options to replace line items.
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
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, "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "basic", "title": "Basic" }, "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_profile": { "slug": "cowork", "printable_name": "Coworking Space", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 2000, "orig_unit": "usd", "dest_account": "Payable", "dest_profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "dest_amount": 2000, "dest_unit": "usd" } ], "options": [] } ] }
Checkouts a cart
POST /api/billing/{profile}/checkout
Places an order for the subscription items in the cart and creates a Charge on the billing profile payment method.
If the charge fails a balance is due, to be collected later.
The cart is manipulated through various API endpoints:
Redeems a discount code applies a coupon code for a potential discount, and
Adds an item to the request user cart, Removes an item from the request user cart to update a cart.
The API is typically used within an HTML checkout page as present in the default theme.
Request body
List of indices, one per subscription that has multiple advance discount options
selected plan option during checkout
attaches the payment method to the profile when true
one-time token generated by the processorfrom the payment card.
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Responses
Date/time of creation (in ISO format)
Total amount in currency unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Amount and unit in a commonly accepted readable format
Description for the charge as appears on billing statements
Last 4 digits of the credit card used
Expiration date of the credit card used
Unique identifier returned by the payment processor
Current state (i.e. created, done, failed, disputed)
Feedback for the user in plain text
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/{profile}/coupons
Returns a list of page_size coupons created by a provider profile.
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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by amount, code, created_at, description, ends_at, discount_type, profile, profile__full_name. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: amount, code, description, discount_type, profile, profile__full_name. searches all fields when unspecified.
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier per provider, typically used in URLs
Type of discount ('percentage', 'currency', or 'period')
Amount of the discount
Date/time of creation (in ISO format)
Date/time at which the coupon code expires (in ISO format)
Free-form text description for the coupon
Number of times the coupon can be used
Coupon will only apply to this plan
Unique identifier shown in the URL bar
Title for the plan
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/{profile}/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
Unique identifier per provider, typically used in URLs
Type of discount ('percentage', 'currency', or 'period')
Amount of the discount
Date/time at which the coupon code expires (in ISO format)
Free-form text description for the coupon
Number of times the coupon can be used
Coupon will only apply to this plan
Responses
Unique identifier per provider, typically used in URLs
Type of discount ('percentage', 'currency', or 'period')
Amount of the discount
Date/time of creation (in ISO format)
Date/time at which the coupon code expires (in ISO format)
Free-form text description for the coupon
Number of times the coupon can be used
Coupon will only apply to this plan
Unique identifier shown in the URL bar
Title for the plan
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/{profile}/coupons/{coupon}
The API is typically used within an HTML coupons page as present in the default theme.
Responses
Unique identifier per provider, typically used in URLs
Type of discount ('percentage', 'currency', or 'period')
Amount of the discount
Date/time of creation (in ISO format)
Date/time at which the coupon code expires (in ISO format)
Free-form text description for the coupon
Number of times the coupon can be used
Coupon will only apply to this plan
Unique identifier shown in the URL bar
Title for the plan
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/{profile}/coupons/{coupon}
The API is typically used within an HTML coupons page as present in the default theme.
Request body
Unique identifier per provider, typically used in URLs
Type of discount ('percentage', 'currency', or 'period')
Amount of the discount
Date/time at which the coupon code expires (in ISO format)
Free-form text description for the coupon
Number of times the coupon can be used
Coupon will only apply to this plan
Responses
Unique identifier per provider, typically used in URLs
Type of discount ('percentage', 'currency', or 'period')
Amount of the discount
Date/time of creation (in ISO format)
Date/time at which the coupon code expires (in ISO format)
Free-form text description for the coupon
Number of times the coupon can be used
Coupon will only apply to this plan
Unique identifier shown in the URL bar
Title for the plan
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/{profile}/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
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/billing/cowork/coupons/DIS100
Lists subscriber transactions
GET /api/billing/{profile}/history
Returns a list of page_size transactions associated to a billing profile 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, dest_profile, dest_profile__full_name, orig_profile, orig_profile__full_name. searches all fields when unspecified.
sort by description, amount, dest_profile, dest_profile__full_name, dest_account, orig_profile, orig_profile__full_name, 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 of the date range for which the balance was computed
End of the date range for which the balance was computed
Balance of all transactions in cents (i.e. 100ths) of unit
Three-letter ISO 4217 code for currency unit (ex: usd)
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
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_profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true }, "orig_amount": 112120, "orig_unit": "usd", "dest_account": "Funds", "dest_profile": { "slug": "stripe", "printable_name": "Stripe", "picture": null, "type": "organization", "credentials": false }, "dest_amount": 112120, "dest_unit": "usd" } ] }
Lists provider receivables
GET /api/billing/{profile}/receivables
Returns a list of page_size transactions marked as receivables associated to a billing profile 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 a provider, whether it was paid or not.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, dest_profile, dest_profile__full_name, orig_profile, orig_profile__full_name. searches all fields when unspecified.
sort by description, amount, dest_profile, dest_profile__full_name, dest_account, orig_profile, orig_profile__full_name, 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
The sum of all record amounts (in unit)
Three-letter ISO 4217 code for currency unit (ex: usd)
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
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_profile": { "slug": "stripe", "printable_name": "Stripe", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 112120, "orig_unit": "usd", "dest_account": "Funds", "dest_profile": { "slug": "cowork", "printable_name": "Coworking Space", "picture": null, "type": "organization", "credentials": false }, "dest_amount": 112120, "dest_unit": "usd" } ] }
Lists provider payouts
GET /api/billing/{profile}/transfers
Returns a list of page_size transactions associated to a billing profile 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
A page number within the paginated result set.
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: description, dest_profile, dest_profile__full_name, orig_profile, orig_profile__full_name. searches all fields when unspecified.
sort by description, amount, dest_profile, dest_profile__full_name, dest_account, orig_profile, orig_profile__full_name, 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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
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_profile": { "slug": "stripe", "printable_name": "Stripe", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 112120, "orig_unit": "usd", "dest_account": "Funds", "dest_profile": { "slug": "cowork", "printable_name": "Coworking Space", "picture": null, "type": "organization", "credentials": false }, "dest_amount": 112120, "dest_unit": "usd" } ] }
Creates an offline transaction
POST /api/billing/{profile}/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
The subscription the offline transaction refers to.
Date/time of creation (in ISO format)
Total amount in currency unit
Free-form text description for the transaction
Responses
Describes the result of the action in human-readable form
transactions being created by the import
Date/time of creation (in ISO format)
Free-form text description for the transaction
Amount being transfered
True if the transaction is indentified as a debit in the API context
Source account from which funds are withdrawn
Billing profile from which funds are withdrawn
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount withdrawn from source in orig_unit
Three-letter ISO 4217 code for source currency unit (ex: usd)
Target account to which funds are deposited
Billing profile to which funds are deposited
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Amount deposited into target in dest_unit
Three-letter ISO 4217 code for target currency unit (ex: usd)
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_profile": { "slug": "djaoapp", "printable_name": "DjaoApp", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 1000, "orig_unit": "usd", "dest_account": "Payable", "dest_profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true }, "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_profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true }, "orig_amount": 1000, "orig_unit": "usd", "dest_account": "Funds", "dest_profile": { "slug": "djaoapp", "printable_name": "DjaoApp", "picture": null, "type": "organization", "credentials": false }, "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_profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true }, "orig_amount": 1000, "orig_unit": "usd", "dest_account": "Liability", "dest_profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true }, "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_profile": { "slug": "djaoapp", "printable_name": "DjaoApp", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 1000, "orig_unit": "usd", "dest_account": "Receivable", "dest_profile": { "slug": "djaoapp", "printable_name": "DjaoApp", "picture": null, "type": "organization", "credentials": false }, "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_profile": { "slug": "djaoapp", "printable_name": "DjaoApp", "picture": null, "type": "organization", "credentials": false }, "orig_amount": 20, "orig_unit": "usd", "dest_account": "Offline", "dest_profile": { "slug": "djaoapp", "printable_name": "DjaoApp", "picture": null, "type": "organization", "credentials": false }, "dest_amount": 20, "dest_unit": "usd" } ] }
Adds an item to the 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
The plan to add into the request.user cart.
Index in the list of discounts for advance payments
The use charge to add into the request.user cart.
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Responses
Date/time of creation (in ISO format)
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Describes the result of the action in human-readable form
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"plan": "premium", "option": 1}' https://livedemo.djaoapp.com/api/cart
responds
{ "plan": { "slug": "premium", "title": "Premium" }, "option": 1, "user": { "username": "xia", "slug": "xia", "full_name": "Xia Lee", "email": "xia@localhost.localdomain" } }
Removes an item from the user cart
DELETE /api/cart
Removes an item from the request.user cart.
Responses
204 No Content
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
Coupon code to redeem
Responses
Describes the reason for the error in plain text
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 user 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.
Request body
Items that have been created in the cart
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Rows that have been uploaded
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Rows that have failed to be created in the cart
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Responses
Items that have been created in the cart
Date/time of creation (in ISO format)
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Describes the result of the action in human-readable form
Rows that have been uploaded
Date/time of creation (in ISO format)
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Describes the result of the action in human-readable form
Rows that have failed to be created in the cart
Date/time of creation (in ISO format)
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Describes the result of the action in human-readable form
curl -X POST https://livedemo.djaoapp.com/api/cart/basic/upload
responds
{ "created": [ { "plan": { "slug": "basic", "title": "Basic" }, "user": { "username": "joe", "slug": "joe", "full_name": "Joe Smith", "email": "joesmith@example.com" } }, { "plan": { "slug": "basic", "title": "Basic" }, "user": { "username": "mariejohnson", "slug": "mariejohnson", "full_name": "Marie Johnson", "email": "mariejohnson@example.com" } } ], "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 the sender of the message wishes to be addressed as
Email address to reply to the sender
Description of the reason for contacting the provider
Responses
Describes the reason for the error in plain text
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 page_size activity records for user account {user}.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
value to search for in the fields specified by q_f
restrict searches to one or more fields in: text. searches all fields when unspecified.
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
User that created the activity
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Free form text description of the activity
Account the activity is associated to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
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", "text": "Phone call", "created_by": { "username": "alice", "printable_name": "Alice", "picture": null, "slug": "alice" }, "account": null }, { "created_at": "2018-01-02T00:00:00Z", "text": "Follow up e-mail", "created_by": { "username": "alice", "printable_name": "Alice", "picture": null, "slug": "alice" }, "account": { "slug": "cowork", "printable_name": "Coworking Space", "picture": null, "type": "organization", "credentials": false } } ] }
Records new activity with a user
POST /api/contacts/{user}/activities
Request body
Free form text description of the activity
Account the activity is associated to
Responses
Free form text description of the activity
Account the activity is associated to
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"text": "Phone call", "account": "cowork"}' https://livedemo.djaoapp.com/api/contacts/xia/activities
responds
{ "text": "Phone call", "account": "cowork" }
List legal agreements
GET /api/legal
Returns a list of page_size legal agreements a user might be requested to sign such as "terms of use" or "security policy". This end point can be used by unauthenticated users. As such it is perfect for legal disclosure pages.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by title, updated_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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, title. searches all fields when unspecified.
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Short description of the agreement
Date/time the agreement was last updated (in ISO format)
curl https://livedemo.djaoapp.com/api/legal
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "terms-of-use", "title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z" } ] }
Retrieves a legal agreement
GET /api/legal/{agreement}
Retrieves the text of legal agreement a user might be requested to sign. This end point can be used by unauthenticated users. As such it is perfect for legal disclosure pages.
Responses
Unique identifier shown in the URL bar
Short description of the agreement
Date/time the agreement was last updated (in ISO format)
Text of the agreement
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/legal/terms-of-use
responds
{ "slug": "terms-of-use", "title": "Terms of Use", "updated_at": "2023-08-16T00:00:00Z", "text": "..." }
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
I have read and understand these terms and conditions
Responses
I have read and understand these terms and conditions
Date/time of signature (in ISO format)
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
date/time in ISO format
date/time in ISO format
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
Unique key in the table for the data series
Title of data serie that can be safely used for display in HTML pages
Extra meta data (can be stringify JSON)
List of (datetime, integer) couples that represents the data serie
Filter on transaction accounts
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/balances/taxes
responds
{ "scale": 0.01, "unit": "usd", "title": "Balances: taxes", "results": [ { "slug": "sales", "title": "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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Title for the row
Filter on transaction accounts
Absolute position of the row in the list of rows for the table
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 for the row
Filter on transaction accounts
Absolute position of the row in the list of rows for the table
Responses
Title for the row
Filter on transaction accounts
Absolute position of the row in the list of rows for the table
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 for the row
Filter on transaction accounts
Absolute position of the row in the list of rows for the table
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 for the row
Filter on transaction accounts
Absolute position of the row in the list of rows for the table
Responses
Title for the row
Filter on transaction accounts
Absolute position of the row in the list of rows for the table
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
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 page_size 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: username, first_name, last_name, email, slug, full_name. searches all fields when unspecified.
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.
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/registered
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "alice", "username": "alice", "printable_name": "Alice Cooper", "picture": null } ] }
Retrieves 12-month trailing deferred balances
GET /api/metrics/{profile}/balances
Generate a table of revenue (rows) per months (columns) for a default balance sheet (Income, Backlog, Receivable).
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
Unique key in the table for the data series
Title of data serie that can be safely used for display in HTML pages
Extra meta data (can be stringify JSON)
List of (datetime, integer) couples that represents the data serie
Filter on transaction accounts
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/balances
responds
{ "title": "Balances", "scale": 0.01, "unit": "usd", "results": [ { "slug": "income", "title": "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 ] ] }, { "slug": "backlog", "title": "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 ] ] }, { "slug": "Receivable", "title": "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 ] ] } ] }
Retrieves performance of a discount code
GET /api/metrics/{profile}/coupons/{coupon}
Returns a list of page_size cart items on which coupon with code {coupon} was used. Coupon {coupon} must have been created by the specified 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).
Query parameters
date/time in ISO format
date/time in ISO format
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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: user__username, user__first_name, user__last_name, user__email. searches all fields when unspecified.
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
User the cart belongs to
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Item in the cart (if plan)
Unique identifier shown in the URL bar
Title for the plan
Index in the list of discounts for advance payments
Item added to the cart (if use charge)
Number of periods to be paid in advance
identifier of the person that will benefit from the subscription (GroupBuy)
Full name of the person that will benefit from the subscription (GroupBuy)
e-mail of the person that will benefit from the subscription (GroupBuy)
Describes the result of the action in human-readable form
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", "username": "xia", "title": "Xia Lee", "picture": null }, "plan": { "slug": "basic", "title": "Basic" }, "created_at": "2014-01-01T09:00:00Z" } ] }
Retrieves 12-month trailing customer counts
GET /api/metrics/{profile}/customers
The API is typically used within an HTML revenue page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
Unique key in the table for the data series
Title of data serie that can be safely used for display in HTML pages
Extra meta data (can be stringify JSON)
List of (datetime, integer) couples that represents the data serie
Filter on transaction accounts
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/customers
responds
{ "title": "Customers", "results": [ { "slug": "total-customers", "title": "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 ] ] }, { "slug": "new-customers", "title": "# 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 ] ] }, { "slug": "churned-customers", "title": "# 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 ] ] }, { "slug": "net-new-customers", "title": "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 ] ] } ] }
Retrieves churned vs. new subscribers for a federation
GET /api/metrics/{profile}/federated
Returns the number of churned vs. new subscribers per plans for a period for all members of a federation of provider.
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
Unique key in the table for the data series
Title of data serie that can be safely used for display in HTML pages
Extra meta data (can be stringify JSON)
List of (datetime, integer) couples that represents the data serie
Filter on transaction accounts
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/federated
responds
{ "title": "Invited", "scale": 1, "unit": "profiles", "results": [ { "slug": "removed-profiles", "title": "removed profiles", "values": [ [ "Energy utility", 0 ] ] }, { "slug": "invited-profiles", "title": "invited profiles", "values": [ [ "Energy utility", 0 ] ] }, { "slug": "newly-invited-profiles", "title": "newly invited profiles", "values": [ [ "Energy utility", 0 ] ] } ] }
Retrieves shared profiles within a federation
GET /api/metrics/{profile}/federated/shared
Returns the number of shared profiles
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/federated/shared
responds
{ "title": "shared profiles", "scale": 1, "unit": "profiles", "results": [ { "slug": "shared", "title": "Shared", "values": [ [ "Energy utility", 0 ] ] } ] }
Retrieves 12-month trailing revenue
GET /api/metrics/{profile}/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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
Unique key in the table for the data series
Title of data serie that can be safely used for display in HTML pages
Extra meta data (can be stringify JSON)
List of (datetime, integer) couples that represents the data serie
Filter on transaction accounts
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/funds
responds
{ "title": "Amount", "scale": 0.01, "unit": "usd", "results": [ { "slug": "total-sales", "title": "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 ] ] }, { "slug": "new-sales", "title": "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 ] ] }, { "slug": "churned-sales", "title": "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 ] ] }, { "slug": "payments", "title": "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 ] ] }, { "slug": "refunds", "title": "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/{profile}/lifetimevalue
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Since when is the profile a subscriber
Current end date for the contract
Total value to be collected from the profile
Cash payments collected from the profile
The deferred revenue for the profile
Three-letter ISO 4217 code for currency unit (ex: usd)
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", "title": "Xia Lee", "picture": null, "type": "personal", "credentials": true, "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/{profile}/plans
The API is typically used within an HTML plans metrics page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
Responses
The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands of dollars)
Three-letter ISO 4217 code for currency unit (ex: usd)
Title for the table
Data series
Unique key in the table for the data series
Title of data serie that can be safely used for display in HTML pages
Extra meta data (can be stringify JSON)
List of (datetime, integer) couples that represents the data serie
Filter on transaction accounts
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/metrics/cowork/plans
responds
{ "title": "Active Subscribers", "results": [ { "is_active": true, "slug": "open-space", "title": "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, "slug": "open-plus", "title": "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, "slug": "private", "title": "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 ] ] } ] }
Sends a test notification e-mail
POST /api/notifications/{template}
Responses
Describes the result of the API call in plain text
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/notifications/user_contact
responds
{ "detail": "Test email sent to xia@example.com" }
Lists pricing plans
GET /api/pricing
Returns a list of page_size 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Provider of the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
Date/time of creation (in ISO format)
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Discounted amount for the first period
The plan is part of the cart to checkout
Describes the result of the action in human-readable form
curl https://livedemo.djaoapp.com/api/pricing
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "managed", "title": "Managed", "description": "Ideal for growing businesses", "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", "profile": "cowork", "extra": null, "skip_optin_on_grant": false, "optin_on_request": false } ] }
Lists billing profiles
GET /api/profile
Returns a list of page_size 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name. searches all fields when unspecified.
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
Short casual name used to address the contact (only available for 'personal' and 'user' accounts)
Preferred communication language (only available for 'personal' and 'user' accounts)
curl https://livedemo.djaoapp.com/api/profile?o=created_at\&ot=desc
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "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": "personal", "picture": "" } ] }
Retrieves a billing profile
GET /api/profile/{profile}
The API is typically used within an HTML contact information page as present in the default theme.
Responses
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
Active subscriptions for the profile
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Short casual name used to address the contact (only available for 'personal' and 'user' accounts)
Preferred communication language (only available for 'personal' and 'user' accounts)
Activities related to the account (only available for 'personal' and 'user' accounts)
Date/time of creation (in ISO format)
User that created the activity
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Free form text description of the activity
Account the activity is associated to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
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": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true } ] }
Updates a billing profile
PUT /api/profile/{profile}
Request body
Unique identifier shown in the URL bar
URL location of the profile picture
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Responses
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
Active subscriptions for the profile
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Short casual name used to address the contact (only available for 'personal' and 'user' accounts)
Preferred communication language (only available for 'personal' and 'user' accounts)
Activities related to the account (only available for 'personal' and 'user' accounts)
Date/time of creation (in ISO format)
User that created the activity
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Free form text description of the activity
Account the activity is associated to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
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/{profile}
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
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/xia
Lists a provider plans
GET /api/profile/{profile}/plans
Returns a list of page_size plans managed by a specified 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).
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Provider of the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
Date/time of creation (in ISO format)
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Discounted amount for the first period
The plan is part of the cart to checkout
Describes the result of the action in human-readable form
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 businesses", "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", "profile": "cowork", "extra": null, "skip_optin_on_grant": false, "optin_on_request": false } ] }
Creates a plan
POST /api/profile/{profile}/plans
Creates a new subscription plan that belongs to the specified provider.
Request body
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Responses
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Provider of the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
Date/time of creation (in ISO format)
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Discounted amount for the first period
The plan is part of the cart to checkout
Describes the result of the action in human-readable form
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, "period_type": "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, "period_type": "monthly" }
Retrieves a plan
GET /api/profile/{profile}/plans/{plan}
Returns the {plan} that belongs to the specified provider.
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
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Provider of the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
Date/time of creation (in ISO format)
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Discounted amount for the first period
The plan is part of the cart to checkout
Describes the result of the action in human-readable form
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, "period_type": "monthly" }
Updates a plan
PUT /api/profile/{profile}/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
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Responses
Unique identifier shown in the URL bar
Title for the plan
Free-form text description for the plan
True when customers can subscribe to the plan
One-time amount to pay when the subscription starts
Amount billed every period
Natural period length of a subscription to the plan (hourly, daily, weekly, monthly, yearly)
Discounts when periods are paid in advance.
Type of discount (periods, percentage or currency unit)
Amount of the discount
Contract length associated with the period (defaults to 1)
Variable pricing based on usage
Extra meta data (can be stringify JSON)
Three-letter ISO 4217 code for currency unit (ex: usd)
Provider of the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
Number of periods for a subscription to the plan (defaults to 1)
What happens at the end of a subscription period (one-time, auto-renew, repeat)
True if the plan has no pricing (i.e. contact us)
Payment required to access full service
Date/time of creation (in ISO format)
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)
True when a provider must manually accept a subscription to the plan initiated by a subscriber. (defaults to False)
Discounted amount for the first period
The plan is part of the cart to checkout
Describes the result of the action in human-readable form
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, "period_type": "monthly" }
Deletes a plan
DELETE /api/profile/{profile}/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
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space
Lists plan active subscriptions
GET /api/profile/{profile}/plans/{plan}/subscriptions
Returns a list of page_size subscriptions to a {plan} of the provider {profile} whose renewal date is later than the time at which the API call was made.
Optionnaly when an start_at query parameter is specified, the returned queryset is filtered such that each subscription start date (i.e. created_at field) is greater than start_at. Using the start_at query parameter, it is effectively possible to construct cohorts of active subscribers by period of initial subscription.
The queryset can be filtered for at least one field to match a search term (q).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used within an HTML subscribers page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/subscriptions?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, "profile": { "slug": "xia", "printable_name": "Xia Lee", "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true } ] }
Grants a subscription
POST /api/profile/{profile}/plans/{plan}/subscriptions
Subscribes a customer to the plan {plan} of the specified provider.
Request body
Profile subscribed to the plan
Unique identifier shown in the URL bar
URL location of the profile picture
One of 'organization', 'personal' or 'user'
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Message to send along the invitation
Responses
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"profile": {"slug": "xia", "full_name": "Xia Lee"}}' 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, "profile": { "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, "period_type": "monthly" }, "auto_renew": true }
Lists plan subscriptions
GET /api/profile/{profile}/plans/{plan}/subscriptions/all
Returns a list of page_size subscriptions to a plan {plan} of the provider {profile}.
The queryset can be filtered for at least one field to match a search term (q) and/or intersects a period (start_at, ends_at).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/premium/subscriptions/all
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" } ] }
Lists plan churned subscriptions
GET /api/profile/{profile}/plans/{plan}/subscriptions/churned
Returns a list of page_size subscriptions to a {plan} of the provider {profile} which have ended already at the time the API call was made.
Optionally by defining either start_at, ends_at , or both, it is possible to construct cohorts of subscribers that have churned within a period.
The queryset can be filtered for at least one field to match a search term (q).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used within an HTML subscribers page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/plans/open-space/subscriptions/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, "profile": { "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, "period_type": "monthly" }, "auto_renew": true } ] }
Retrieves a plan subscription
GET /api/profile/{profile}/plans/{plan}/subscriptions/{subscriber}
Returns the subscription of {subscriber} to a plan {plan} of the specified provider.
Responses
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
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", "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "description": null, "auto_renew": true, "extra": null, "grant_key": null, "request_key": null }
Updates a plan subscription
PUT /api/profile/{profile}/plans/{plan}/subscriptions/{subscriber}
Updates the subscription of {subscriber} to a plan {plan} of the specified provider.
Request body
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Responses
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
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", "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "description": null, "auto_renew": true, "extra": null, "grant_key": null, "request_key": null }
Cancels subscription
DELETE /api/profile/{profile}/plans/{plan}/subscriptions/{subscriber}
Provider cancels a {subscriber}'s subscription to a plan {plan}, effective at the time the API is called.
Responses
204 No Content
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/{profile}/roles
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
value to search for in the fields specified by q_f
restrict searches to one or more fields in: user, user__full_name, user__email, role, role__title. searches all fields when unspecified.
sort by profile__full_name, user, user__full_name, role__title, 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
Number of user invited to have a role
Number of user requesting a role
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
User with the role
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
Key to identify the grant of the role
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
Describes the result of the action in human-readable form
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/roles
responds
{ "count": 1, "next": null, "previous": null, "invited_count": 0, "requested_count": 0, "results": [ { "created_at": "2022-01-01T00:00:00Z", "role_description": { "title": "Manager", "slug": "manager", "profile": null }, "user": { "slug": "xia", "username": "xia", "printable_name": "Xia Lee", "picture": null }, "request_key": "1", "grant_key": null } ] }
Lists role types
GET /api/profile/{profile}/roles/describe
Lists roles by description``RoleDescription``.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, title. searches all fields when unspecified.
sort by slug, title. 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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/roles/describe
responds
{ "count": 2, "next": null, "previous": null, "results": [ { "created_at": "2023-01-01T00:00:00Z", "slug": "manager", "title": "Manager", "skip_optin_on_grant": false, "implicit_create_on_none": false, "is_global": true }, { "created_at": "2023-01-01T00:00:00Z", "slug": "contributor", "title": "Contributor", "skip_optin_on_grant": true, "implicit_create_on_none": false, "is_global": false, "profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true, "created_at": "2023-01-01T00:00:00Z" } } ] }
Creates a role type
POST /api/profile/{profile}/roles/describe
Creates a role that users can take on a profile.
Request body
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
Extra meta data (can be stringify JSON)
Responses
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Support"}' https://livedemo.djaoapp.com/api/profile/xia/roles/describe
responds
{ "created_at": "2023-01-01T00:00:00Z", "title": "Support", "slug": "support", "skip_optin_on_grant": false, "implicit_create_on_none": false, "is_global": false, "profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true, "created_at": "2023-01-01T00:00:00Z" } }
Retrieves a role type
GET /api/profile/{profile}/roles/describe/{role}
Responses
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/roles/describe/manager
responds
{ "created_at": "2023-01-01T00:00:00Z", "slug": "manager", "title": "Profile Manager", "skip_optin_on_grant": false, "implicit_create_on_none": false, "is_global": true }
Updates a role type
PUT /api/profile/{profile}/roles/describe/{role}
Request body
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
Extra meta data (can be stringify JSON)
Responses
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Associate"}' https://livedemo.djaoapp.com/api/profile/xia/roles/describe/support
responds
{ "created_at": "2023-01-01T00:00:00Z", "slug": "support", "title": "Associate", "skip_optin_on_grant": false, "implicit_create_on_none": false, "is_global": false, "profile": { "slug": "xia", "printable_name": "Xia", "picture": null, "type": "personal", "credentials": true, "created_at": "2023-01-01T00:00:00Z" } }
Deletes a role type
DELETE /api/profile/{profile}/roles/describe/{role}
Responses
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/xia/roles/describe/support
Lists roles of a specific type
GET /api/profile/{profile}/roles/{role}
Lists the specified role assignments for a profile.
Query parameters
value to search for in the fields specified by q_f
restrict searches to one or more fields in: user, user__full_name, user__email. searches all fields when unspecified.
sort by profile__full_name, user, user__full_name, role__title, 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
Number of user invited to have a role
Number of user requesting a role
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
User with the role
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
Key to identify the grant of the role
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
Describes the result of the action in human-readable form
curl https://livedemo.djaoapp.com/api/profile/cowork/roles/manager
responds
{ "count": 1, "next": null, "previous": null, "invited_count": 0, "requested_count": 0, "results": [ { "created_at": "2018-01-01T00:00:00Z", "role_description": { "name": "Manager", "slug": "manager", "profile": null }, "user": { "slug": "alice", "printable_name": "Alice Doe", "picture": null }, "request_key": "1", "grant_key": null } ] }
Creates a role
POST /api/profile/{profile}/roles/{role}
Attaches a user to a specified billing profile with a {role}, typically granting permissions to the user with regards to managing the profile (see Flexible Security Framework).
Request body
Username
E-mail of user to grant role onto profile (potentially generating an invite to the site)
Full name of user to grant role onto profile (potentially generating an invite to the site)
Message to send along the invitation
Responses
Date/time of creation (in ISO format)
User with the role
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
Key to identify the grant of the role
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
Describes the result of the action in human-readable form
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"slug": "xia"}' https://livedemo.djaoapp.com/api/profile/xia/roles/manager
responds
{ "created_at": "2023-01-01T00:00:00Z", "role_description": { "created_at": "2023-01-01T00:00:00Z", "title": "Profile Manager", "slug": "manager", "is_global": true }, "user": { "slug": "xia", "username": "xia", "printable_name": "Xia Lee", "picture": null }, "grant_key": null }
Sends invite notification for a role
POST /api/profile/{profile}/roles/{role}/{user}
Re-sends the notification that the {user} was granted a {role} on the specified billing profile.
Responses
Date/time of creation (in ISO format)
User with the role
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
Key to identify the grant of the role
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
Describes the result of the action in human-readable form
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/profile/xia/roles/manager/xia
responds
{ "created_at": "2023-01-01T00:00:00Z", "role_description": { "created_at": "2023-01-01T00:00:00Z", "title": "Profile Manager", "slug": "manager", "is_global": true }, "user": { "slug": "xia", "username": "xia", "printable_name": "Xia Lee", "picture": null }, "grant_key": null }
Deletes a role
DELETE /api/profile/{profile}/roles/{role}/{user}
Dettaches a {user} from one or all roles with regards to the specified billing profile, typically resulting in revoking permissions from the user to manage part of the profile.
Responses
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/xia/roles/manager/xia
Lists subscribers
GET /api/profile/{profile}/subscribers
Returns a list of page_size subscribers which have or had a subscription to a plan of the specified provider {profile}.
The queryset can be filtered for at least one field to match a search term (q) and/or intersects a period (start_at, ends_at).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used in search forms linked to providers.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name. searches all fields when unspecified.
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/subscribers?o=created_at\&ot=desc
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true } ] }
Grants a subscription request
POST /api/profile/{profile}/subscribers/accept/{request_key}
Accepts a subscription request identified by {request_key}. The subscription must be to a plan that belongs to the specified provider.
Responses
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/profile/cowork/subscribers/accept/a00000d0a0000001234567890123456789012345
responds
{ "created_at": "2019-01-01T00:00:00Z", "ends_at": "2020-01-01T00:00:00Z", "description": null, "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true, "extra": null, "grant_key": null, "request_key": null }
Lists engaged subscribers
GET /api/profile/{profile}/subscribers/engaged
Returns a list of page_size subscribers which have or had a subscription to a plan of the specified provider {profile}.
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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: first_name, last_name, profile, profile__full_name. searches all fields when unspecified.
sort by created_at, first_name, last_name, profile, profile__full_name. 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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
User with the role
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
Key to identify the grant of the role
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
Describes the result of the action in human-readable form
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/subscribers/engaged?o=created_at\&ot=desc
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "created_at": "2022-01-01T00:00:00Z", "user": { "slug": "xia23", "username": "xia23", "printable_name": "Xia23", "picture": null }, "role_description": { "created_at": "2022-01-01T00:00:00Z", "slug": "manager", "title": "Profile Manager", "skip_optin_on_grant": false, "implicit_create_on_none": false, "is_global": true, "profile": null, "extra": null }, "profile": { "slug": "xia23", "printable_name": "Xia23", "picture": null, "type": "organization", "credentials": false } } ] }
Lists provider active subscriptions
GET /api/profile/{profile}/subscribers/subscriptions
Returns a list of page_size subscriptions whose renewal date is later than the time at which the API call was made, and the owner of the subscription plan is the specified provider {profile}.
Optionnaly when an start_at query parameter is specified, the returned queryset is filtered such that each subscription start date (i.e. created_at field) is greater than start_at. Using the start_at query parameter, it is effectively possible to construct cohorts of active subscribers by period of initial subscription.
The queryset can be filtered for at least one field to match a search term (q).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used within an HTML subscribers page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/subscribers/subscriptions?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, "profile": { "slug": "xia", "printable_name": "Xia Lee", "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true } ] }
Lists provider subscriptions
GET /api/profile/{profile}/subscribers/subscriptions/all
Returns a list of page_size subscriber profiles which have or had a subscription to a plan of the specified provider.
The queryset can be filtered for at least one field to match a search term (q) and/or intersects a period (start_at, ends_at).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/subscribers/subscriptions/all?o=created_at\&ot=desc
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "created_at": "2016-01-14T23:16:55Z", "ends_at": "2022-01-14T23:16:55Z", "description": null, "profile": { "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, "period_type": "monthly" }, "auto_renew": true } ] }
Lists provider churned subscriptions
GET /api/profile/{profile}/subscribers/subscriptions/churned
Returns a list of page_size subscriptions which have ended already the time at which the API call was made, and the owner of the subscription plan is the specified provider {profile}.
Optionally by defining either start_at, ends_at , or both, it is possible to construct cohorts of subscribers that have churned within a period.
The queryset can be filtered for at least one field to match a search term (q).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used within an HTML subscribers page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to grant the subscription
URL API endpoint to remove the subscription grant
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/subscribers/subscriptions/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, "profile": { "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, "period_type": "monthly" }, "auto_renew": true } ] }
Lists inactive subscribers
GET /api/profile/{profile}/subscribers/unengaged
Returns a list of page_size subscribers which have or had a subscription to a plan of the specified provider {profile}.
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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name. searches all fields when unspecified.
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/cowork/subscribers/unengaged?o=created_at\&ot=desc
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "xia", "printable_name": "Xia Lee", "created_at": "2016-01-14T23:16:55Z", "ends_at": "2017-01-14T23:16:55Z" } ] }
Lists present subscriptions
GET /api/profile/{profile}/subscriptions
Returns a list of page_size subscriptions for subscriber {profile} whose renewal date is later than the time at which the API call was made.
The queryset can be filtered such that each subscription initial start date is greater than the start_at query parameter.
The queryset can be filtered for at least one field to match a search term (q).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used within an HTML subscriptions page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to remove the subscription request
True if the request user is able to update the subscription. Typically a profile manager for the plan provider.
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/subscriptions?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, "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true, "app_url": "https://livedemo.djaoapp.com/app/xia/open-space/" } ] }
Lists expired subscriptions
GET /api/profile/{profile}/subscriptions/expired
Returns a list of page_size subscriptions for subscriber {profile} which have ended already the time at which the API call was made.
Optionally by defining either start_at, ends_at , or both, it is possible to find subscriptions which have expired within a specified period.
The queryset can be filtered for at least one field to match a search term (q).
Returned results can be ordered by natural fields (o) in either ascending or descending order by using the minus sign ('-') in front of the ordering field name.
The API is typically used within an HTML subscriptions page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
sort by created_at, ends_at, profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. 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.
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, profile__phone, profile__street_address, profile__locality, profile__region, profile__postal_code, profile__country, plan, plan__title. searches all fields when unspecified.
date/time in ISO format
date/time in ISO format
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to remove the subscription request
True if the request user is able to update the subscription. Typically a profile manager for the plan provider.
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/subscriptions/expired?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, "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true, "app_url": "https://livedemo.djaoapp.com/app/xia/open-space/" } ] }
Retrieves a subscriber subscription
GET /api/profile/{profile}/subscriptions/{subscribed_plan}
Returns a subscription to plan {subscribed_plan} for the specified subscriber.
Responses
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to remove the subscription request
True if the request user is able to update the subscription. Typically a profile manager for the plan provider.
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/profile/xia/subscriptions/open-space
responds
{ "created_at": "2019-01-01T00:00:00Z", "ends_at": "2020-01-01T00:00:00Z", "description": null, "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true, "app_url": "https://livedemo.djaoapp.com/app/xia/open-space/", "editable": true, "extra": null, "grant_key": null, "request_key": null }
Unsubscribes at a future date
PUT /api/profile/{profile}/subscriptions/{subscribed_plan}
Unsubscribes a specified subscriber from a plan {subscribed_plan} at a future date.
The API is typically used within an HTML subscribers page as present in the default theme.
Request body
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Responses
Date/time of creation (in ISO format)
Date/time when the subscription period currently ends (in ISO format)
Free-form text description for the subscription
Profile subscribed to the plan
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Plan the profile is subscribed to
Unique identifier shown in the URL bar
Title for the plan
The subscription is set to auto-renew at the end of the period
Extra meta data (can be stringify JSON)
Unique key generated when a grant is initiated
Unique key generated when a request is initiated
URL to access the subscribed service
URL API endpoint to remove the subscription request
True if the request user is able to update the subscription. Typically a profile manager for the plan provider.
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"}' https://livedemo.djaoapp.com/api/profile/xia/subscriptions/open-space
responds
{ "created_at": "2019-01-01T00:00:00Z", "ends_at": "2020-01-01T00:00:00Z", "description": null, "profile": { "slug": "xia", "printable_name": "Xia Lee", "picture": null, "type": "personal", "credentials": true }, "plan": { "slug": "open-space", "title": "Open Space" }, "auto_renew": true, "editable": true, "extra": null, "grant_key": null, "request_key": null }
Unsubscribes now
DELETE /api/profile/{profile}/subscriptions/{subscribed_plan}
Unsubscribes a specified subscriber from a plan {subscribed_plan}.
The API is typically used within an HTML subscribers page as present in the default theme.
Responses
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/profile/xia/subscriptions/open-space
Retrieves forward end-point
GET /api/proxy
Returns the URL endpoint to which requests passing the access rules are forwarded to, and the format in which the session information is encoded.
When running tests, you can retrieve the actual session information for a specific user through the session API endpoint.
Responses
unique identifier for the site (also serves as subdomain)
Entry point to which requests will be redirected to
Format to encode session in the forwarded HTTP request
Restricted authentication and registration
Send a welcome e-mail to newly registered users
Set CORS headers on HTTP responses
Describes the result of the action in human-readable form
Show the online editor tools
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy
responds
{ "slug": "cowork", "entry_point": "https://cowork.herokuapp.com/", "session_backend": 1 }
Updates forward end-point
PUT /api/proxy
Updates the URL endpoint to which requests passing the access rules are forwarded to and/or the format in which the session information is encoded.
Request body
Entry point to which requests will be redirected to
Format to encode session in the forwarded HTTP request
Restricted authentication and registration
Send a welcome e-mail to newly registered users
Set CORS headers on HTTP responses
Describes the result of the action in human-readable form
Show the online editor tools
Responses
unique identifier for the site (also serves as subdomain)
Entry point to which requests will be redirected to
Format to encode session in the forwarded HTTP request
Restricted authentication and registration
Send a welcome e-mail to newly registered users
Set CORS headers on HTTP responses
Describes the result of the action in human-readable form
Show the online editor tools
curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"entry_point": "https://cowork.herokuapp.com/", "session_backend": 1}' https://livedemo.djaoapp.com/api/proxy
responds
{ "slug": "cowork", "entry_point": "https://cowork.herokuapp.com/", "session_backend": 1 }
Retrieves users engagement
GET /api/proxy/engagement
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
Responses
Engagement tags by user
Engagement tag
Number of users that have engaged with this tag
Number of users that have engaged with the app
Restricted authentication and registration
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy/engagement
responds
{ "active_users": 10, "authentication": "enabled", "engagements": [] }
Retrieves engagement metrics
GET /api/proxy/engagement/users
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Username
Engagement tags for username
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy/engagement/users
responds
{ "count": 2, "next": null, "previous": null, "results": [ { "username": "alice", "engagements": [ "app", "profile" ] }, { "username": "kenneth", "engagements": [ "app", "billing" ] } ] }
Rotates session encoding key
POST /api/proxy/key
Rotates the key used to encode the session information forwarded to the application entry point.
Responses
Key used to decrypt the encoded session information.
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/proxy/key
responds
{ "enc_key": "********" }
Retrieves recently active users
GET /api/proxy/recent
The API is typically used within an HTML dashboard page as present in the default theme.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier for the user or profile
Name that can be safely used for display in HTML pages
Description of the activity
Date/time of creation (in ISO format)
One of 'organization', 'personal' or 'user'
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy/recent
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "printable_name": "Alice Cooper", "descr": "recently logged in", "created_at": "2019-07-15T20:40:29.509572Z", "slug": "alice" } ] }
Lists access rules
GET /api/proxy/rules
Returns a list of page_size rules incoming HTTP requests are checked against.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
Responses
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Determines the order in which rules are considered
OpenAPI path against which requests are matched
Method applied to grant or deny access
When access is granted, should the request be forwarded
Tags to check if it is the first time a user engages
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy/rules
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "rank": 0, "path": "/", "allow": 1, "is_forward": true, "engaged": "app" } ] }
Creates an access rule
POST /api/proxy/rules
Request body
Determines the order in which rules are considered
OpenAPI path against which requests are matched
Method applied to grant or deny access
When access is granted, should the request be forwarded
Tags to check if it is the first time a user engages
Responses
Determines the order in which rules are considered
OpenAPI path against which requests are matched
Method applied to grant or deny access
When access is granted, should the request be forwarded
Tags to check if it is the first time a user engages
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"rank": 0, "path": "/", "allow": 1, "is_forward": true, "engaged": ""}' https://livedemo.djaoapp.com/api/proxy/rules
responds
{ "rank": 0, "path": "/", "allow": 1, "is_forward": true, "engaged": "" }
Retrieves an access rule
GET /api/proxy/rules/{path}
Responses
Determines the order in which rules are considered
OpenAPI path against which requests are matched
Method applied to grant or deny access
When access is granted, should the request be forwarded
Tags to check if it is the first time a user engages
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy/rules/app
responds
{ "rank": 0, "path": "/app", "allow": 1, "is_forward": true, "engaged": "" }
Updates an access rule
PUT /api/proxy/rules/{path}
Request body
Determines the order in which rules are considered
Method applied to grant or deny access
When access is granted, should the request be forwarded
Tags to check if it is the first time a user engages
Responses
Determines the order in which rules are considered
OpenAPI path against which requests are matched
Method applied to grant or deny access
When access is granted, should the request be forwarded
Tags to check if it is the first time a user engages
curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"rank": 0, "allow": 1, "is_forward": true, "engaged": ""}' https://livedemo.djaoapp.com/api/proxy/rules/app
responds
{ "rank": 0, "path": "/app", "allow": 1, "is_forward": true, "engaged": "" }
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/proxy/rules/app
Retrieves example session
GET /api/proxy/sessions/{user}
Returns a session data for a user as it will be passed to the backend service.
Responses
The session being forwarded
The HTTP header that encodes the session
The URL end point where the request is forwarded
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/proxy/sessions/xia
responds
{ "forward_session": "{username: xia}", "forward_session_header": "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzbHVnIjoieGlhIiwicHJpbnRhYmxlX25hbWUiOiJYaWEgTGVlIiwicGljdHVyZSI6bnVsbCwiZW1haWwiOiJzbWlyb2xvKzExQGRqYW9kamluLmNvbSIsImNyZWF0ZWRfYXQiOiIyMDIxLTAxLTAxVDAwOjAwOjAwWiIsImNyZWRlbnRpYWxzIjp0cnVlLCJ1c2VybmFtZSI6InhpYSIsImZ1bGxfbmFtZSI6IlhpYSBMZWUiLCJleHAiOjE2MzI5MzM0NDJ9.ZFA3-LH3O7z7JVZdpBLz0AbnZd-zFtqiehk40Jc5uya", "forward_url": "https://cowork.herokuapp.com/" }
Uploads a theme package
POST /api/themes
Uploads a theme package with templates that will override the default ones. See references and tutorials on creating themes for details on the theme package structure and customizing the default templates.
Request body
Content of the theme package as a zip file.
Responses
URL where the theme package was uploaded.
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/themes
responds
{ "location": "https://themes.*mydomain*/" }
Removes custom theme
DELETE /api/themes
Removes the custom theme templates and assets.
Pages will be using the default theme after a reset.
Responses
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/themes
Lists user accounts
GET /api/users
Returns a list of page_size profile and user accounts.
The queryset can be filtered for at least one field to match a search term (q).
The queryset can be ordered by a field by adding an HTTP query parameter o= followed by the field name. A sequence of fields can be used to create a complete ordering by adding a sequence of o HTTP query parameters. To reverse the natural order of a field, prefix the field name by a minus (-) sign.
Query parameters
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
value to search for in the fields specified by q_f
restrict searches to one or more fields in: email, username. searches all fields when unspecified.
sort by full_name, created_at, date_joined. 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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/users?q=xia
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "slug": "xia", "username": "xia", "printable_name": "Xia" } ] }
Creates a user account
POST /api/users
Request body
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
Password with which a user can authenticate with the service
Responses
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"full_name": "Xia Lee", "nick_name": "Xia", "email": "xia@locahost.localdomain"}' https://livedemo.djaoapp.com/api/users
responds
{ "slug": "xia", "username": "xia", "created_at": "2018-01-01T00:00:00Z", "printable_name": "Xia", "full_name": "Xia Lee", "nick_name": "Xia", "email": "xia@locahost.localdomain" }
Retrieves a login profile
GET /api/users/{user}
Responses
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/users/donny
responds
{ "slug": "donny", "username": "donny", "created_at": "2018-01-01T00:00:00Z", "printable_name": "Donny", "full_name": "Donny Smith", "email": "donny.smith@locahost.localdomain" }
Updates a user account
PUT /api/users/{user}
The API is typically used within an HTML contact information page as present in the default theme.
Request body
Unique identifier that can safely be used in place of username
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
Responses
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
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", "nick_name": "Xia"}' https://livedemo.djaoapp.com/api/users/xia
responds
{ "slug": "xia", "username": "xia", "created_at": "2018-01-01T00:00:00Z", "printable_name": "Xia", "full_name": "Xia Lee", "nick_name": "Xia", "email": "xia@locahost.localdomain" }
Deletes a user account
DELETE /api/users/{user}
The API is typically used within an HTML contact information page as present in the default theme.
Responses
204 No Content
curl -H 'Authorization: Bearer JWT auth token' -X DELETE https://livedemo.djaoapp.com/api/users/xia
Lists roles by user
GET /api/users/{user}/accessibles
Returns a list of page_size roles where a profile is accessible by {user}. Typically the user was granted a role with specific permissions on the profile.
The queryset can be further refined to match a search filter (q) 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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email, role, role__title. searches all fields when unspecified.
sort by profile__full_name, user, user__full_name, role__title, 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
Number of user invited to have a role
Number of user requesting a role
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Key to identify the request for the role
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL to the homepage for the profile associated to the role
URL to the settings page for the profile associated to the role
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/users/xia/accessibles
responds
{ "count": 1, "next": null, "previous": null, "invited_count": 0, "requested_count": 0, "results": [ { "profile": { "slug": "cowork", "printable_name": "ABC Corp.", "type": "organization", "credentials": false }, "role_description": { "slug": "manager", "created_at": "2023-01-01T00:00:00Z", "title": "Profile Manager", "is_global": true, "profile": null }, "request_key": null, "accept_grant_api_url": null, "remove_api_url": "https://cowork.net/api/users/alice/accessibles/manager/cowork", "home_url": "https://cowork.net/app/", "settings_url": "https://cowork.net/profile/cowork/contact/" } ] }
Requests a role
POST /api/users/{user}/accessibles
Creates a request to connect {user} to a profile
The API is typically used within an HTML connected profiles page as present in the default theme.
Request body
Profile to grant {user} a role onto
E-mail of profile to grant {user} a role onto (potentially generating an invite to the site)
Message to send along the invitation
Responses
Date/time of creation (in ISO format)
Key to identify the request for the role
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL to the homepage for the profile associated to the role
URL to the settings page for the profile associated to the role
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"slug": "cowork"}' https://livedemo.djaoapp.com/api/users/xia/accessibles
responds
{ "profile": { "slug": "cowork", "full_name": "Cowork", "printable_name": "Cowork", "picture": null, "type": "organization", "credentials": false }, "created_at": "2020-06-06T04:55:41.766938Z", "request_key": "53a1b0657c7cf738514bf791e6f20f36429e57aa", "role_description": null, "home_url": "/app/cowork/", "settings_url": "/profile/cowork/contact/", "accept_grant_api_url": null, "remove_api_url": "/api/users/xia/accessibles/manager/cowork" }
Accepts role invite
PUT /api/users/{user}/accessibles/accept/{verification_key}
Accepts a role identified by {verification_key}.
The API is typically used within an HTML connected profiles page as present in the default theme.
Responses
Date/time of creation (in ISO format)
Key to identify the request for the role
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL to the homepage for the profile associated to the role
URL to the settings page for the profile associated to the role
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
curl -H 'Authorization: Bearer JWT auth token' -X PUT https://livedemo.djaoapp.com/api/users/xia/accessibles/accept/a00000d0a0000001234567890123456789012345
responds
{ "created_at": "2023-01-01T00:00:00Z", "role_description": { "created_at": "2023-01-01T00:00:00Z", "title": "Profile Manager", "slug": "manager", "is_global": true }, "profile": { "slug": "cowork", "printable_name": "ABC Corp.", "type": "organization", "credentials": false } }
Lists roles of specific type by user
GET /api/users/{user}/accessibles/{role}
Returns a list of page_size roles where a profile is accessible by {user} through a {role}. Typically the user was granted the {role} with specific permissions on the profile.
The queryset can be further refined to match a search filter (q) 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
value to search for in the fields specified by q_f
restrict searches to one or more fields in: profile, profile__full_name, profile__email. searches all fields when unspecified.
sort by profile__full_name, user, user__full_name, role__title, 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
Number of user invited to have a role
Number of user requesting a role
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Date/time of creation (in ISO format)
Key to identify the request for the role
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL to the homepage for the profile associated to the role
URL to the settings page for the profile associated to the role
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/users/xia/accessibles/manager
responds
{ "count": 1, "next": null, "previous": null, "invited_count": 0, "requested_count": 0, "results": [ { "profile": { "slug": "cowork", "printable_name": "ABC Corp.", "type": "organization", "credentials": false }, "role_description": { "slug": "manager", "created_at": "2023-01-01T00:00:00Z", "title": "Profile manager", "is_global": true, "profile": null }, "request_key": null, "accept_grant_api_url": null, "remove_api_url": "https://cowork.net/api/users/alice/accessibles/manager/cowork", "home_url": "https://cowork.net/app/", "settings_url": "https://cowork.net/profile/cowork/contact/" } ] }
Requests a role of a specified type
POST /api/users/{user}/accessibles/{role}
Creates a request to connect {user} to a profile with a specified {role}.
The API is typically used within an HTML connected profiles page as present in the default theme.
Request body
Profile to grant {user} a role onto
E-mail of profile to grant {user} a role onto (potentially generating an invite to the site)
Message to send along the invitation
Responses
Date/time of creation (in ISO format)
Key to identify the request for the role
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL to the homepage for the profile associated to the role
URL to the settings page for the profile associated to the role
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"slug": "cowork"}' https://livedemo.djaoapp.com/api/users/xia/accessibles/manager
responds
{ "profile": { "slug": "cowork", "full_name": "Cowork", "printable_name": "Cowork", "picture": null, "type": "organization", "credentials": false }, "created_at": "2020-06-06T04:55:41.766938Z", "request_key": "53a1b0657c7cf738514bf791e6f20f36429e57aa", "role_description": { "slug": "manager", "created_at": "2023-01-01T00:00:00Z", "title": "Profile manager", "is_global": true, "profile": null }, "home_url": "/app/cowork/", "settings_url": "/profile/cowork/contact/", "accept_grant_api_url": null, "remove_api_url": "/api/users/xia/accessibles/manager/cowork" }
Sends request notification for role
POST /api/users/{user}/accessibles/{role}/{profile}
Re-sends the notification that the {user} is requesting a {role} on the specified billing profile.
Responses
Date/time of creation (in ISO format)
Key to identify the request for the role
Profile the user has a role on
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Description of the role
Date/time of creation (in ISO format)
Unique identifier shown in the URL bar
Short description of the role. Grammatical rules to pluralize the title might be used in User Interfaces.
Automatically grants the role without requiring a user to accept it.
Automatically adds the role when a user and profile share the same e-mail domain.
True when the role type is available for all profiles
Profile the role type belongs to
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Extra meta data (can be stringify JSON)
True if the request user is able to update the role description. Typically a profile manager for the organization (local role description) or the broker (global role descriptions).
URL to the homepage for the profile associated to the role
URL to the settings page for the profile associated to the role
URL API endpoint to grant the role
URL API endpoint to remove the role grant or request
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/users/xia/accessibles/manager/cowork
responds
{ "created_at": "2023-01-01T00:00:00Z", "role_description": { "created_at": "2023-01-01T00:00:00Z", "title": "Profile Manager", "slug": "manager", "is_global": true }, "profile": { "slug": "cowork", "printable_name": "ABC Corp.", "type": "organization", "credentials": false }, "request_key": null }
Deletes a role by type
DELETE /api/users/{user}/accessibles/{role}/{profile}
Dettaches {user} from one or all roles with regards to the specified billing profile, typically resulting in revoking permissions from this user to manage part of the profile.
The API is typically used within an HTML connected profiles page as present in the default theme.
Responses
204 No Content
curl -X DELETE https://livedemo.djaoapp.com/api/users/xia/accessibles/manager/cowork
Sends an activation link
POST /api/users/{user}/activate
Re-sends an activation e-mail if the user is not already activated.
The template for the e-mail sent to the user can be found in notification/verification.eml.
Responses
Unique identifier that can safely be used in place of username
Unique identifier for the user, typically used in URLs
Name that can be safely used for display in HTML pages
URL location of the profile picture
Primary e-mail address to contact user
Primary phone number to contact user
Full name (effectively first name followed by last name)
Short casual name used to address the user
Preferred communication language
True if the user has valid login credentials
Date at which the user account was created
Date at which the user last logged in
curl -H 'Authorization: Bearer JWT auth token' -X POST https://livedemo.djaoapp.com/api/users/donny/activate
responds
{ "slug": "xia", "username": "xia", "printable_name": "Xia", "full_name": "Xia Lee", "nick_name": "Xia", "email": "xia@locahost.localdomain", "created_at": "2018-01-01T00:00:00Z" }
Resets a user secret API key
POST /api/users/{user}/api-keys
Resets the secret API key with which a user can authenticate with the service.
Request body
Password of the user making the HTTP request
One-time code. This field will be checked against an expected code when multi-factor authentication (MFA) is enabled.
Email verification code.
Phone verification code.
Responses
Secret API Key used to authenticate user on every HTTP request
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"password": "yoyo"}' https://livedemo.djaoapp.com/api/users/xia/api-keys
responds
{ "secret": "tgLwDw5ErQ2pQr5TTdAzSYjvZenHC9pSy7fB3sXWERzynbG5zG6h 67pTN4dh7fpy" }
Lists a user notifications preferences
GET /api/users/{user}/notifications
Responses
List of notifications from card_updated, charge_updated, claim_code_generated, expires_soon, order_executed, profile_updated, password_reset, user_activated, user_contact, user_registered, user_welcome, role_request_created, verification, sales_report
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/users/donny/notifications
responds
{ "notifications": [ "user_registered_notice" ] }
Changes a user notifications preferences
PUT /api/users/{user}/notifications
Request body
List of notifications from card_updated, charge_updated, claim_code_generated, expires_soon, order_executed, profile_updated, password_reset, user_activated, user_contact, user_registered, user_welcome, role_request_created, verification, sales_report
Responses
List of notifications from card_updated, charge_updated, claim_code_generated, expires_soon, order_executed, profile_updated, password_reset, user_activated, user_contact, user_registered, user_welcome, role_request_created, verification, sales_report
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"notifications": ["user_registered_notice"]}' https://livedemo.djaoapp.com/api/users/donny/notifications
responds
{ "notifications": [ "user_registered_notice" ] }
Enables multi-factor authentication
PUT /api/users/{user}/otp
Enables multi-factor authentication, through either an OTP one-time code, email verification, phone verification or any combination of the above.
To disable any of the MFA requirements, pass a false value for its respective field.
The API is typically used within an HTML update password page as present in the default theme.
Request body
Password of the user making the HTTP request
One-time code. This field will be checked against an expected code when multi-factor authentication (MFA) is enabled.
Email verification code.
Phone verification code.
Enables/disables OTP
Enables/disables E-mail verification
Enables/disables Phone verification
Responses
Private key
Provisioning URI
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"password": "yoyo", "otp_enabled": true, "email_verification_enabled": false, "phone_verification_enabled": false}' https://livedemo.djaoapp.com/api/users/xia/otp
responds
{ "priv_key": "**********************", "provisioning_uri": "https://localhost:8020/" }
Updates a user password
PUT /api/users/{user}/password
Sets a new password for a user. Any or a combination of the HTTP request user secrets must be passed along for authorization.
The API is typically used within an HTML update password page as present in the default theme.
Request body
Password of the user making the HTTP request
One-time code. This field will be checked against an expected code when multi-factor authentication (MFA) is enabled.
Email verification code.
Phone verification code.
New password for the user referenced in the URL
Responses
Describes the reason for the error in plain text
curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"password": "yoyo", "new_password": "yeye"}' https://livedemo.djaoapp.com/api/users/xia/password
responds
{ "detail": "Password updated successfully." }
Lists billing profiles with a user as a profile manager
GET /api/users/{user}/profiles
Returns a list of page_size of profiles
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
A page number within the paginated result set.
Number of results to return per page between 1 and 100 (defaults to 25).
date/time in ISO format
date/time in ISO format
value to search for in the fields specified by q_f
restrict searches to one or more fields in: slug, full_name, email, phone, street_address, locality, region, postal_code, country, username, first_name, last_name. searches all fields when unspecified.
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
Total number of items in the dataset
URL to previous page of results
URL to next page of results
items in current page
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
curl -H 'Authorization: Bearer JWT auth token' https://livedemo.djaoapp.com/api/users/xia/profiles?o=created_at
responds
{ "count": 1, "next": null, "previous": null, "results": [ { "created_at": "2023-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": "personal", "picture": "" } ] }
Creates a connected profile
POST /api/users/{user}/profiles
This end-point creates a new profile whose manager is {user}. It returns an error if the profile already exists.
If you want to request access to an already existing profile, see the accessibles end-point.
Request body
Unique identifier shown in the URL bar
URL location of the profile picture
One of 'organization', 'personal' or 'user'
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Responses
Unique identifier shown in the URL bar
Name that can be safely used for display in HTML pages
URL location of the profile picture
One of 'organization', 'personal' or 'user'
True if the account has valid login credentials
Date/time of creation (in ISO format)
Full name
E-mail address
Phone number
Street address
City/Town
State/Province/County
Zip/Postal code
Country
Timezone to use when reporting metrics
The profile can fulfill the provider side of a subscription.
Enable GroupBuy
Extra meta data (can be stringify JSON)
Describes the result of the action in human-readable form
curl -H 'Authorization: Bearer JWT auth token' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"slug": "myproject", "full_name": "My Project"}' https://livedemo.djaoapp.com/api/users/xia/profiles
responds
{ "slug": "myproject", "full_name": "My Project" }
Updates a user public RSA key
PUT /api/users/{user}/ssh-keys
Sets a new public RSA key for a user. Any or a combination of the HTTP request user secrets must be passed along for authorization.
Request body
Password of the user making the HTTP request
One-time code. This field will be checked against an expected code when multi-factor authentication (MFA) is enabled.
Email verification code.
Phone verification code.
New public key for the user referenced in the URL
Responses
Describes the reason for the error in plain text
curl -H 'Authorization: Bearer JWT auth token' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"pubkey": "ssh-rsa AAAAB3N...", "password": "yoyo"}' https://livedemo.djaoapp.com/api/users/xia/ssh-keys
responds
{ "detail": "Public key updated successfully." }