Skip to content

Commit

Permalink
add loyalty api documentation for enterprise accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed Mar 3, 2022
1 parent fbe9a6e commit 5802819
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# -- Project information -----------------------------------------------------

project = 'Botisimo'
copyright = '2020, Botisimo'
copyright = '2022, Botisimo'
author = 'Botisimo'

# -- YouTube Embed Directive -------------------------------------------------
Expand Down
166 changes: 166 additions & 0 deletions docs/loyalty/documentation/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
=========================
Loyalty API Documentation
=========================

API Endpoint
============

The API is located at the following URL. You should replace ``:team`` with your team's name in your Botisimo account

``https://botisimo.com/api/v1/loyalty/:team``

Get Team
--------

Get the information about the team

- **GET** /

Request

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
\- \- \-
=========== ======== ======================================================

Response

============================ ======== =======================================
Field Type Description
============================ ======== =======================================
team object
team.name string The name of the team
team.currencyName string The name of the loyalty points
team.loyaltyTiers object[] List of tiers
team.loyaltyTiers.id number The ID of the tier
team.loyaltyTiers.name string The name of the tier
team.loyaltyTiers.priceMonth number The cost of the tier per month in cents
team.loyaltyTiers.priceYear number The cost of the tier per year in cents
team.loyaltyTiers.resourceId number The resource ID of the tier badge icon
team.tags object[] List of tags
team.tags.id number The ID of the tag
team.tags.name string The name of the tag
============================ ======== =======================================

Sign Up
-------

- **POST** /signup

Request

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
dateOfBirth string Date of birth. Should be formatted like ``MM/DD/YYYY``
email string Email address used to identify and communicate with
interval string The billing interval. Should be ``month`` or ``year``
password string
tags number[] Array of Tag IDs
tier number Tier ID
=========== ======== ======================================================

Response

=========================== ======== =================================================================================
Field Type Description
=========================== ======== =================================================================================
href [string] If included, you should store the ``token`` and immediately redirect to this href
token string Token for future requests that require authentication
user object Information about the logged in user
user.avatar string URL to to user avatar
user.createdAt string When the user was created
user.dateOfBirth string Date of birth formatted as ``MM/DD/YYYY``
user.id string The ID of the user
user.loyaltyTier object The tier the user is subscribed to
user.loyaltyTier.id number The ID of the tier
user.loyaltyTier.name string The name of the tier
user.loyaltyTier.priceMonth number The cost of the tier per month in cents
user.loyaltyTier.priceYear number The cost of the tier per year in cents
user.loyaltyTier.resourceId number The resource ID of the tier badge icon
user.name string The name of the user
user.notifications string The last time the user read the notifications
user.shippingAddressCity string Shipping info for the user
user.shippingAddressCountry string Shipping info for the user
user.shippingAddressName string Shipping info for the user
user.shippingAddressState string Shipping info for the user
user.shippingAddressStreet string Shipping info for the user
user.shippingAddressSuite string Shipping info for the user
user.shippingAddressZip string Shipping info for the user
user.tags string List of tags the user is interested in
user.tags.id string The ID of the tag
user.tags.name string The name of the tag
=========================== ======== =================================================================================

Log In
------

- **POST** /login

Request

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
email string
password string
=========== ======== ======================================================

Response

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
token string Token for future requests that require authentication
user object Information about the logged in user
=========== ======== ======================================================

Upgrade Tier
------------

The upgrade request should be made first when updating a subscription.
If the new tier is a free subscription, then the update will be processed immediately.
If the new tier is a paid subscription, then it will return information about the upgrade to be confirmed by the user. If confirmation is required, then the client should ask the user to confirm and then use the ``/billing/confirm`` endpoint.

- **GET** /billing/upgrade

Request

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
interval string The billing interval. Should be ``month`` or ``year``
tier number Tier ID
=========== ======== ======================================================

Confirm Upgrade
---------------

This endpoint should ONLY be used after first using the ``/billing/upgrade`` endpoint and prompting the user to confirm the transaction.

- **GET** /billing/confirm

Request

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
interval string The billing interval. Should be ``month`` or ``year``
tier number Tier ID
=========== ======== ======================================================

Manage Billing
--------------

Use this endpoint to request a URL for a billing management portal session

- **GET** /billing/manage

Request

=========== ======== ======================================================
Field Type Description
=========== ======== ======================================================
\- \- \-
=========== ======== ======================================================
11 changes: 11 additions & 0 deletions docs/loyalty/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
=======
Loyalty
=======

Loyalty rewards API.

.. toctree::
:maxdepth: 1
:name: toc-loyalty

documentation/index

0 comments on commit 5802819

Please sign in to comment.