Skip to main content
PATCH
/
api
/
v3
/
admin
/
orders
/
{order_id}
/
payments
/
{id}
/
void
Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'

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

const payment = await client.orders.payments.void('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
{
  "id": "py_UkLWZg9DAJ",
  "payment_method_id": "pm_UkLWZg9DAJ",
  "response_code": "void-BGS-df4aa5520eb3",
  "number": "PP2A7W5U",
  "amount": "110.0",
  "display_amount": "$110.00",
  "status": "void",
  "source_type": "credit_card",
  "source_id": "card_UkLWZg9DAJ",
  "source": {
    "id": "card_UkLWZg9DAJ",
    "brand": "visa",
    "last4": "1111",
    "month": 12,
    "year": 2027,
    "name": "Spree Commerce",
    "default": false,
    "gateway_payment_profile_id": null,
    "customer_id": null,
    "payment_method_id": "pm_gbHJdmfrXB",
    "metadata": {},
    "created_at": "2026-05-21T18:11:20.228Z",
    "updated_at": "2026-05-21T18:11:20.230Z"
  },
  "metadata": {},
  "avs_response": null,
  "cvv_response_code": null,
  "cvv_response_message": null,
  "created_at": "2026-05-21T18:11:20.229Z",
  "updated_at": "2026-05-21T18:11:20.539Z",
  "captured_amount": "0.0",
  "order_id": "or_UkLWZg9DAJ"
}

Documentation Index

Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Bearer token for admin authentication

Path Parameters

order_id
string
required

Order ID

id
string
required

Payment ID

Response

200 - application/json

payment voided