Bag Docs
API ReferenceCheckout

Submit transaction hash

After the customer signs and broadcasts a transaction, submit the on-chain transaction hash to the session. Bag will begin monitoring the transaction for confirmations.

The session must be in payment_session_created, wallet_connecting, or wallet_ready status. Submitting a hash that is already associated with another session returns a 409 Conflict.

POST
/api/checkout/submit

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.justusebag.xyz/api/checkout/submit" \  -H "Content-Type: application/json" \  -d '{    "sessionId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",    "txHash": "0x8f3a2b1c4d5e6f7890abcdef1234567890abcdef1234567890abcdef12345678"  }'
{
  "status": "success",
  "data": {
    "status": "txn_broadcast",
    "txHash": "0x8f3a2b1c4d5e6f7890abcdef1234567890abcdef1234567890abcdef12345678",
    "sessionId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
    "nextAction": "poll_status"
  }
}
{
  "status": "error",
  "message": "amount: Amount must be a positive number up to 999,999,999.99; network: Invalid enum value",
  "code": "BAD_REQUEST"
}
{
  "status": "error",
  "message": "Not found",
  "code": "NOT_FOUND"
}
{
  "status": "error",
  "message": "Transaction already recorded",
  "code": "CONFLICT"
}
{
  "status": "error",
  "message": "Too many requests. Please slow down.",
  "retryAfter": 10
}