Route and pay using the delegation from your commerce grant (mode B, OAuth)
The OAuth counterpart of POST /api/v1/router/route, for a credential minted from a commerce authorization. Identical behaviour and identical response — with one difference: you do not choose the delegation. It is derived from your grant: the capped, expiring mandate the user approved when they connected you. Sending a delegationId is refused, not ignored.
The cap, its expiry, and the user revoking the grant are the boundary on what you can spend. The routing fee is drawn from that same cap, in addition to each merchant’s price.
A plain (non-OAuth) API key cannot use this route — it has no grant to derive from. Use POST /api/v1/router/route and name your own delegationId instead.
Request
- Base URL: https://api.sandbox.nevermined.app/api/v1
- URL: https://api.sandbox.nevermined.app/api/v1/router/commerce/route
- Auth: HTTP bearer
Request body
Example request
{
"url": "https://agent.example/api/resource",
"slug": "webscrape-pro",
"path": "scrape",
"requestId": "order-1234"
}Response
Upstream response, relayed.
Example response
{
"status": 200,
"body": {
"ok": true,
"data": "the paid resource"
},
"paid": true,
"payment": {
"resultUrl": "/api/v1/router/payments/b1f9c2e4-3d5a-4c7e-9f21-6a8b0c4d2e13/result",
"paymentId": "b1f9c2e4-3d5a-4c7e-9f21-6a8b0c4d2e13",
"settlement": {
"recipient": "0x209693Bc6afc0C5328bA36FaF03C514EF312287C",
"amount": "1000",
"asset": "USDC",
"network": "base-sepolia",
"approxCents": "1",
"scheme": "exact"
},
"fee": {
"amount": "0",
"cents": "0",
"capChargedCents": "1",
"capChargedMicros": "2040"
},
"status": "Settled"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.