Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Request boby example

{
  "subscription": {
    "plan_id": 1,
    "token": "sk_JfsH5ur87",
    "coupon_id": 3
  }
}

Success response body

{
  "success": true
}

Status 403 error message

{
  permissions: ['denied'],
  message: 'permissions_denied'
}

Status 422 error message

{
  "message": "MESSAGE"
}

Errors

Code Description
unauthorized
forbidden
unprocessable_entity

Params

Param name Description
subscription
required

Validations:

  • Must be a Hash

subscription[plan_id]
required

ID of plan

Validations:

  • Must be a Integer

subscription[token]
required

Stripe token

Validations:

  • Must be a String

subscription[coupon_id]
optional

Coupon

Validations:

  • Must be a Integer