Skip to main content
POST
/
checkout
/
sessions
/
{session_id}
/
simulate
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"
  }
}
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

session_id
string
required
The checkout session ID (e.g., cs_01ARZ3NDEKTSV4RRFFQ69G5FAV).

Request Body

status
string
required
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

data
object
session_id
string
The session identifier that was updated.
status
string
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

  1. Create a checkout session using the Create Checkout Session endpoint
  2. Use this simulate endpoint to change the session status
  3. Verify your webhook endpoint receives the status update
  4. Check your application logic handles each status correctly
  5. 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:
  1. awaiting_payment → Initial state after payment method selected
  2. confirming → Payment detected on blockchain
  3. completed → Payment confirmed and settled
Use this endpoint to jump to any state for testing purposes.