Skip to main content

Payments

Authenticated API

Payment endpoints require a valid JWT Bearer token. Accessible via the API gateway at /v1/commerce/payments/*.

Create Payment

POST /v1/commerce/payments

Process a payment for an order.

Request

FieldTypeRequiredDescription
order_idstring (UUID)NoOrder to pay for
amountnumberYesPayment amount
currencystringYesISO 4217 currency code (e.g., "USD")
payment_method_idstringYesStripe or Square payment method token
capturebooleanNotrue to charge immediately, false for auth-only (default: true)
idempotency_keystringNoUnique key for safe retries
metadataobjectNoCustom metadata

Example

curl -X POST https://dev.api.olympuscloud.ai/v1/commerce/payments \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"order_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"amount": 26.98,
"currency": "USD",
"payment_method_id": "pm_card_visa",
"capture": true,
"idempotency_key": "pay-abc123"
}'

Response

{
"payment_id": "pay-uuid",
"tenant_id": "550e8400-e29b-41d4-a716-446655449100",
"order_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"amount": 26.98,
"currency": "USD",
"status": "captured",
"processor": "stripe",
"processor_transaction_id": "pi_3abc123...",
"requires_action": false,
"client_secret": null,
"captured_at": "2026-02-19T15:35:00Z",
"refunded_at": null,
"metadata": {},
"created_at": "2026-02-19T15:35:00Z",
"updated_at": "2026-02-19T15:35:00Z"
}

Create Payment Intent

POST /v1/commerce/payments/intent

Create a Stripe PaymentIntent for client-side confirmation (3D Secure, Apple Pay, etc.).

FieldTypeRequiredDescription
amountnumberYesPayment amount
currencystringYesCurrency code
order_idstring (UUID)NoOrder UUID
customer_idstringNoStripe customer ID
payment_method_typesarray of stringsNoe.g., ["card", "apple_pay"]
curl -X POST https://dev.api.olympuscloud.ai/v1/commerce/payments/intent \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"amount": 26.98,
"currency": "USD",
"order_id": "ORDER_ID"
}'

Refund Payment

POST /v1/commerce/payments/:payment_id/refund

FieldTypeRequiredDescription
amountnumberYesRefund amount (can be partial)
reasonstringNo"guest_complaint", "mistake", "fraud"
idempotency_keystringNoUnique key for safe retries
curl -X POST https://dev.api.olympuscloud.ai/v1/commerce/payments/PAYMENT_ID/refund \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"amount": 14.99,
"reason": "guest_complaint"
}'

Adjust Tip

POST /v1/commerce/payments/:payment_id/tip

Adjust the tip on an existing payment (common for post-meal tip adjustments on signed receipts).

FieldTypeRequiredDescription
tip_amount_centsintegerYesTip amount in cents (e.g., 500 = $5.00)
curl -X POST https://dev.api.olympuscloud.ai/v1/commerce/payments/PAYMENT_ID/tip \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"tip_amount_cents": 500}'

Get Payment

GET /v1/commerce/payments/:payment_id

curl https://dev.api.olympuscloud.ai/v1/commerce/payments/PAYMENT_ID \
-H "Authorization: Bearer $TOKEN"

Payment Status Values

StatusDescription
pendingPayment created, not yet processed
processing3D Secure verification in progress
authorizedAuth-only, not yet captured
capturedCharge completed successfully
partially_refundedPartial refund issued
refundedFully refunded
failedPayment failed
cancelledPayment cancelled before capture