Skip to main content
POST
/
api
/
v3
/
store
/
orders
/
{order_id}
/
payment_sessions
Spree SDK
import { createSpreeClient } from '@spree/sdk'

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

const session = await client.store.orders.paymentSessions.create('or_abc123', {
  payment_method_id: 'pm_abc123',
}, {
  bearerToken: '<token>',
})
{
  "id": "ps_gbHJdmfrXB",
  "status": "pending",
  "currency": "USD",
  "external_id": "bogus_dd476c22401194ad1610c0ee",
  "external_data": {
    "client_secret": "bogus_secret_343b3bc480f678de"
  },
  "customer_external_id": null,
  "expires_at": null,
  "created_at": "2026-03-05T20:52:26.080Z",
  "updated_at": "2026-03-05T20:52:26.080Z",
  "amount": "110.0",
  "payment_method_id": "pm_UkLWZg9DAJ",
  "order_id": "or_UkLWZg9DAJ",
  "payment_method": {
    "id": "pm_UkLWZg9DAJ",
    "name": "Credit Card",
    "description": null,
    "type": "Spree::Gateway::Bogus",
    "session_required": true
  }
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Authorization
string
header
required

JWT token for authenticated customers

Headers

x-spree-api-key
string
required
Authorization
string

Bearer token for authenticated customers

x-spree-order-token
string

Order token for guest access

Idempotency-Key
string

Unique key for request idempotency. Duplicate requests with the same key return the cached response.

Path Parameters

order_id
string
required

Order ID or number

Body

application/json
payment_method_id
string
required

Payment method ID

Example:

"pm_abc123"

amount
string

Payment amount (defaults to order total minus store credits)

Example:

"99.99"

external_data
object

Provider-specific data passed to the gateway

Response

payment session created

id
string
required
status
string
required
currency
string
required
external_id
string
required
external_data
object
required
customer_external_id
string | null
required
expires_at
string | null
required
created_at
string
required
updated_at
string
required
amount
string
required
payment_method_id
string
required
order_id
string
required
payment_method
object
required
payment
object