Skip to content

Latest commit

 

History

History
337 lines (215 loc) · 10.5 KB

PlansApi.md

File metadata and controls

337 lines (215 loc) · 10.5 KB

DigitalRiver\ApiSdk\PlansApi

All URIs are relative to https://api.digitalriver.com

Method HTTP request Description
createPlans POST /plans Creates a Plan
deletePlans DELETE /plans/{id} Deletes a Plan by ID
listPlans GET /plans Returns a list of Plans
retrievePlans GET /plans/{id} Gets a Plan by ID
updatePlans POST /plans/{id} Updates a Plan

createPlans

\DigitalRiver\ApiSdk\Model\Plan createPlans($plan_request)

Creates a Plan

Submit this request to create a Plan.

Example

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


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


$apiInstance = new DigitalRiver\ApiSdk\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_request = new \DigitalRiver\ApiSdk\Model\PlanRequest(); // \DigitalRiver\ApiSdk\Model\PlanRequest | 
// Refer \DigitalRiver\ApiSdk\Model\PlanRequest::$setters in digital-river-php/lib/Model/PlanRequest.php to set the properties.

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

Parameters

Name Type Description Notes
plan_request \DigitalRiver\ApiSdk\Model\PlanRequest [optional]

Return type

\DigitalRiver\ApiSdk\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]

deletePlans

deletePlans($id)

Deletes a Plan by ID

Permanently deletes a Plan. In the request, send the plan's unique identifier as a path parameter. Only plans in a draft can be deleted.

Example

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


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


$apiInstance = new DigitalRiver\ApiSdk\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
);
$id = 'id_example'; // string | Plan identifier


try {
    $apiInstance->deletePlans($id);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->deletePlans: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string Plan identifier

Return type

void (empty response body)

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]

listPlans

\DigitalRiver\ApiSdk\Model\ListPlansResponse listPlans($state, $interval, $ending_before, $starting_after, $limit)

Returns a list of Plans

Gets the Plans specified in the request.

Example

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


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


$apiInstance = new DigitalRiver\ApiSdk\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
);
$state = 'state_example'; // string | The state associated with the Plans you want to retrieve.

$interval = 'interval_example'; // string | The billing interval associated with the Plans you want to retrieve.

$ending_before = 'ending_before_example'; // string | A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xzy, your subsequent calls can include endingBefore=xzy in order to fetch the previous page of the list.

$starting_after = 'starting_after_example'; // string | A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xzy, your subsequent calls can include startingAfter=xzy in order to fetch the next page of the list.

$limit = 56; // int | A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.


try {
    $result = $apiInstance->listPlans($state, $interval, $ending_before, $starting_after, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlansApi->listPlans: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
state string The state associated with the Plans you want to retrieve. [optional]
interval string The billing interval associated with the Plans you want to retrieve. [optional]
ending_before string A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xzy, your subsequent calls can include endingBefore=xzy in order to fetch the previous page of the list. [optional]
starting_after string A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xzy, your subsequent calls can include startingAfter=xzy in order to fetch the next page of the list. [optional]
limit int A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. [optional]

Return type

\DigitalRiver\ApiSdk\Model\ListPlansResponse

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]

retrievePlans

\DigitalRiver\ApiSdk\Model\Plan retrievePlans($id)

Gets a Plan by ID

Retrieves the details of a Plan.

Example

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


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


$apiInstance = new DigitalRiver\ApiSdk\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
);
$id = 'id_example'; // string | Plan identifier.


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

Parameters

Name Type Description Notes
id string Plan identifier.

Return type

\DigitalRiver\ApiSdk\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]

updatePlans

\DigitalRiver\ApiSdk\Model\Plan updatePlans($id, $update_plan_request)

Updates a Plan

Updates the specified Plan.

Example

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


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


$apiInstance = new DigitalRiver\ApiSdk\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
);
$id = 'id_example'; // string | The Plan identifier.

$update_plan_request = new \DigitalRiver\ApiSdk\Model\UpdatePlanRequest(); // \DigitalRiver\ApiSdk\Model\UpdatePlanRequest | 
// Refer \DigitalRiver\ApiSdk\Model\UpdatePlanRequest::$setters in digital-river-php/lib/Model/UpdatePlanRequest.php to set the properties.

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

Parameters

Name Type Description Notes
id string The Plan identifier.
update_plan_request \DigitalRiver\ApiSdk\Model\UpdatePlanRequest [optional]

Return type

\DigitalRiver\ApiSdk\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]