Allows you to manually change a checkout session’s status without processing an actual transaction. This endpoint is designed for testing integrations, webhook flows, and frontend UI states in development and staging environments.
This endpoint is not available in production and will return a 403 Forbidden error if called in a production environment.
Use Cases
- Test webhook delivery and handling for different payment statuses
- Debug frontend UI behavior for various transaction states
- Validate integration logic without processing real payments
- Simulate edge cases like underpaid/overpaid scenarios
Path parameters
The checkout session ID (e.g., cs_01ARZ3NDEKTSV4RRFFQ69G5FAV).
Request Body
The status to set for the session. Must be one of: - pending - Transaction
detected on-chain but not yet confirmed - awaiting_payment - Waiting for
customer to send funds - confirming - Payment detected, waiting for
confirmations - completed - Payment confirmed and settled successfully -
underpaid - Payment received but below expected amount - overpaid -
Payment received but exceeds expected amount - expired - Session expired
before payment completed - failed - Payment failed or was rejected -
cancelled - Transaction was cancelled
Response
The session identifier that was updated.
The new status that was set.
When you simulate a status change, any configured webhooks will be triggered
as if the status changed naturally. Use this to test your webhook handling
logic.
curl -X POST https://dev.maash.io/checkout/sessions/cs_01ARZ3NDEKTSV4RRFFQ69G5FAV/simulate \
-H "Content-Type: application/json" \
-d '{
"status": "completed"
}'
{
"data": {
"session_id": "cs_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"status": "completed"
}
}
Testing Workflow
- Create a checkout session using the Create Checkout Session endpoint
- Use this simulate endpoint to change the session status
- Verify your webhook endpoint receives the status update
- Check your application logic handles each status correctly
- Test edge cases like
underpaid and overpaid scenarios
Status Transitions
You can set any status directly, but in a real payment flow, sessions typically transition through these states:
awaiting_payment → Initial state after payment method selected
confirming → Payment detected on blockchain
completed → Payment confirmed and settled
Use this endpoint to jump to any state for testing purposes.