Skip to content

Latest commit

 

History

History
311 lines (218 loc) · 10.4 KB

SubscriptionProvisioningApi.md

File metadata and controls

311 lines (218 loc) · 10.4 KB

Yoast\MyYoastApiClient\SubscriptionProvisioningApi

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

Method HTTP request Description
cancelSubscription POST /api/provisioning/subscriptions/{id}/cancel Cancel a single subscription
create POST /api/provisioning/subscriptions/create Create a subscription
getOne GET /api/provisioning/subscriptions/{id} Get a subscription
refundSubscription POST /api/provisioning/subscriptions/{id}/refund Refund a single subscription
renewSubscription POST /api/provisioning/subscriptions/{id}/renew Renew a subscription
setSiteForSubscription POST /api/provisioning/subscriptions/{id}/set-site Link a subscription to a site

cancelSubscription

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto cancelSubscription($body, $id)

Cancel a single subscription

Cancel the subscription when the period ends, or immediately if that is requested, or the subscription is not valid

Example

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

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

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

Parameters

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

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto

Authorization

No authorization required

HTTP request headers

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

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

create

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto create($body)

Create a subscription

Creates a subscription for a customer.

Example

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

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

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

Parameters

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

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto

Authorization

No authorization required

HTTP request headers

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

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

getOne

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto getOne($id)

Get a subscription

Get a single subscription that was provisioned for a third party

Example

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

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

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto

Authorization

No authorization required

HTTP request headers

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

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

refundSubscription

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto refundSubscription($id)

Refund a single subscription

Refund the subscription.

Example

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

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

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto

Authorization

No authorization required

HTTP request headers

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

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

renewSubscription

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto renewSubscription($id)

Renew a subscription

Renew the subscription for a new period.

Example

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

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

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto

Authorization

No authorization required

HTTP request headers

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

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

setSiteForSubscription

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto setSiteForSubscription($body, $id)

Link a subscription to a site

Links the subscription to a customer's website. Setting a site the the subscription will remove the site if already set.

Example

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

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

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

Parameters

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

Return type

\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto

Authorization

No authorization required

HTTP request headers

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

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