8Pay
  • Introduction
  • Features
  • Chains
  • Payment flow
  • Sandbox Environment
  • Fees
  • Guides
    • Set up single payments
    • Set up recurring payments
    • Setup automatic buy (DCA) on Dex
  • Integrations
    • Overview
    • Short URLs
    • Buttons
      • One Time
      • Fixed Recurring
      • Variable Recurring
      • On Demand
    • Shopify
    • Woocommerce
    • Streaming Donations
    • JavaScript SDK
  • REST API
    • Overview
    • One Time
      • Payments
      • Transfers
      • Short Urls
    • Wallet to wallet
      • Payments
      • Transfers
    • Fixed Recurring
      • Plans
      • Subscriptions
      • Billings
      • Cancellations
      • Short Urls
      • Transfers
      • Webhook
    • Variable Recurring
      • Plans
      • Subscriptions
      • Billings
      • Cancellation Requests
      • Cancellations
      • Webhook
      • Transfers
      • Short Urls
    • On Demand
      • Plans
      • Subscriptions
      • Allowances
      • Billings
      • Cancellations
      • Webhook
      • Transfers
      • Short Urls
    • Scheduled Payments
      • Schedules
      • Executions
      • Cancellation
      • Transfers
    • Invest (DCA)
      • Strategies
      • Executions
      • Cancellation
    • Webhook Notifications
  • Webhook notifications
    • Overview
    • Events
      • One Time
      • Wallet-to-Wallet
      • Fixed Recurring
      • Variable Recurring
      • On Demand
  • Advanced Features
    • Gas Wallet
    • Autobiller
  • Appendix
    • Categories
    • Tokens
Powered by GitBook
On this page
  • Get billings of a plan
  • Get billings of a subscription

Was this helpful?

  1. REST API
  2. On Demand

Billings

Throughout a subscription’s cycle, the vendor can perform an unlimited number of billings as long their total sum doesn’t exceed the maximum allowance set by the user. Billings can be triggered from the webapp or the 8Pay Javascript SDK.

Billings can fail if the subscriber hasn’t got enough funds on his wallet, hasn’t enabled the token or his spending limit fo the token is too low. They can be retried at a later time.

Get billings of a plan

GET https://api.8pay.network/v1/:chain/on-demand/plans/:planId/billings

Path Parameters

Name
Type
Description

planId

string

ID of the plan

chain

string

Query Parameters

Name
Type
Description

triggeredBy

string

filter by the user who triggered the billing

from

number

filter by timestamp (default 0)

to

number

filter by timestamp (default current timestamp)

sort

string

asc or desc based on timestamp (default desc)

Headers

Name
Type
Description

Authorization

string

Bearer <api-key>

{
    "data": [
        {
            "subscriptionId": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "success": 1,
            "amount": "10",
            "fee": "0.001",
            "token": "8PAY",
            "receiver": "0x5A4278004294D3C8Ba351c2533951A79EE48D9b8",
            "timestamp": 1571646052,
            "triggeredBy": "0xe42fD8a58A82fDF624A8a94dA03a0e44F9934Dff",
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed"
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}

Get billings of a subscription

GET https://api.8pay.network/v1/:chain/on-demand/subscriptions/:subscriptionId/billings

Path Parameters

Name
Type
Description

subscriptionId

string

ID of the subscription

chain

string

Query Parameters

Name
Type
Description

from

number

filter by timestamp (default 0)

to

number

filter by timestamp (default current timestamp)

sort

string

asc or desc based on timestamp (default desc)

Headers

Name
Type
Description

Authorization

string

Bearer <api-key>

{
    "data": [
        {
            "subscriptionId": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "success": 1,
            "amount": "10",
            "fee": "0.001",
            "token": "8PAY",
            "receiver": "0x5A4278004294D3C8Ba351c2533951A79EE48D9b8",
            "timestamp": 1571646052,
            "triggeredBy": "0xe42fD8a58A82fDF624A8a94dA03a0e44F9934Dff",
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed"
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}
PreviousAllowancesNextCancellations

Last updated 2 years ago

Was this helpful?

chain identifier
chain identifier