メインコンテンツへスキップ
GET
/
api
/
v1
/
server-to-server-interface
/
subscription
/
list
サブスクリプション一覧を取得
curl --request GET \
  --url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list \
  --header 'Authorization: <api-key>' \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list"

headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<api-key>', 'x-api-key': '<api-key>'}};

fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/list")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "success": true,
  "status_code": 200,
  "is_live": false,
  "subscription_details": [
    {
      "id": "2048b01c-1512-45b9-98fc-27aac4deabce",
      "type": "CYCLE",
      "max_cycle_count": 10,
      "status": "ACTIVE",
      "completed_payment_cycle": 1,
      "next_payment_date": "2024-12-01T00:00:00.000Z",
      "next_payment_cycle": 2,
      "subscription_plan_details": {
        "name": "Three weeks plan",
        "desc": "Billed every two days",
        "billing_cycle_type": "DAYS",
        "billing_cycle_interval": 2,
        "amount": 1000,
        "ccy": "JPY",
        "trial_period_duration": "",
        "trial_period_duration_type": "NONE",
        "plan_discount_percentage": 10,
        "plan_discount_duration": 2
      },
      "subscription_transaction_details": [
        {
          "id": "00a33a30-be2d-4d5a-8d4f-659a6999d2ff",
          "ref": 69400,
          "cycle": 1,
          "status": "SUCCESSFUL",
          "transaction_date": "2024-11-30T00:00:00.000Z",
          "amount": 900,
          "ccy": "JPY",
          "event": "CAPTURED"
        }
      ]
    }
  ]
}

備考

このAPIにはリクエストペイロードは必要ありません。リクエストヘッダーに正しい認証情報(APIキーなど)が含まれていることを確認してください。
ヘッダー説明
x-api-key資格情報と一緒に提供されます。
AuthorizationPO Gatewayの加盟店詳細から取得したライブAPIキー。
Content-Typeすべてのレスポンス属性がJSON形式であることを示します(application/jsonに設定)。

重要なポイント

サブスクリプションデータを取得

  • サブスクリプションリストAPIは、加盟店がすべてのサブスクリプションプランの状態を追跡できるようにし、アクティブ、キャンセル済み、または期限切れのサブスクリプションを含みます。

サブスクリプションデータ - 各サブスクリプションレコードには次の情報が含まれます

  • サブスクリプションID
  • プラン名と説明
  • 現在のステータス(アクティブ、期限切れ、またはキャンセル済み)
  • 開始日と終了日
  • サイクル間隔と次の請求日
  • 試用期間と割引情報(該当する場合)。

承認

Authorization
string
header
必須

認証のためのAPIキー。形式:'Basic YOUR_API_KEY_HERE'

x-api-key
string
header
必須

x-api-key専用のAPIキー。

レスポンス

200 - application/json

サブスクリプションの詳細を含む成功した応答。

success
boolean

取引が成功したかどうかを示します。

:

true

status_code
integer

応答のHTTPステータスコード。

:

200

is_live
boolean

取引が本番環境かテスト環境かを示します。

:

false

subscription_details
object[]

サブスクリプションの詳細の一覧。