v1

latestOpenAPI 3.1.02026-07-24270180.3 KB

Modify a subscription

Update an existing subscription

post/v1/subscriptions/{id}

Path parameters

idstring required

The Subscription ID received at the creation request.

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

The amount of the subscription payment

statusstring

The subscription status to modify to

descriptionstring
referencestring

A unique reference provided for the subscription

Response

200

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

Example response

{
  "status": 200,
  "resource": {
    "type": "subscription",
    "data": {
      "_id": "5f50f59580c950150a6038a9",
      "created_at": "2020-09-03T13:54:29.655Z",
      "updated_at": "2020-09-03T14:20:17.658Z",
      "user_id": "5d305bfbfac31b4448c738d6",
      "company_id": "5d305bfbfac31b4448c738d7",
      "amount": 10,
      "description": "Vitae commodi provident assumenda",
      "reference": "Fuga consequuntur sint ab magnam",
      "status": "active",
      "latest_charge_id": "5f50f5a980c950150a6038ad",
      "payment_source_id": "5f50f59580c950150a6038a7",
      "held_at": "2020-09-03T14:19:39.840Z",
      "last_change_by": "manual",
      "_source_ip_address": "192.168.0.1",
      "customer": {
        "customer_id": "5f50f59480c950150a6038a6",
        "first_name": "Wanda",
        "last_name": "Mertz",
        "email": "wanda.mertz@example.com",
        "reference": "CustomReference"
      },
      "statistics": {
        "total_collected_amount": 10,
        "successful_transactions": 1
      },
      "schedule": {
        "interval": "month",
        "start_date": "2020-09-03T11:30:00.000Z",
        "next_assessment": "2020-10-03T11:30:00.000Z",
        "next_assessment_planned": "2020-10-03T11:30:00.000Z",
        "first_assessment": "2020-09-03T11:30:00.000Z",
        "status": "complete",
        "processing_pended_at": "2020-09-03T14:34:49.406Z",
        "last_assessment_planned": "2020-09-03T11:30:00.000Z",
        "last_assessment": "2020-09-03T13:54:50.435Z",
        "completed_count": 1,
        "frequency": 1
      },
      "currency": "UAH",
      "gateway_type": "MPGS",
      "gateway_name": "MPGS 1",
      "gateway_mode": "test"
    }
  }
}