v1

latestOpenAPI 3.1.02026-07-24270180.3 KB

Query Subscriptions

Returns all or a specific subscription by the given subscription id

get/v1/subscriptions/{id}

Path parameters

idstring required

The subscription ID returned at the creation stage. This value can be omitted to return a list of all 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

Response

200

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

Example response

{
  "status": 200,
  "resource": {
    "type": "subscription",
    "data": {
      "_id": "5ef064763dcfec0ac5e0622e",
      "created_at": "2020-06-22T07:57:42.963Z",
      "updated_at": "2020-06-29T07:58:15.049Z",
      "company_id": "5d305bfbfac31b4448c738d7",
      "amount": 12,
      "status": "expired",
      "user_id": "5d305bfbfac31b4448c738d6",
      "latest_charge_id": "5ef99f168bbc123baf1507f4",
      "expired_at": "2020-06-29T07:58:15.019Z",
      "expired_reason": "end_date",
      "last_change_by": "automatic",
      "_source_ip_address": "192.168.0.1",
      "customer": {
        "customer_id": "5ef064763dcfec0ac5e0622b",
        "first_name": "Carlie",
        "last_name": "Kuvalis",
        "email": "carlie.kuvalis@example.com",
        "phone": "+1234567890",
        "company_name": "Konopelski Kuvalis Group",
        "payment_source": {
          "gateway_name": "MPGS 1",
          "gateway_type": "MPGS",
          "gateway_mode": "test",
          "updated_at": "2020-06-22T07:57:42.957Z",
          "vault_token": "bd9d6ed0-7c6c-4ee7-84f6-b774cd2a88ed",
          "gateway_id": "5dde1f3799cfea21ed2fc942",
          "expire_year": 2021,
          "expire_month": 1,
          "address_country": "AU",
          "address_line1": "61426 Osvaldo Plains",
          "address_line2": "Apt. 276",
          "address_city": "Lake Robyn",
          "address_state": "WY",
          "address_postcode": "4920",
          "card_name": "Wanda Mertz",
          "card_number_last4": "4242",
          "card_number_bin": "42424242",
          "card_scheme": "visa",
          "ref_token": "cus_HVm5S8sw1hGryF",
          "status": "active",
          "created_at": "2020-06-22T07:57:42.906Z",
          "_id": "5ef064763dcfec0ac5e0622c",
          "type": "card"
        }
      },
      "statistics": {
        "total_collected_amount": 96,
        "successful_transactions": 8
      },
      "schedule": {
        "interval": "day",
        "start_date": "2020-06-22T07:57:42.066Z",
        "end_date": "2020-06-29T21:00:00.000Z",
        "next_assessment": "2020-06-29T07:57:42.066Z",
        "next_assessment_planned": "2020-06-29T07:57:42.066Z",
        "first_assessment": "2020-06-22T07:57:42.066Z",
        "status": "complete",
        "processing_pended_at": "2020-06-29T07:59:02.065Z",
        "last_assessment_planned": "2020-06-28T07:57:42.066Z",
        "last_assessment": "2020-06-29T07:58:15.025Z",
        "completed_count": 8,
        "frequency": 1
      },
      "currency": "AUD"
    }
  }
}