v1

latestOpenAPI 3.1.02026-07-24270180.3 KB

Create a subscription

Create a PowerBoard subscription

post/v1/subscriptions

Headers

x-user-secret-keystring required

Your API private/secret key. This can be found in the powerboard dashboard.

Content-Typestring required

Content-Type will always be application/json

Request body

amountstring required

The amount that will be charged each interval of the transaction

currencystring required

The iso4217 alpha-3 code of the currency. Available values: 'AUD'

referencestring

A manually defined reference for the subscription

descriptionstring

A manually defined description for the subscription

tokenstring

One-time-token returned from the payment widget with all the payment source information.

customer_idstring

The customer ID to apply the subscription to

gateway_idstring

The PowerBoard gateway id to apply the subscription to

Response

200

statusinteger
{"stackTrail":"paths:/v1/subscriptions:post:responses:200:content:application/json:schema:properties:error","oasType":"schema","type":"unknown"}

Example response

{
  "status": 201,
  "resource": {
    "type": "subscription",
    "data": {
      "created_at": "2020-09-03T09:52:45.361Z",
      "updated_at": "2020-09-03T09:52:45.361Z",
      "amount": 10,
      "description": "Vitae commodi provident assumenda",
      "reference": "Fuga consequuntur sint ab magnam",
      "status": "active",
      "_id": "5f50bced80c950150a60364c",
      "_service": {
        "customer_default_gateway_id": "5ef6167d2e4a1b140f640167",
        "tags": "tags wanda.mertz@example.com"
      },
      "customer": {
        "customer_id": "5f50bced80c950150a60364a",
        "email": "wanda.mertz@example.com"
      },
      "schedule": {
        "interval": "day",
        "start_date": "2020-09-03T11:30:00.000Z",
        "end_date": "2020-09-25T19:05:11.000Z",
        "next_assessment": "2020-09-03T11:30:00.000Z",
        "next_assessment_planned": "2020-09-03T11:30:00.000Z",
        "first_assessment": "2020-09-03T11:30:00.000Z",
        "status": "inprogress",
        "frequency": 1
      },
      "currency": "AUD"
    }
  }
}