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.

512 B
Raw Blame
import { createAdminClient } from '@spree/admin-sdk'

const client = createAdminClient({
  baseUrl: 'https://your-store.com',
  secretKey: 'sk_xxx',
})

// region:example
// Drafts only. Sending `items` replaces every line on the order.
const purchaseOrder = await client.purchaseOrders.update('po_1234567890', {
  expected_at: '2026-10-15',
  reference: 'ACME-88412',
  items: [{ variant_id: 'variant_1234567890', quantity_ordered: 120, unit_cost: '12.50' }],
})

// endregion:example

export { purchaseOrder }