Pike13 For Developers
Get Started
Authentication
Core API
Reporting API
Webhooks API
Announcements

Core API Documentation

Plan Terms

Fetches the terms and conditions for a Plan.

If the Plan uses checkbox terms, then you can just show the user the contents of the terms field. Prompt them to agree to the terms. If they do, use the complete endpoint to confirm that they've accepted them.

If the Plan uses document terms (i.e. a document from a document provider), and the terms have not yet been accepted, the response will include a URL to that document provider. That URL must be presented to the user in a web browser where the user can accept the terms on the document provider's site. Once they have accepted or declined the terms through the document provider, their browser will be redirected to the plan terms complete API. The result of the redirect will be a 200 response if the signing was successful, or a 4XX response if the signing unsuccessful.

Front

GET /api/v2/front/plans/:plan_id/plan_terms
GET /api/v2/front/plans/:plan_id/plan_terms/:plan_terms_id

Fetches the terms for the Plan. There will only be one Plan Terms for a Plan.

Terms may only be fetched for the person that is paying for the invoice.

If the type of the terms is document and the signing_url is empty, then something went wrong while trying to contact the document provider. Notify the user that document signing is currently not available or try again.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/plans/1/plan_terms \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE
{
  "plan_terms": [
    {
      "id": 2,
      "terms": "These are the terms",
      "type": "document",
      "signing_url": "https://waiver.smartwaiver.com/d/ABCDEFGHIJKLMNOPQRSTUVW/",
      "acceptance_required": true,
      "acceptance_required_at_checkout": true,
      "accepted": false
    }
  ]
}

RESPONSE
{
  "plan_terms": [
    {
      "id": 2,
      "terms": "These are the terms",
      "type": "checkbox",
      "acceptance_required": true,
      "acceptance_required_at_checkout": true,
      "accepted": false
    }
  ]
}

GET /api/v2/front/plans/:plan_id/plan_terms/:plan_terms_id/complete

Mark the Plan Terms as having been accepted by the user.

If the type of the terms is checkbox, you will need to call this API to accept the terms.

If the type of the terms is document, you will not need to call this API. After the user signs the document on the document provider's website, the document provider will redirect the user's browser to this URL. The result of the redirect will be a 200 if they signed the terms through the document provider. It will be a 422 if they declined to sign the terms.

Show curl example

REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/plans/1/plan_terms/2/complete \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE
{ }

FAILURE RESPONSE
{ "errors": { "accepted": [ "Terms and conditions must be accepted" ] } }