Skip to content

Latest commit

 

History

History
1168 lines (830 loc) · 35.5 KB

SubscriptionApi.md

File metadata and controls

1168 lines (830 loc) · 35.5 KB

Yoast\MyYoastApiClient\SubscriptionApi

All URIs are relative to https://my.yoast.test

Method HTTP request Description
calculateExpansionPrice GET /api/Subscriptions/calculateExpansionPrice/{id}/{subscriptionNumber} Calculate expansion price
deleteOne DELETE /api/Subscriptions/{id} Delete a subscription
ensureAdmissionScript GET /api/Subscriptions/ensureAdmissions Ensure Admission for subscriptions script
forceCancel POST /api/Subscriptions/{id}/force-cancel Forcefully cancel a subscription
getDetails GET /api/Subscriptions/{id}/details
getExpiringSubscriptions GET /api/Subscriptions/expiring
getMany GET /api/Subscriptions Get subscriptions
getManyPaged GET /api/Subscriptions/paged Get subscriptions
getMutations GET /api/Subscriptions/{id}/mutations Get all subscription mutation events
getOne GET /api/Subscriptions/{id} Get a subscription
getOneAsEntity GET /api/Subscriptions/{id}/asEntity Get a subscription
getProductSwitchOptions GET /api/Subscriptions/{id}/product-switch-options Fetch product switch options
linkSite POST /api/Subscriptions/link-site Link a subscription to provided site URL
recalculateSubscriptionCount POST /api/Subscriptions/{id}/recalculateSubscriptionCount Recalculate SubscriptionCount.
renew GET /api/Subscriptions/renew/{subscriptionNumber}/{secretKey} Renew subscriptions
setExpiryDate POST /api/Subscriptions/setExpiryDate Set Date.
switchPaymentMethod GET /api/Subscriptions/switchPaymentMethod/{id}/{subscriptionNumber}
switchProduct POST /api/Subscriptions/{id}/switch-product Switch to another product
switchToAutomatic GET /api/Subscriptions/enable-automatic-billing/{id}/{subscriptionNumber}
transferOwnership POST /api/Subscriptions/transfer Transfer subscription ownership
upgrade GET /api/Subscriptions/upgrade/{subscriptionNumber}/{secretKey} Upgrade subscriptions

calculateExpansionPrice

string calculateExpansionPrice($id, $subscriptionNumber)

Calculate expansion price

Route for calculating the subscription expansion price.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 | 
$subscriptionNumber = "subscriptionNumber_example"; // string | 

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

Parameters

Name Type Description Notes
id string
subscriptionNumber string

Return type

string

Authorization

bearer

HTTP request headers

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

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

deleteOne

string deleteOne($id)

Delete a subscription

Deletes a single subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

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

Parameters

Name Type Description Notes
id string

Return type

string

Authorization

bearer

HTTP request headers

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

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

ensureAdmissionScript

ensureAdmissionScript()

Ensure Admission for subscriptions script

