PLANS REST API

Create Plan

Create a new plan for an existing app

POST /plans/create

Request Data

{ "appId": "dev_app_9iY09YKzV9oX1MEE3tb98u", "data": { "currency": "US Dollar (USD)", "interval": "month", "pricePerUnit": "23.45" }, "description": "bar desc", "name": "foo plan" }

Response Data

{ "id": "dev_pln_-py2iI0rjmrKjHaLzgrhh6" }

Retrieve plan

Returns all details about the plan.

GET /plans/{planID}

Response Data

{ "plan": { "id": "dev_pln_-py2iI0rjmrKjHaLzgrhh6", "appId": "dev_app_9iY09YKzV9oX1MEE3tb98u", "key": "", "name": "foo plan", "description": "bar desc", "state": "active", "data": { "currency": "US Dollar (USD)", "interval": "month", "pricePerUnit": "23.45" }, "createdAt": "2019-08-14T12:13:06.991351Z", "updatedAt": "2019-08-14T12:13:06.991351Z" } }

Delete Plan

Deletes plan and removes it from the app

POST /plans/delete/{planID}

Response Data

{}

Activate Plan

Activates the plan so that a user can subscribe to it.

POST /plans/activate/{planID}

Response Data

{}

Deactivate Plan

Deactivates a plan so that users can't subscribe to it anymore. Exisiting subscriptions are not automatically canceled by this action.

POST /plans/deactivate/{planID}

Response Data

{}

Subscribe Plan

Subscribes a user to the plan.

POST /payment/stripe/subscribe

Request Data

{ "planId": "dev_pln_qmaajRelo0H1l_NC3nupcy", "token": { "id": "tok_bypassPending" } }

Response Data

{}

Cancel Subscription

Cancels subscription for the user.

POST /payment/stripe/unsubscribe/{planID}

Response Data

{}

on this page: