v1

latestOpenAPI 3.1.02026-07-24270180.3 KB

Cancel a subscription

Delete an existing subscription to change subscription to a deleted status.

delete/v1/subscriptions/{id}

Path parameters

idstring required

The subscription ID returned at the creation stage.

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}:delete: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-09-03T07:47:59.749Z",
      "amount": 12,
      "status": "deleted",
      "latest_charge_id": "5ef99f168bbc123baf1507f4",
      "expired_at": "2020-06-29T07:58:15.019Z",
      "expired_reason": "end_date",
      "last_change_by": "manual",
      "customer": {
        "customer_id": "5ef064763dcfec0ac5e0622b",
        "first_name": "Carlie",
        "last_name": "Kuvalis",
        "email": "carlie.kuvalis@example.com",
        "phone": "+1234567890",
        "company_name": "Konopelski Kuvalis Group"
      },
      "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"
    }
  }
}