Post
Subs API Post methods
Last updated
Subs API Post methods
Last updated
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.
For the first call the signature must come from the subscriber wallet
POST
https://api.subsprotocol.com/creator/subscribe
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
Here the signature must come from the creator of the application.
POST
https://api.subsprotocol.com/creator/addPayment
x-api-key*
String
API Key
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
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.
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.