ログイン
始める

Easy Digital Downloads ドキュメント

Easy Digital Downloads のドキュメント、参考資料、チュートリアル

定期支払い – REST API エンドポイント

定期支払いは、Easy Digital Downloads に組み込まれている既存の RESTful API を拡張したものです。アクセスするには次のようになります。

https://example.com/edd-api/subscriptions/?key=YOUR_API_KEY&token=YOUR_API_TOKEN

注意: example.com はご自身のドメインに、キーとトークンの値はご自身のものに置き換えてください。

上記の例では、ストア内のすべての既存のサブスクリプションのリストが返されます。

入力

定期支払い REST API は、キーとトークンに加えて、customernumberpaged の 3 つのオプションを受け付けます。

顧客

顧客の入力は、customer_id を表す整数またはメールアドレスのいずれかです。結果の URL は次のようになります。

https://example.com/edd-api/subscriptions/?key=YOUR_API_KEY&token=YOUR_API_TOKEN&customer=2

または

https://example.com/edd-api/subscriptions/?key=YOUR_API_KEY&token=YOUR_API_TOKEN&[email protected]

件数

number オプションは整数を受け取り、その件数の結果を返します。例は次のようになります。

https://example.com/edd-api/subscriptions/?key=YOUR_API_KEY&token=YOUR_API_TOKEN&number=5

ページ

paged オプションを使用すると、より大きな数値のスライスを選択できます。たとえば、100 件のエントリがあり、number=10 を使用した場合、paged=2 を渡すと 11 ~ 20 行目を取得できます。次のようになります。

https://example.com/edd-api/subscriptions/?key=YOUR_API_KEY&token=YOUR_API_TOKEN&number=10&paged=2

出力

各サブスクリプションの出力には、そのサブスクリプションに関するすべての情報と、顧客および各更新(子)支払いに関する情報が含まれます。さらに、すべて結果の情報を取得するのに費やされた時間を示す値があります。例:

{
    "subscriptions": [
        {
            "info": {
                "u0000EDD_Subscriptionu0000subs_db": {
                    "table_name": "wp_edd_subscriptions",
                    "version": "1.0",
                    "primary_key": "id"
                },
                "id": "1",
                "customer_id": "2",
                "period": "month",
                "initial_amount": "50.00",
                "recurring_amount": "50.00",
                "bill_times": "0",
                "parent_payment_id": "87",
                "product_id": "85",
                "created": "2016-03-15 15:36:30",
                "expiration": "2016-04-15 23:59:59",
                "status": "active",
                "profile_id": "paypal-363e3cc178dab152bb59b958024bce75",
                "gateway": "paypal",
                "customer": {
                    "id": "2",
                    "purchase_count": "2",
                    "purchase_value": "20.000000",
                    "email": "[email protected]",
                    "name": "Jane Doe",
                    "date_created": "2016-03-07 22:33:44",
                    "payment_ids": "16",
                    "user_id": "3",
                    "notes": [

                    ]
                }
            },
            "payments": [
                {
                    "id": 106,
                    "amount": 10.36,
                    "date": "March 21, 2016",
                    "status": "Renewal"
                },
                {
                    "id": 105,
                    "amount": 10,
                    "date": "March 21, 2016",
                    "status": "Renewal"
                },
                {
                    "id": 104,
                    "amount": 10,
                    "date": "March 21, 2016",
                    "status": "Renewal"
                }
            ]
        }
    ],
    "request_speed": 0.076335906982422
}
この記事は役に立ちましたか?

今日から販売を開始しましょう!

50,000人以上のスマートなストアオーナーに参加して、WordPressでデジタル製品を販売する最も簡単な方法を使い始めましょう。

Copyright © 2025 Sandhills Development, LLC

[universally_switcher]