Skip to content

Latest commit

 

History

History
311 lines (208 loc) · 7.69 KB

PlansApi.md

File metadata and controls

311 lines (208 loc) · 7.69 KB

LagoClient\PlansApi

All URIs are relative to https://api.getlago.com/api/v1, except if the operation defines another base path.

Method HTTP request Description
createPlan() POST /plans Create a new plan
destroyPlan() DELETE /plans/{code} Delete a plan
findAllPlans() GET /plans Find plans
findPlan() GET /plans/{code} Find plan by code
updatePlan() PUT /plans/{code} Update an existing plan

createPlan()

createPlan($plan_input): \LagoClient\Model\Plan

Create a new plan

Create a new plan

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\PlansApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$plan_input = new \LagoClient\Model\PlanInput(); // \LagoClient\Model\PlanInput | Plan payload

try {
    $result = $apiInstance->createPlan($plan_input);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->createPlan: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
plan_input \LagoClient\Model\PlanInput Plan payload

Return type

\LagoClient\Model\Plan

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

destroyPlan()

destroyPlan($code): \LagoClient\Model\Plan

Delete a plan

Delete a plan

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\PlansApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$code = example_code; // string | Code of the existing plan

try {
    $result = $apiInstance->destroyPlan($code);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->destroyPlan: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
code string Code of the existing plan

Return type

\LagoClient\Model\Plan

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

findAllPlans()

findAllPlans(): \LagoClient\Model\PlansPaginated

Find plans

Find all plans in certain organisation

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\PlansApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->findAllPlans();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->findAllPlans: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\LagoClient\Model\PlansPaginated

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

findPlan()

findPlan($code): \LagoClient\Model\Plan

Find plan by code

Return a single plan

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\PlansApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$code = example_code; // string | Code of the existing plan

try {
    $result = $apiInstance->findPlan($code);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->findPlan: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
code string Code of the existing plan

Return type

\LagoClient\Model\Plan

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updatePlan()

updatePlan($code, $plan_input): \LagoClient\Model\Plan

Update an existing plan

Update an existing plan by code

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\PlansApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$code = example_code; // string | Code of the existing plan
$plan_input = new \LagoClient\Model\PlanInput(); // \LagoClient\Model\PlanInput | Update an existing plan

try {
    $result = $apiInstance->updatePlan($code, $plan_input);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->updatePlan: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
code string Code of the existing plan
plan_input \LagoClient\Model\PlanInput Update an existing plan

Return type

\LagoClient\Model\Plan

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]