Stripe
Create customer in stripe based off user UP address
POST
https://gateway-relay.herokuapp.com/api/stripe/createCustomer
Headers
Authorization*
jwt token
received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.
{
walletAddress: '0x218C2BbaaBa0D66ddcD5De942Ed2980Bbfd1f004',
stripeCustomerId: 'cus_MD1vEjQloWXPQy'
}
Get Setup Intent client secret to capture payment method
GET
https://gateway-relay.herokuapp.com/api/stripe/getSetupIntent
Headers
Authorization*
jwt token
received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.
{
clientSecret: 'client...secret'
}
Insert or update existing subscription
POST
https://gateway-relay.herokuapp.com/api/stripe/upsertSubscription
Path Parameters
Authorization*
jwt token
received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.
Request Body
subscriptionCost*
integer
parameter that describes the monthly subscription amount. should be the dollar value multiplied by 100.
example: a subscriptionCost of $25.50 would be represented as 2550
currency
string
optional parameter describing the currency of the subscription. the default is usd.
cancelAtEndOfBillingPeriod
boolean
optional parameter describing whether this subscription should be canceled after one billing period. the default is false.
{
subscriptionId: 'sub_1LVjtfBcTnTxBQNZpkuSZvqL',
subscriptionFor: 'cus_MD1vEjQloWXPQy',
subscriptionAmount: '$25.50'
}
Cancel existing subscription
DELETE
https://gateway-relay.herokuapp.com/api/stripe/cancelSubscription
Headers
Authorization*
jwt token
received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.
Request Body
cancelImmediately*
boolean
parameter that describes whether or not to cancel the subscription immedietly, or at the end of the current billing cycle.
{
success: true,
customerIdCancelledFor: 'cus_MD1vEjQloWXPQy',
cancelledInstantly: true
}
Last updated