TheWavlyDocs
DocsAPI reference

Checks

A check compares one purchase with a mandate, just before the agent pays, and answers proceed, ask or stop with a signed receipt. On proceed the amount is held against the budget for 30 minutes. See Checks and decisions.

Check a purchase just before paying

POST/v1/checksSecret key · scope checks:write

Parameters

NameInDescription
Idempotency-KeyheaderRepeat a write safely: the same key and body return the first answer.

Request body

FieldTypeDescription
mandate requiredstringMandate id or token
purchase requiredobject
agentstring
agent_signaturestringCompact JWS from the agent's key; see /spec section 4
metadataobject

Returns

FieldTypeDescription
object"check"
idstring
decision"proceed" | "ask" | "stop"
status"held" | "awaiting_approval" | "stopped" | "declined" | "paid" | "released" | "expired"
purchaseobject
resultsarray of object
receiptstring
verify_urlstringPublic page that verifies the receipt in the browser. Share it with the user or merchant.
ap2_receiptstring
approvalobject or null
payment_tokenobject
agentstring or null
agent_verificationobject
hold_expires_atinteger or null
payment_referencestring or null
paymentobject or nullWho says money moved
payment.confirmation"agent_reported" | "provider_redeemed" | "debit_reconciled" | "charge_failed" | "failed" | "cancelled"
payment.debited_amount_paiseinteger or null
payment.independently_confirmedfalse

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl -X POST https://thewavly.com/v1/checks \
  -H "Authorization: Bearer $WAVLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "mandate": "mdt_8sQf2kLm9xVt",
  "purchase": {
    "item": "Groceries",
    "amount_paise": 184500,
    "currency": "INR",
    "merchant": "FreshCart",
    "payee": "freshcart@okhdfc",
    "reference": "FC-1001"
  },
  "agent": "grocer-assistant"
}'
Response
{
  "id": "chk_P1iENx01EDRJ",
  "status": "paid",
  "payment_token": "eyJhbGciOiJFZERTQSIsImtpZCI6Ik…",
  "agent": "grocer-assistant",
  "payment_reference": "UPI-RRN-430011"
}

List checks

GET/v1/checksSecret key · scope checks:read

Parameters

NameInDescription
limitquery
starting_afterqueryAn id from the previous page
mandatequery
agentquery
decisionqueryone of proceed, ask, stop

Returns

FieldTypeDescription
object required"list"
data requiredarray of object
has_more requiredboolean

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl https://thewavly.com/v1/checks \
  -H "Authorization: Bearer $WAVLY_API_KEY"
Response
{
  "object": "list",
  "data": [
    {
      "object": "check",
      "id": "chk_P1iENx01EDRJ",
      "decision": "proceed"
    }
  ],
  "has_more": true
}

Retrieve a check

GET/v1/checks/{id}Secret key · scope checks:read

Parameters

NameInDescription
id requiredpathCheck idpattern ^chk_[\w-]{6,40}$

Returns

FieldTypeDescription
object"check"
idstring
decision"proceed" | "ask" | "stop"
status"held" | "awaiting_approval" | "stopped" | "declined" | "paid" | "released" | "expired"
purchaseobject
resultsarray of object
receiptstring
verify_urlstringPublic page that verifies the receipt in the browser. Share it with the user or merchant.
ap2_receiptstring
approvalobject or null
payment_tokenobject
agentstring or null
agent_verificationobject
hold_expires_atinteger or null
payment_referencestring or null
paymentobject or nullWho says money moved
payment.confirmation"agent_reported" | "provider_redeemed" | "debit_reconciled" | "charge_failed" | "failed" | "cancelled"
payment.debited_amount_paiseinteger or null
payment.independently_confirmedfalse

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl https://thewavly.com/v1/checks/chk_P1iENx01EDRJ \
  -H "Authorization: Bearer $WAVLY_API_KEY"
Response
{
  "id": "chk_P1iENx01EDRJ",
  "status": "paid",
  "payment_token": "eyJhbGciOiJFZERTQSIsImtpZCI6Ik…",
  "agent": "grocer-assistant",
  "payment_reference": "UPI-RRN-430011"
}

Report what happened to the money

POST/v1/checks/{id}/outcomeSecret key · scope checks:write

Parameters

NameInDescription
id requiredpathCheck idpattern ^chk_[\w-]{6,40}$
Idempotency-KeyheaderRepeat a write safely: the same key and body return the first answer.

Request body

FieldTypeDescription
status required"paid" | "failed" | "cancelled"
payment_referencestringup to 120 characters

