Post

Subs API Post methods

The POST methods are completely free to use. Subs take care of the transaction fees. Your customers can now subscribe almost for free. They still need to pay the approval call.

circle-info

Please, note that you need super access to call these methods. If you don't have it yet, write to usarrow-up-right to get it.

For the first call the signature must come from the subscriber wallet

Gasless Subscription

POST https://api.subsprotocol.com/creator/subscribe

Request Body

Name
Type
Description

appId*

String

App ID

chain*

String

Chain Name

user*

String

User Address

token*

String

Token Address

paymentId*

String

Payment ID

sig*

String

Signature of appId, paymentId, token and nonce.

userChoosenPeriod*

String

Choosen duration of subscriptions

Gasless add Payment to an App

Here the signature must come from the creator of the application.

POST https://api.subsprotocol.com/creator/addPayment

Headers

Name
Type
Description

x-api-key*

String

API Key

Request Body

Name
Type
Description

appId*

String

App ID

chain*

String

Chain Name

appOwner*

String

AppOwner address

version*

String

Depends of the chain: testnet or mainnet

payments *

Payment[]

List of Payments

sig*

String

Signature of the appId and payments

Here you have a template for your addPayment request. Watch up the name is a string converted in Bytes32 You can try to convert here for your tests. https://www.devoven.com/string-to-bytes32arrow-up-right

Variables
Types
Description

name

Name of your app in Hexadecimal

owner

Address of the beneficiary of the fees for this payment

fee

Percent given to the owner of this payment

paymentType

MUST be 0 for ERC20 token We will SOON add ERC721 token

periodType

- 0 for One Time Payement

- 1 for Minute Payment

- 2 for Hour Payment

- 3 for Day Payment

- 4 for Week Payment

- 5 for Month Payment

- 6 for Year Payment

trialPeriod

Number of periodType given for free to the customer

limitPeriod

Number of debit, but also used for the approval needed to subscribe

loadingTime

Number of extra Days customers have if the debt didn't worked

Here is how you can make you own signature.

Last updated