Subscriptions Usage

Example Request

<?php
//Set up API path and method
$base_url = "https://app.paykickstart.com/api/";
$route = "subscriptions/usage";
$url = $base_url . $route;

//Create request data string
$data = http_build_query([
    'auth_token'    => '3A0GTRFIJHYE',
    'invoice_id'    => 'PK-PORW20JQE5',
    'units'         => 100,
    'notes'         => 'Generated a PDF Report'
]);

//Execute cURL request
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);
curl_close($ch);

//Output Response
echo json_decode($output);

Example Response

{
    "status_code": 200,
    "units_remaining": 300,
    "units_consumed": 700,
    "units_included": 1000
}

This POST request reactivates a canceled subscription

ARGUMENTS

invoice_id

The unique Paykickstart purchase ID


auth_token

The Paykickstart vendor’s API Key


units

Set the number of usage units to attribute to this subscription for the current subscription period. This field can be negative if you wish to “credit” units to a specific subscription for the current subscriptino period.


notes

Add a comment/reason for the usage / credit. This field is not required.