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 two different statuses:
ACTIVE
: user can be charged for its usageCANCELLED
: the subscription was cancelled by the userTERMINATED
: the subscription was terminated by the vendor
Get a list of subscriptions
GET
https://api.8pay.network/v1/:chain/on-demand/subscriptions
Path Parameters
chain
string
Query Parameters
user
string
filter by user
status
string
filter by status (ACTIVE
, CANCELLED
or TERMINATED
)
from
number
filter by subscribedAt
(default 0)
to
number
filter by subscribedAt
(default current timestamp)
sortBy
string
order by subscribedAt
, cycleStart
or cycleEnd
(default subscribedAt
)
sort
string
asc
or desc
(default desc
), sort based on sortBy
query parameter
Headers
Authorization
string
Bearer <api-key>
Get subscriptions of a plan
GET
https://api.8pay.network/v1/:chain/on-demand/plans/:planId/subscriptions
Path Parameters
planId
string
ID of the plan
chain
string
Query Parameters
user
string
filter by user
status
string
filter by status (ACTIVE
, CANCELLED
or TERMINATED
)
from
number
filter by subscribedAt
(default 0)
to
number
filter by subscribedAt
(default current timestamp)
sortBy
string
order by subscribedAt
, cycleStart
or cycleEnd
(default subscribedAt
)
sort
string
asc
or desc
(default desc
), sort based on sortBy
query parameter
Headers
Authorization
string
Bearer <api-key>
Get a subscription
GET
https://api.8pay.network/v1/bsc/on-demand/subscriptions/:subscriptionId
Path Parameters
subscriptionId
string
ID of the subscription
chain
string
Headers
Authorization
string
Bearer <api-key>
Last updated