/api/qmail/db/payments/get

GET

Read the recipient-payment locker code and claim status attached to a received email. Use this before calling /api/qmail/raida/payments/claim.

Description

Some emails carry an attached payment — the sender stores coins in a RAIDA locker, and the email body contains the locker code only the recipient can claim. This endpoint reports whether the email has such a payment, the locker code, and whether it has been claimed yet.

Parameters

ParamTypeRequiredDescription
email_id32-char hex GUIDYesThe email's GUID (from db/messages/list).

Response

Email has a payment

{
  "command": "payments-get",
  "success": true,
  "email_id": "0c4f8e2a91b34d57a76e1d2c3b4a5968",
  "has_payment": true,
  "locker_code": "AB12CD34EF56GH78",
  "locker_code_hex": "4142313243443334454635364748373800000000000000000000000000000000",
  "payment_status": 0,
  "payment_status_text": "unclaimed",
  "can_retry": true
}

Email has no payment

{
  "command": "payments-get",
  "success": true,
  "email_id": "0c4f8e2a91b34d57a76e1d2c3b4a5968",
  "has_payment": false,
  "message": "No recipient payment attached to this email"
}
FieldDescription
locker_codeASCII printable form of the locker key.
locker_code_hex32-byte locker key as 64 hex chars.
payment_status0 = unclaimed, 1 = claimed, 2 = failed.
payment_status_textString label for payment_status.
can_retryTrue when status is not 1 (claimed). Use this to decide whether to call payments/claim.

Errors

HTTPMessage
400Missing 'email_id' parameter
400Invalid email_id format (expected 32 hex chars)
404Email not found
500Database error

Example

curl "http://localhost:8081/api/qmail/db/payments/get?email_id=0c4f8e2a91b34d57a76e1d2c3b4a5968"

Related