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.
/v1/checksGET/v1/checksGET/v1/checks/{id}POST/v1/checks/{id}/outcomeGET/v1/checks/{id}/evidencePOST/v1/checks/{id}/fulfilmentGET/v1/checks/{id}/fulfilmentCheck a purchase just before paying
POST/v1/checksSecret key · scope checks:write
Parameters
| Name | In | Description |
|---|---|---|
Idempotency-Key | header | Repeat a write safely: the same key and body return the first answer. |
Request body
| Field | Type | Description |
|---|---|---|
mandate required | string | Mandate id or token |
purchase required | object | |
agent | string | |
agent_signature | string | Compact JWS from the agent's key; see /spec section 4 |
metadata | object |
Returns
| Field | Type | Description |
|---|---|---|
object | "check" | |
id | string | |
decision | "proceed" | "ask" | "stop" | |
status | "held" | "awaiting_approval" | "stopped" | "declined" | "paid" | "released" | "expired" | |
purchase | object | |
results | array of object | |
receipt | string | |
verify_url | string | Public page that verifies the receipt in the browser. Share it with the user or merchant. |
ap2_receipt | string | |
approval | object or null | |
payment_token | object | |
agent | string or null | |
agent_verification | object | |
hold_expires_at | integer or null | |
payment_reference | string or null | |
payment | object or null | Who says money moved |
payment.confirmation | "agent_reported" | "provider_redeemed" | "debit_reconciled" | "charge_failed" | "failed" | "cancelled" | |
payment.debited_amount_paise | integer or null | |
payment.independently_confirmed | false |
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"
}'import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("POST", "/v1/checks", {
"mandate": "mdt_8sQf2kLm9xVt",
"purchase": {
"item": "Groceries",
"amount_paise": 184500,
"currency": "INR",
"merchant": "FreshCart",
"payee": "freshcart@okhdfc",
"reference": "FC-1001"
},
"agent": "grocer-assistant"
});from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("POST", "/v1/checks", {
"mandate": "mdt_8sQf2kLm9xVt",
"purchase": {
"item": "Groceries",
"amount_paise": 184500,
"currency": "INR",
"merchant": "FreshCart",
"payee": "freshcart@okhdfc",
"reference": "FC-1001"
},
"agent": "grocer-assistant"
}){
"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
| Name | In | Description |
|---|---|---|
limit | query | |
starting_after | query | An id from the previous page |
mandate | query | |
agent | query | |
decision | query | one of proceed, ask, stop |
Returns
| Field | Type | Description |
|---|---|---|
object required | "list" | |
data required | array of object | |
has_more required | boolean |
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"import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("GET", "/v1/checks");from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("GET", "/v1/checks"){
"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
| Name | In | Description |
|---|---|---|
id required | path | Check idpattern ^chk_[\w-]{6,40}$ |
Returns
| Field | Type | Description |
|---|---|---|
object | "check" | |
id | string | |
decision | "proceed" | "ask" | "stop" | |
status | "held" | "awaiting_approval" | "stopped" | "declined" | "paid" | "released" | "expired" | |
purchase | object | |
results | array of object | |
receipt | string | |
verify_url | string | Public page that verifies the receipt in the browser. Share it with the user or merchant. |
ap2_receipt | string | |
approval | object or null | |
payment_token | object | |
agent | string or null | |
agent_verification | object | |
hold_expires_at | integer or null | |
payment_reference | string or null | |
payment | object or null | Who says money moved |
payment.confirmation | "agent_reported" | "provider_redeemed" | "debit_reconciled" | "charge_failed" | "failed" | "cancelled" | |
payment.debited_amount_paise | integer or null | |
payment.independently_confirmed | false |
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"import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("GET", "/v1/checks/chk_P1iENx01EDRJ");from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("GET", "/v1/checks/chk_P1iENx01EDRJ"){
"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
| Name | In | Description |
|---|---|---|
id required | path | Check idpattern ^chk_[\w-]{6,40}$ |
Idempotency-Key | header | Repeat a write safely: the same key and body return the first answer. |
Request body
| Field | Type | Description |
|---|---|---|
status required | "paid" | "failed" | "cancelled" | |
payment_reference | string | up to 120 characters |
Returns
| Field | Type | Description |
|---|---|---|
object | "check" | |
id | string | |
decision | "proceed" | "ask" | "stop" | |
status | "held" | "awaiting_approval" | "stopped" | "declined" | "paid" | "released" | "expired" | |
purchase | object | |
results | array of object | |
receipt | string | |
verify_url | string | Public page that verifies the receipt in the browser. Share it with the user or merchant. |
ap2_receipt | string | |
approval | object or null | |
payment_token | object | |
agent | string or null | |
agent_verification | object | |
hold_expires_at | integer or null | |
payment_reference | string or null | |
payment | object or null | Who says money moved |
payment.confirmation | "agent_reported" | "provider_redeemed" | "debit_reconciled" | "charge_failed" | "failed" | "cancelled" | |
payment.debited_amount_paise | integer or null | |
payment.independently_confirmed | false |
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"
}'import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("POST", "/v1/checks/chk_P1iENx01EDRJ/outcome", {
"status": "paid",
"payment_reference": "UPI-RRN-430011"
});from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("POST", "/v1/checks/chk_P1iENx01EDRJ/outcome", {
"status": "paid",
"payment_reference": "UPI-RRN-430011"
}){
"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
| Name | In | Description |
|---|---|---|
id required | path | Check 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"import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("GET", "/v1/checks/chk_P1iENx01EDRJ/evidence");from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("GET", "/v1/checks/chk_P1iENx01EDRJ/evidence"){}Report what happened to the order
POST/v1/checks/{id}/fulfilmentSecret key · scope checks:write
Parameters
| Name | In | Description |
|---|---|---|
id required | path | Check idpattern ^chk_[\w-]{6,40}$ |
Idempotency-Key | header | Repeat a write safely: the same key and body return the first answer. |
Request body
| Field | Type | Description |
|---|---|---|
status required | "delivered" | "partially_delivered" | "not_delivered" | "returned" | "refunded" | "cancelled" | |
items | array of object | |
amount_paise | integer | Required for refunded: the amount refunded, at most the amount paidmin 1 |
occurred_at | integer | Unix seconds; defaults to now |
carrier | string | up to 80 characters |
tracking_reference | string | up to 120 characters |
note | string | up to 1000 characters |
party | "merchant" | "payment_participant" | "agent_operator" | "organisation" |
Returns
| Field | Type | Description |
|---|---|---|
object | "fulfilment" | |
id | string | |
check | string | |
livemode | boolean | |
party | "merchant" | "payment_participant" | "agent_operator" | "organisation" | |
via | "payment_token" | "api" | |
status | string | |
items | array or null | |
amount_paise | integer or null | |
carrier | string or null | |
tracking_reference | string or null | |
occurred_at | integer | |
note | string or null | |
token | string | Signed record (typ fulfilment), chained to the previous report for the check. See /spec section 2.4. |
erased | boolean | |
created_at | integer |
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"
}'import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("POST", "/v1/checks/chk_P1iENx01EDRJ/fulfilment", {
"status": "paid",
"items": [
"Groceries"
],
"amount_paise": 184500,
"note": "The merchant substituted an item without consent.",
"party": "customer"
});from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("POST", "/v1/checks/chk_P1iENx01EDRJ/fulfilment", {
"status": "paid",
"items": [
"Groceries"
],
"amount_paise": 184500,
"note": "The merchant substituted an item without consent.",
"party": "customer"
}){
"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
| Name | In | Description |
|---|---|---|
id required | path | Check idpattern ^chk_[\w-]{6,40}$ |
Returns
| Field | Type | Description |
|---|---|---|
object required | "list" | |
data required | array of object | |
has_more required | boolean |
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"import { Wavly } from "@thewavly/sdk";
const wavly = new Wavly(process.env.WAVLY_API_KEY);
const result = await wavly.request("GET", "/v1/checks/chk_P1iENx01EDRJ/fulfilment");from thewavly import Wavly
wavly = Wavly(os.environ["WAVLY_API_KEY"])
result = wavly.request("GET", "/v1/checks/chk_P1iENx01EDRJ/fulfilment"){
"object": "list",
"data": [
{
"object": "fulfilment",
"id": "chk_P1iENx01EDRJ",
"check": "chk_P1iENx01EDRJ"
}
],
"has_more": true
}