Returns

FieldTypeDescription
object"check"
idstring
decision"proceed" | "ask" | "stop"
status"held" | "awaiting_approval" | "stopped" | "declined" | "paid" | "released" | "expired"
purchaseobject
resultsarray of object
receiptstring
verify_urlstringPublic page that verifies the receipt in the browser. Share it with the user or merchant.
ap2_receiptstring
approvalobject or null
payment_tokenobject
agentstring or null
agent_verificationobject
hold_expires_atinteger or null
payment_referencestring or null
paymentobject or nullWho says money moved
payment.confirmation"agent_reported" | "provider_redeemed" | "debit_reconciled" | "charge_failed" | "failed" | "cancelled"
payment.debited_amount_paiseinteger or null
payment.independently_confirmedfalse

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl -X POST https://thewavly.com/v1/checks/chk_P1iENx01EDRJ/outcome \
  -H "Authorization: Bearer $WAVLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "paid",
  "payment_reference": "UPI-RRN-430011"
}'
Response
{
  "id": "chk_P1iENx01EDRJ",
  "status": "paid",
  "payment_token": "eyJhbGciOiJFZERTQSIsImtpZCI6Ik…",
  "agent": "grocer-assistant",
  "payment_reference": "UPI-RRN-430011"
}

Download the signed evidence pack

GET/v1/checks/{id}/evidenceSecret key · scope checks:read

Parameters

NameInDescription
id requiredpathCheck idpattern ^chk_[\w-]{6,40}$

Returns

See /spec section 5

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl https://thewavly.com/v1/checks/chk_P1iENx01EDRJ/evidence \
  -H "Authorization: Bearer $WAVLY_API_KEY"
Response
{}

Report what happened to the order

POST/v1/checks/{id}/fulfilmentSecret key · scope checks:write

Parameters

NameInDescription
id requiredpathCheck idpattern ^chk_[\w-]{6,40}$
Idempotency-KeyheaderRepeat a write safely: the same key and body return the first answer.

Request body

FieldTypeDescription
status required"delivered" | "partially_delivered" | "not_delivered" | "returned" | "refunded" | "cancelled"
itemsarray of object
amount_paiseintegerRequired for refunded: the amount refunded, at most the amount paidmin 1
occurred_atintegerUnix seconds; defaults to now
carrierstringup to 80 characters
tracking_referencestringup to 120 characters
notestringup to 1000 characters
party"merchant" | "payment_participant" | "agent_operator" | "organisation"

Returns

FieldTypeDescription
object"fulfilment"
idstring
checkstring
livemodeboolean
party"merchant" | "payment_participant" | "agent_operator" | "organisation"
via"payment_token" | "api"
statusstring
itemsarray or null
amount_paiseinteger or null
carrierstring or null
tracking_referencestring or null
occurred_atinteger
notestring or null
tokenstringSigned record (typ fulfilment), chained to the previous report for the check. See /spec section 2.4.
erasedboolean
created_atinteger

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl -X POST https://thewavly.com/v1/checks/chk_P1iENx01EDRJ/fulfilment \
  -H "Authorization: Bearer $WAVLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "paid",
  "items": [
    "Groceries"
  ],
  "amount_paise": 184500,
  "note": "The merchant substituted an item without consent.",
  "party": "customer"
}'
Response
{
  "id": "chk_P1iENx01EDRJ",
  "check": "chk_P1iENx01EDRJ",
  "party": "customer",
  "status": "paid",
  "items": [
    "Groceries"
  ],
  "amount_paise": 184500,
  "note": "The merchant substituted an item without consent.",
  "token": "eyJhbGciOiJFZERTQSIsImtpZCI6Ik…"
}

List the fulfilment reports for a check, oldest first

GET/v1/checks/{id}/fulfilmentSecret key · scope checks:read

Parameters

NameInDescription
id requiredpathCheck idpattern ^chk_[\w-]{6,40}$

Returns

FieldTypeDescription
object required"list"
data requiredarray of object
has_more requiredboolean

Errors

Errors return {"error": {"code", "message", "field", "request_id"}} with a 4xx or 5xx status. See Errors.

curl https://thewavly.com/v1/checks/chk_P1iENx01EDRJ/fulfilment \
  -H "Authorization: Bearer $WAVLY_API_KEY"
Response
{
  "object": "list",
  "data": [
    {
      "object": "fulfilment",
      "id": "chk_P1iENx01EDRJ",
      "check": "chk_P1iENx01EDRJ"
    }
  ],
  "has_more": true
}