Menu
Platform
AI
Analytics
App store purchases
Credits
Database
Flags
Generated Assets
Monitoring
Notifications
Organizations
Payments
- Payments
- Payments quickstart
- Checkout policies
- Checkout sessions
- Customer subscriptions
- Entitlement grants
- Exchange rates
- Licence keys
- Licence tokens
- Merchant accounts
- Portal sessions
- Price catalogs
- Revenue
- Revenue facts
- Revenue sources
- Tax threshold statuses
- Usage events
- Usage invoices
- Usage meter prices
- Usage meters
- Usage reservations
- Usage settings
- Usage tiers
Queues
Realtime
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Refund a checkout session
Refund all or part of a paid one-time checkout.
Refund all or part of a paid one-time checkout.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session:refund - Scope
billing:write - Effect
write— a successful call changes state. - Collection checkout_sessions
#Request
| Field | Type | What it is |
|---|---|---|
name | string | The Money checkout resource to refund. Required. |
amount_minor | int64 | Optional partial amount in minor units; empty refunds the remaining amount. |
reason | string | Optional processor refund reason. |
metadata | map<string, string> | Caller metadata, such as the app's return and order ids. At most 20 keys. |
#Response
| Field | Type | What it is |
|---|---|---|
refund | Refund | The refund receipt, read back from the processor after creation. Output only. |
#Refund
| Field | Type | What it is |
|---|---|---|
id | string | The processor's refund id. Output only. |
checkout_session | string | The Money checkout resource this refund belongs to. Output only. |
payment_intent | string | The processor payment intent the refund applies to. Output only. |
amount_minor | int64 | Amount refunded in minor units. Output only. |
currency_code | string | ISO 4217 currency code. Output only. |
status | string | The processor's refund status. Output only. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_STATE— The Resource is in a state that forbids the call.INVALID_FIELD— A field failed validation.UNAVAILABLE— The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.IDEMPOTENCY_KEY_REUSED— An Idempotency-Key was reused with another body.IDEMPOTENCY_IN_PROGRESS— The first call with this Idempotency-Key is still running.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/checkout_sessions/checkout-session:refund" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'