Skip to main content
POST
/
spend
/
evaluate
Evaluate spend policy
curl --request POST \
  --url https://api.useproxy.ai/v1/spend/evaluate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 123,
  "customerId": "<string>",
  "agentId": "<string>",
  "cardId": "<string>",
  "currency": "<string>",
  "merchant": {
    "mcc": "<string>",
    "name": "<string>"
  }
}
'
{
  "decision": "approve",
  "reasons": [
    {
      "code": "<string>",
      "message": "<string>"
    }
  ],
  "flags": {},
  "context": {
    "customerId": "<string>",
    "agentId": "<string>",
    "cardId": "<string>",
    "amount": 123,
    "currency": "<string>",
    "available": 123,
    "agentLimit": {
      "amount": 123,
      "currency": "<string>",
      "interval": "<string>"
    },
    "cardLimit": {
      "amount": 123,
      "currency": "<string>",
      "interval": "<string>"
    },
    "spendStats": {
      "totalDay": 123,
      "totalMonth": 123,
      "lastSpendAt": 123
    },
    "policy": {
      "requireIntent": true,
      "requireAttestation": true,
      "requireApproval": true,
      "autoApproveBelow": 123,
      "attestationWindowMinutes": 123,
      "cooldownMinutes": 123,
      "ttlMinutes": 123,
      "ttlDays": 123,
      "limits": {
        "perAuth": 123,
        "perDay": 123,
        "perMonth": 123
      },
      "allowedMccs": [
        "<string>"
      ],
      "blockedMccs": [
        "<string>"
      ],
      "allowedMerchants": [
        "<string>"
      ],
      "lockToFirstMerchant": true
    }
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header as Bearer <api_key>.

Body

application/json
amount
number
required

Amount in cents

customerId
string
agentId
string
cardId
string
currency
string
merchant
object

Response

Policy evaluation result

decision
enum<string>
required
Available options:
approve,
decline
reasons
object[]
required
flags
object
context
object