Stripe

Create customer in stripe based off user UP address

POST https://gateway-relay.herokuapp.com/api/stripe/createCustomer

Headers

Name
Type
Description

Authorization*

jwt token

received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.

Example 200 Response
{
    walletAddress: '0x218C2BbaaBa0D66ddcD5De942Ed2980Bbfd1f004',
    stripeCustomerId: 'cus_MD1vEjQloWXPQy'
}

Get Setup Intent client secret to capture payment method

GET https://gateway-relay.herokuapp.com/api/stripe/getSetupIntent

Headers

Name
Type
Description

Authorization*

jwt token

received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.

Example 200 Response
{
    clientSecret: 'client...secret'
}

Insert or update existing subscription

POST https://gateway-relay.herokuapp.com/api/stripe/upsertSubscription

Path Parameters

Name
Type
Description

Authorization*

jwt token

received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.

Request Body

Name
Type
Description

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.

Example 200 Response
{
    subscriptionId: 'sub_1LVjtfBcTnTxBQNZpkuSZvqL',
    subscriptionFor: 'cus_MD1vEjQloWXPQy',
    subscriptionAmount: '$25.50'
}

Cancel existing subscription

DELETE https://gateway-relay.herokuapp.com/api/stripe/cancelSubscription

Headers

Name
Type
Description

Authorization*

jwt token

received via authenticating with the auth endpoints. To learn more about the authentication flow, click here.

Request Body

Name
Type
Description

cancelImmediately*

boolean

parameter that describes whether or not to cancel the subscription immedietly, or at the end of the current billing cycle.

Example 200 Response
{
    success: true,
    customerIdCancelledFor: 'cus_MD1vEjQloWXPQy',
    cancelledInstantly: true
}

Last updated