Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

550 B
Raw Blame
import { createClient } from '@spree/sdk'

const client = createClient({
  baseUrl: 'https://your-store.com',
  publishableKey: '<api-key>',
})

// region:example
const cart = await client.carts.update(
  'cart_abc123',
  {
    email: '[email protected]',
    shipping_address: {
      first_name: 'John',
      last_name: 'Doe',
      address1: '123 Main St',
      city: 'New York',
      postal_code: '10001',
      country_code: 'US',
      state_abbr: 'NY',
    },
  },
  {
    token: '<token>',
  },
)

// endregion:example

export { cart }