サブスクリプション一覧を取得
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は、加盟店がすべてのアクティブ、キャンセル済み、または期限切れのサブスクリプションのリストを取得できるようにし、顧客のサブスクリプション状況を概観します。
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 | 資格情報と一緒に提供されます。 |
Authorization | PO Gatewayの加盟店詳細から取得したライブAPIキー。 |
Content-Type | すべてのレスポンス属性がJSON形式であることを示します(application/jsonに設定)。 |
重要なポイント
承認
認証のためのAPIキー。形式:'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
⌘I