Get Stripe Credit Card Token

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

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.