Skip to content

Stripe Config

Retrieve the Stripe publishable key and optional connected account ID needed to initialize Stripe.js on the client.


Get Stripe Config

GET /v1/ecommerce/config/stripe

Authentication: OAuth Token

Scope: transactcore:payment-intents.read

Rate Limit: 100/min per IP

Query Parameters

ParameterTypeRequiredDescription
connected_account_idstringNoConnected account hashkey to resolve the Stripe account ID for Connect mode

Response

json
{
  "publishable_key": "pk_live_xxxxx",
  "stripe_account_id": "acct_xxxxx"
}

Response Fields

FieldTypeDescription
publishable_keystringStripe publishable key for initializing Stripe.js
stripe_account_idstring | undefinedStripe Connect account ID (only present when connected_account_id is provided and valid)

Examples

Basic — get publishable key only:

bash
curl https://api.transactcore.retailsuccessplatform.com/api/v1/ecommerce/config/stripe \
  -H "Authorization: Bearer ${TOKEN}"
json
{
  "publishable_key": "pk_live_xxxxx"
}

Stripe Connect — get publishable key and connected account:

bash
curl "https://api.transactcore.retailsuccessplatform.com/api/v1/ecommerce/config/stripe?connected_account_id=cct_00000k1L2m3N4o5" \
  -H "Authorization: Bearer ${TOKEN}"
json
{
  "publishable_key": "pk_live_xxxxx",
  "stripe_account_id": "acct_1234567890"
}

Client-Side Usage

Use the returned values to initialize Stripe.js:

javascript
import { loadStripe } from '@stripe/stripe-js';

// Fetch config from your backend (which calls TransactCore)
const { publishable_key, stripe_account_id } = await fetchStripeConfig();

// Initialize Stripe
const stripe = await loadStripe(publishable_key);

// Mount Payment Element
const elementsOptions = {
  mode: 'payment',
  amount: orderTotalInCents,
  currency: 'usd',
};

// For Stripe Connect: set on_behalf_of
if (stripe_account_id) {
  elementsOptions.on_behalf_of = stripe_account_id;
}

const elements = stripe.elements(elementsOptions);
const paymentElement = elements.create('payment', { layout: 'tabs' });
paymentElement.mount('#payment-element');

Notes

  • Call this endpoint once when the checkout page loads — cache the result for the session
  • The publishable_key is safe to expose to the browser (it's a Stripe publishable key, not a secret key)
  • If connected_account_id is provided but not found, the response omits stripe_account_id — no error is returned
  • Use stripe_account_id with Stripe Elements on_behalf_of to route payments through a specific Stripe Connect account

Changelog
DateChange
2026-03-19Added connected account lookup endpoint and fixed scope format.
2026-03-19Initial publication.

ShopHero CommerceCore Platform