Skip to content

Commit

Permalink
updates docs for memberships and tiers
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed May 9, 2022
1 parent 1266630 commit b3b605d
Show file tree
Hide file tree
Showing 7 changed files with 336 additions and 239 deletions.
138 changes: 74 additions & 64 deletions docs/loyalty/documentation/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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
membership number Membership ID
=========== ======== ======================================================

.. code-block:: js
Expand All @@ -30,44 +30,49 @@ tier number Tier ID
password: 'xxxxx',
interval: 'month',
dateOfBirth: '12/25/1990',
tier: 1,
membership: 1,
tags: [1, 2, 3, 4],
});
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.gold number Number of loyalty points the user currently has available
user.goldTotal number Number of loyalty points the user has earned all time
user.goldSpent number Number of loyalty points the user has spent
user.id number 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 formatted as ISO date string
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 object[] List of tags the user is interested in
user.tags.id number The ID of the tag
user.tags.name string The name of the tag
=========================== ======== =================================================================================
================================= ======== =================================================================================
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.gold number Number of loyalty points the user currently has available
user.goldTotal number Number of loyalty points the user has earned all time
user.goldSpent number Number of loyalty points the user has spent
user.id number The ID of the user
user.loyaltyMembership [object] The membership the user is subscribed to
user.loyaltyMembership.id number The ID of the membership
user.loyaltyMembership.name string The name of the membership
user.loyaltyMembership.priceMonth number The cost of the membership per month in cents
user.loyaltyMembership.priceYear number The cost of the membership per year in cents
user.loyaltyMembership.resourceId number The resource ID of the membership badge icon
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.gold number The points required to achieve tier
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 formatted as ISO date string
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 object[] List of tags the user is interested in
user.tags.id number The ID of the tag
user.tags.name string The name of the tag
================================= ======== =================================================================================

Log In
------
Expand All @@ -92,37 +97,42 @@ password string
Response

=========================== ======== ==========================================================================
================================= ======== ==========================================================================
Field Type Description
=========================== ======== ==========================================================================
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.gold number Number of loyalty points the user currently has available
user.goldTotal number Number of loyalty points the user has earned all time
user.goldSpent number Number of loyalty points the user has spent
user.id number 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 formatted as ISO date string
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 object[] List of tags the user is interested in
user.tags.id number The ID of the tag
user.tags.name string The name of the tag
=========================== ======== ==========================================================================
================================= ======== ==========================================================================
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.gold number Number of loyalty points the user currently has available
user.goldTotal number Number of loyalty points the user has earned all time
user.goldSpent number Number of loyalty points the user has spent
user.id number The ID of the user
user.loyaltyMembership [object] The membership the user is subscribed to
user.loyaltyMembership.id number The ID of the membership
user.loyaltyMembership.name string The name of the membership
user.loyaltyMembership.priceMonth number The cost of the membership per month in cents
user.loyaltyMembership.priceYear number The cost of the membership per year in cents
user.loyaltyMembership.resourceId number The resource ID of the membership badge icon
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.gold number The points required to achieve tier
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 formatted as ISO date string
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 object[] List of tags the user is interested in
user.tags.id number The ID of the tag
user.tags.name string The name of the tag
================================= ======== ==========================================================================

Initiate OAuth Flow
-------------------
Expand Down
24 changes: 12 additions & 12 deletions docs/loyalty/documentation/billing.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Billing API
===========

- `Update Tier`_
- `Confirm Update Tier`_
- `Update Membership`_
- `Confirm Update Membership`_
- `Manage Billing`_

Update Tier
------------
Update Membership
-----------------

The update 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 update 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.
If the new membership is a free subscription, then the update will be processed immediately.
If the new membership is a paid subscription, then it will return information about the update 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/update

Expand All @@ -20,15 +20,15 @@ Request
Field Type Description
=========== ======== =====================================================
interval string The billing interval. Should be ``month`` or ``year``
tier number Tier ID
membership number Membership ID
=========== ======== =====================================================

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/billing/update', {
params: {
interval: 'month',
tier: 1
membership: 1
},
headers: {
'x-user-auth-token': 'xxxxxxx',
Expand All @@ -50,8 +50,8 @@ href [string] If included, you should immediately redirect to this href
"amountDue": 4999
}
Confirm Update Tier
-------------------
Confirm Update Membership
-------------------------

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

Expand All @@ -63,15 +63,15 @@ Request
Field Type Description
=========== ======== =====================================================
interval string The billing interval. Should be ``month`` or ``year``
tier number Tier ID
membership number Membership ID
=========== ======== =====================================================

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/billing/confirm', {
params: {
interval: 'month',
tier: 1
membership: 1
},
headers: {
'x-user-auth-token': 'xxxxxxx',
Expand Down
2 changes: 2 additions & 0 deletions docs/loyalty/documentation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ API Documentation
- :doc:`Authentication API <authentication>`
- :doc:`User API <user>`
- :doc:`Billing API <billing>`
- :doc:`Memberships API <memberships>`
- :doc:`Tiers API <tiers>`
- :doc:`Creators API <creators>`
- :doc:`Missions API <missions>`
Expand All @@ -22,6 +23,7 @@ API Documentation
authentication
user
billing
memberships
tiers
creators
missions
Expand Down
84 changes: 84 additions & 0 deletions docs/loyalty/documentation/memberships.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
Memberships API
===============

- `List Memberships`_
- `Read Membership`_

List Memberships
----------------

List available memberships

- **GET** /membership/list

Request

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

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/membership/list', {
headers: {
'x-user-auth-token': 'xxxxxxx',
},
});
Response

=========================== ======== =================================================
Field Type Description
=========================== ======== =================================================
memberships object[]
memberships.id number The ID of the membership
memberships.name string The name of the membership
memberships.description string The membership description
memberships.priceMonth number The cost of the membership per month in cents
memberships.priceYear number The cost of the membership per year in cents
memberships.gold number The price in loyalty points to redeem
memberships.goldMultiplier number The loyalty points multiplier for this membership
memberships.resourceId number The resource ID of the membership image
memberships.badgeResourceId number The resource ID of the membership badge
=========================== ======== =================================================

Read Membership
---------------

Read membership details

- **GET** /membership/:id

Request

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

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/membership/1', {
headers: {
'x-user-auth-token': 'xxxxxxx',
},
});
Response

========================== ====== =================================================
Field Type Description
========================== ====== =================================================
membership object
membership.id number The ID of the membership
membership.name string The name of the membership
membership.description string The membership description
membership.priceMonth number The cost of the membership per month in cents
membership.priceYear number The cost of the membership per year in cents
membership.goldMultiplier number The loyalty points multiplier for this membership
membership.resourceId number The resource ID of the membership image
membership.badgeResourceId number The resource ID of the membership badge
========================== ====== =================================================

0 comments on commit b3b605d

Please sign in to comment.