Subscriptions

Subscriptions allow you to charge customers on a recurring basis. Customers can subscribe through 8Pay’s hosted checkout pages that can be reached by embedded buttons, short urls and QR codes.

Subscriptions can be in three different statuses:

  • ACTIVE: a cycle is in progress, no payment is due

  • EXPIRED: the latest cycle is over and billing can be triggered

  • CANCELLATION_REQUESTED: user has requested cancellation and he’s waiting for vendor’s action

  • CANCELLED: the subscription was cancelled by the user

  • TERMINATED: the subscription was terminated by the vendor

Get a list of subscriptions

GET https://api.8pay.network/v1/:chain/variable-recurring/subscriptions

Path Parameters

Query Parameters

Headers

{
    "data": [
        {
            "id": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "user": "0x16F37b6c96C7038f3E4CDd7aAF9c9A8EC49c4EE7",
            "planId": "0x57b2059e526841b3dfd964144513359c9fcfd6d91040b6c47f589c1e032b6bf7",
            "status": "ACTIVE",
            "subscribedAt": 1571646052,
            "cycleStart": 1571646052,
            "cycleEnd": 1574238052,
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed"
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}

Get subscriptions of a plan

GET https://api.8pay.network/v1/:chain/variable-recurring/plans/:planId/subscriptions

Path Parameters

Query Parameters

Headers

{
    "data": [
        {
            "id": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "user": "0x16F37b6c96C7038f3E4CDd7aAF9c9A8EC49c4EE7",
            "planId": "0x57b2059e526841b3dfd964144513359c9fcfd6d91040b6c47f589c1e032b6bf7",
            "status": "ACTIVE",
            "subscribedAt": 1571646052,
            "cycleStart": 1571646052,
            "cycleEnd": 1574238052,
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed"
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}

Get a subscription

GET https://api.8pay.network/v1/:chain/variable-recurring/subscriptions/:subscriptionId

Path Parameters

Headers

{
    "id": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
    "user": "0x16F37b6c96C7038f3E4CDd7aAF9c9A8EC49c4EE7",
    "planId": "0x57b2059e526841b3dfd964144513359c9fcfd6d91040b6c47f589c1e032b6bf7",
    "status": "ACTIVE",
    "subscribedAt": 1571646052,
    "cycleStart": 1571646052,
    "cycleEnd": 1574238052,
    "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
    "transactionStatus": "confirmed"
}

Last updated