Subscriptions

Get subscriptions

Returns a paginated list of all subscriptions

/products

Optional filters

  • reference_id only return subscriptions with a specific reference id
  • email only return subscriptions with a specific email address

Example Request

/subscriptions?filter[email]=jane@octany.com

Example JSON response

{
  "status": 200,
  "success": true,
  "data": [
    {
      "id": 29281116,
      "customer_id": 15831253
    },
    {
      "id": 24381116,
      "customer_id": 23831253
    }
  ],
  "pagination": {
    "count": 20,
    "total": 27,
    "perPage": 20,
    "currentPage": 1,
    "totalPages": 2,
    "links": []
  }
}

Get subscription

Returns a paginated list of all customers

/subscription/29281116

Example JSON response

{
  "status": 200,
  "success": true,
  "data": {
    "id": 29281116,
    "customer_id": 15831253,
    "price": 29900,
    "vat": 2500,
    "currency": "sek",
    "renews_at": "2020-01-06T14:55:33+00:00",
    "ends_at": null,
    "reference_id": "102676",
    "reference_name": "",
    "status": "active",
    "billing_method": {
      "email": "invoice@octany.com",
      "type": "stripe"
    },
    "product": {
      "id": 1225,
      "name": "Base",
      "type": "month",
      "price": 29900,
      "currency": "sek",
      "vat_rate": 2500
    }
  }
}

Cancel subscription

A cancelled subscription has a null  value for renews_at  and the status: cancelled

/subscription/29281116/cancel

Example JSON response

{
  "status": 200,
  "success": true,
  "data": {
    "id": 70212202,
    "customer_id": 452512733,
    "price": 59900,
    "vat": 2500,
    "currency": "sek",
    "renews_at": null,
    "ends_at": "2020-02-17T13:35:14+00:00",
    "reference_id": null,
    "reference_name": null,
    "status": "cancelled"
  }
}

Change product

This will change the subscription product and price to a product with an ID of 1234 . Please note that you can't switch a recurring donation product.

/subscription/29281116/product?product=1234

Svarade detta på din fråga? Tack för din feedback Det var ett problem att skicka din feedback

Behöver du fortfarande hjälp? Kontakta oss Kontakta oss