One time use script to give a set of subscriptions the admission they should have

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 {
    $apiInstance->ensureAdmissionScript();
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->ensureAdmissionScript: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

forceCancel

forceCancel($id)

Forcefully cancel a subscription

This immediately cancels a subscription without notifying the customer. The customer will lose access instantly

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

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

Parameters

Name Type Description Notes
id string

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

getDetails

getDetails($id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

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

Parameters

Name Type Description Notes
id string

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

getExpiringSubscriptions

\Yoast\MyYoastApiClient\Model\Subscription[] getExpiringSubscriptions($from, $until, $requiresManualRenewal)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 
$until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 
$requiresManualRenewal = true; // bool | 

try {
    $result = $apiInstance->getExpiringSubscriptions($from, $until, $requiresManualRenewal);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->getExpiringSubscriptions: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
from \DateTime
until \DateTime
requiresManualRenewal bool [optional]

Return type

\Yoast\MyYoastApiClient\Model\Subscription[]

Authorization

bearer

HTTP request headers

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

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

getMany

\Yoast\MyYoastApiClient\Model\Subscription[] getMany($filter)

Get subscriptions

Get and filter subscriptions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$filter = new \stdClass; // object | Used for filtering/joining the results.

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

Parameters

Name Type Description Notes
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\Subscription[]

Authorization

bearer

HTTP request headers

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

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

getManyPaged

getManyPaged($filter)

Get subscriptions

Get and filter subscriptions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$filter = new \stdClass; // object | Used for filtering/joining the results.

try {
    $apiInstance->getManyPaged($filter);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->getManyPaged: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
filter object Used for filtering/joining the results. [optional]

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

getMutations

\Yoast\MyYoastApiClient\Model\SubscriptionMutation[] getMutations($id)

Get all subscription mutation events

Fetch a list of occurred mutation events for a subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionMutation[]

Authorization

bearer

HTTP request headers

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

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

getOne

\Yoast\MyYoastApiClient\Model\Subscription getOne($id, $filter)

Get a subscription

Get a single subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 
$filter = new \stdClass; // object | Used for filtering/joining the results.

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

Parameters

Name Type Description Notes
id string
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\Subscription

Authorization

bearer

HTTP request headers

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

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

getOneAsEntity

\Yoast\MyYoastApiClient\Model\Subscription getOneAsEntity($id, $filter)

Get a subscription

Get a single subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 
$filter = new \stdClass; // object | Used for filtering/joining the results.

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

Parameters

Name Type Description Notes
id string
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\Subscription

Authorization

bearer

HTTP request headers

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

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

getProductSwitchOptions

\Yoast\MyYoastApiClient\Model\ProductSwitchOptionDto[] getProductSwitchOptions($id)

Fetch product switch options

Route for fetching the products the caller can switch this subscription to.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\ProductSwitchOptionDto[]

Authorization

bearer

HTTP request headers

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

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

linkSite

\Yoast\MyYoastApiClient\Model\Site linkSite($body)

Link a subscription to provided site URL

Links the provided site URL to a subscription after successfully checking out.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\LinkSiteDto(); // \Yoast\MyYoastApiClient\Model\LinkSiteDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\LinkSiteDto

Return type

\Yoast\MyYoastApiClient\Model\Site

Authorization

bearer

HTTP request headers

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

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

recalculateSubscriptionCount

\Yoast\MyYoastApiClient\Model\Subscription recalculateSubscriptionCount($id)

Recalculate SubscriptionCount.

Route to recalculate the Subscription Count for a given subscription.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 | 

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\Subscription

Authorization

bearer

HTTP request headers

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

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

renew

\Yoast\MyYoastApiClient\Model\Subscription renew($subscriptionNumber, $secretKey, $utmMedium, $utmSource)

Renew subscriptions

Route for renewing subscriptions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$subscriptionNumber = "subscriptionNumber_example"; // string | 
$secretKey = "secretKey_example"; // string | 
$utmMedium = "utmMedium_example"; // string | 
$utmSource = "utmSource_example"; // string | 

try {
    $result = $apiInstance->renew($subscriptionNumber, $secretKey, $utmMedium, $utmSource);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->renew: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
subscriptionNumber string
secretKey string
utmMedium string
utmSource string

Return type

\Yoast\MyYoastApiClient\Model\Subscription

Authorization

bearer

HTTP request headers

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

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

setExpiryDate

\Yoast\MyYoastApiClient\Model\Subscription setExpiryDate($body)

Set Date.

Sets either the end date or next payment date, based on which one the subscription already has.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\SetExpiryDateDto(); // \Yoast\MyYoastApiClient\Model\SetExpiryDateDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\SetExpiryDateDto

Return type

\Yoast\MyYoastApiClient\Model\Subscription

Authorization

bearer

HTTP request headers

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

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

switchPaymentMethod

switchPaymentMethod($id, $subscriptionNumber)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 | 
$subscriptionNumber = "subscriptionNumber_example"; // string | 

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

Parameters

Name Type Description Notes
id string
subscriptionNumber string

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

switchProduct

\Yoast\MyYoastApiClient\Model\Subscription[] switchProduct($body, $id)

Switch to another product

Trade in time remaining on a subscription to up- or downgrade to another product.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\ProductDto(); // \Yoast\MyYoastApiClient\Model\ProductDto | 
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\ProductDto
id string

Return type

\Yoast\MyYoastApiClient\Model\Subscription[]

Authorization

bearer

HTTP request headers

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

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

switchToAutomatic

switchToAutomatic($id, $subscriptionNumber)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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 | 
$subscriptionNumber = "subscriptionNumber_example"; // string | 

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

Parameters

Name Type Description Notes
id string
subscriptionNumber string

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

transferOwnership

\Yoast\MyYoastApiClient\Model\Subscription[] transferOwnership($body)

Transfer subscription ownership

Change the subscription owner from one customer to another

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\TransferOwnershipDto(); // \Yoast\MyYoastApiClient\Model\TransferOwnershipDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\TransferOwnershipDto

Return type

\Yoast\MyYoastApiClient\Model\Subscription[]

Authorization

bearer

HTTP request headers

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

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

upgrade

\Yoast\MyYoastApiClient\Model\Subscription upgrade($subscriptionNumber, $secretKey)

Upgrade subscriptions

Route for upgrading subscriptions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi(
    // 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
);
$subscriptionNumber = "subscriptionNumber_example"; // string | 
$secretKey = "secretKey_example"; // string | 

try {
    $result = $apiInstance->upgrade($subscriptionNumber, $secretKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->upgrade: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
subscriptionNumber string
secretKey string

Return type

\Yoast\MyYoastApiClient\Model\Subscription

Authorization

bearer

HTTP request headers

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

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