Skip to content

Latest commit

 

History

History
551 lines (380 loc) · 17 KB

SubscriptionApi.md

File metadata and controls

551 lines (380 loc) · 17 KB

Elepay\SubscriptionApi

All URIs are relative to https://api.elepay.io, except if the operation defines another base path.

Method HTTP request Description
cancelSubscription() POST /subscriptions/{subscriptionId}/cancel Cancel subscription
createSubscription() POST /subscriptions Create subscription
listSubscriptionPeriods() GET /subscriptions/{subscriptionId}/periods List subscription periods
listSubscriptions() GET /subscriptions List subscriptions
resumeSubscription() POST /subscriptions/{subscriptionId}/resume Resume subscription
retrieveSubscription() GET /subscriptions/{subscriptionId} Retrieve subscription
startSubscription() POST /subscriptions/{subscriptionId}/start Start subscription
updateSubscription() POST /subscriptions/{subscriptionId} Update subscription

cancelSubscription()

cancelSubscription($subscriptionId): \Elepay\Model\SubscriptionDto

Cancel subscription

定期課金をキャンセルし、現在の周期の終了日をもって定期課金を終了させます。 キャンセルした定期課金は再スタートできません。 処理中の定期課金はキャンセルできません。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionId = 'subscriptionId_example'; // string | Subscription ID

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

Parameters

Name Type Description Notes
subscriptionId string Subscription ID

Return type

\Elepay\Model\SubscriptionDto

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=utf-8

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

createSubscription()

createSubscription($subscriptionReq): \Elepay\Model\SubscriptionDto

Create subscription

定期課金を作成します。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionReq = new \Elepay\Model\SubscriptionReq(); // \Elepay\Model\SubscriptionReq

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

Parameters

Name Type Description Notes
subscriptionReq \Elepay\Model\SubscriptionReq

Return type

\Elepay\Model\SubscriptionDto

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json;charset=utf-8
  • Accept: application/json;charset=utf-8

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

listSubscriptionPeriods()

listSubscriptionPeriods($subscriptionId, $limit, $offset): \Elepay\Model\SubscriptionPeriodsResponse

List subscription periods

定期課金の周期情報をリストで取得します。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionId = 'subscriptionId_example'; // string | Subscription ID
$limit = 20; // int | 最大件数
$offset = 0; // int | 検索開始位置

try {
    $result = $apiInstance->listSubscriptionPeriods($subscriptionId, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->listSubscriptionPeriods: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
subscriptionId string Subscription ID
limit int 最大件数 [optional] [default to 20]
offset int 検索開始位置 [optional] [default to 0]

Return type

\Elepay\Model\SubscriptionPeriodsResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=utf-8

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

listSubscriptions()

listSubscriptions($customerId, $from, $to, $status, $limit, $offset): \Elepay\Model\SubscriptionsResponse

List subscriptions

定期課金を一覧で取得します。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$customerId = 'customerId_example'; // string | Customer ID
$from = 56; // int | 開始時間(UTC)。指定した時間以降に作成されたデータを取得します。
$to = 56; // int | 終了時間(UTC)。指定した時間以前に作成されたデータを取得します
$status = new \Elepay\Model\SubscriptionStatusType(); // SubscriptionStatusType | 定期課金ステータス
$limit = 20; // int | 最大件数
$offset = 0; // int | 検索開始位置

try {
    $result = $apiInstance->listSubscriptions($customerId, $from, $to, $status, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionApi->listSubscriptions: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customerId string Customer ID [optional]
from int 開始時間(UTC)。指定した時間以降に作成されたデータを取得します。 [optional]
to int 終了時間(UTC)。指定した時間以前に作成されたデータを取得します [optional]
status SubscriptionStatusType 定期課金ステータス [optional]
limit int 最大件数 [optional] [default to 20]
offset int 検索開始位置 [optional] [default to 0]

Return type

\Elepay\Model\SubscriptionsResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=utf-8

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

resumeSubscription()

resumeSubscription($subscriptionId): \Elepay\Model\SubscriptionDto

Resume subscription

延滞中(status=past_due)の定期課金を再開させます。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionId = 'subscriptionId_example'; // string | Subscription ID

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

Parameters

Name Type Description Notes
subscriptionId string Subscription ID

Return type

\Elepay\Model\SubscriptionDto

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=utf-8

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

retrieveSubscription()

retrieveSubscription($subscriptionId): \Elepay\Model\SubscriptionDto

Retrieve subscription

定期課金情報を取得します。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionId = 'subscriptionId_example'; // string | Subscription ID

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

Parameters

Name Type Description Notes
subscriptionId string Subscription ID

Return type

\Elepay\Model\SubscriptionDto

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=utf-8

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

startSubscription()

startSubscription($subscriptionId): \Elepay\Model\SubscriptionDto

Start subscription

新規(status=new)の定期課金を開始させます。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionId = 'subscriptionId_example'; // string | Subscription ID

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

Parameters

Name Type Description Notes
subscriptionId string Subscription ID

Return type

\Elepay\Model\SubscriptionDto

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=utf-8

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

updateSubscription()

updateSubscription($subscriptionId, $subscriptionUpdateReq): \Elepay\Model\SubscriptionDto

Update subscription

定期課金を更新します。

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Elepay\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

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


$apiInstance = new Elepay\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
);
$subscriptionId = 'subscriptionId_example'; // string | Subscription ID
$subscriptionUpdateReq = new \Elepay\Model\SubscriptionUpdateReq(); // \Elepay\Model\SubscriptionUpdateReq

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

Parameters

Name Type Description Notes
subscriptionId string Subscription ID
subscriptionUpdateReq \Elepay\Model\SubscriptionUpdateReq

Return type

\Elepay\Model\SubscriptionDto

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json;charset=utf-8
  • Accept: application/json;charset=utf-8

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