Sign in
.md

Validate your payload

Before going live, send the JSON your system produces to POST /api/validate and get back, field by field, what matches this documentation and what does not.

No authentication is required, nothing is stored and no transaction is created — the comparison runs against the same file that generates the page you are reading.

Request

POST https://developers.guper.co/api/validate
Content-Type: application/json
Field Required Description
path yes¹ The route you call, such as /api/loyalty/rewardByOrder.
method no Defaults to POST.
endpoint yes¹ Alternative to path: the page path, such as loyalty/checkout/reward-by-order.
body yes The body your integration sends.

¹ Send either path or endpoint.

{
    "path": "/api/loyalty/rewardByOrder",
    "body": {
        "interface": "generic",
        "storeId": "1",
        "client": { "name": "Tintin", "Entity": "Legal" },
        "items": [ { "id": "1", "name": "Bag", "quantity": "1", "price": 9900 } ]
    }
}

Response

{
    "ok": false,
    "endpoint": "loyalty/checkout/reward-by-order",
    "title": "Reward by Order",
    "summary": { "unknown": 1, "missing": 0, "type": 1, "value": 0 },
    "findings": [
        {
            "path": "client.Entity",
            "kind": "unknown",
            "message": "Campo nao existe neste endpoint.",
            "didYouMean": "entityType"
        },
        {
            "path": "items[0].quantity",
            "kind": "type",
            "message": "Esperado integer, veio string.",
            "expected": ["integer"],
            "got": "string"
        }
    ]
}

ok is true when there are no findings. Each finding carries a kind:

kind Meaning
unknown The field does not exist on this endpoint. When the name is close to one of ours, didYouMean carries the right one.
missing A required field was not sent.
type The type does not match — for example "1" where an integer is expected.
value The value is outside the accepted list. Wrong casing ("Legal" instead of legal) is called out explicitly.

The response also carries fields, the inventory of every documented field for that endpoint and whether your payload sent it — useful to find out what you could be sending and are not.

What it does not check

This checks shape, against the documentation. It knows nothing about your organization, so it will not tell you whether that storeId exists, whether the interface is registered, or whether an amount in cents is on the right scale. A payload approved here can still be rejected by the API for those reasons.

Why this exists

Object keys are case sensitive. A field with the wrong name is not read — and, by design, an unknown field is ignored silently, with no error. One integration sent client.Entity for two months believing it was reporting the customer's entity type: the field is called entityType, nothing was being read and no error ever surfaced. One test here, on day one, would have shown both problems.