For all billing endpoints that involve charging or updating credit cards, a special Stripe credit card token is required.
STEP 1: Get Stripe Publishable Key
Prerequisite
- Set up Stripe publishable key in Advanced Config as SA
Summary
- Endpoint: /api/v2/billing_stripe_publishable_key
- Method: GET
- Required User Type: TA
Response
A successful response will return a dictionary.
- key- The Stripe publishable key
Example
Request
/api/v2/billing_stripe_publishable_key
Response Data
{"key": "xxxxxxxxxxxxxxxxxxxx"}
STEP 2: Set Stripe Publishable Key
Use Stripe.setPublishableKey(<key>) with the key retrieved in step 1.
STEP 3: Create token
Use Stripe.card.createToken(<card obj>) to get Stripe token from credit card information.