Evaluate a proposed payment against the tenant's effective SimplePay payment policy
curl --request POST \
--url https://api.simplepay.mx/v1/payment-policy/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount_minor": 2,
"currency": "mxn",
"payment_method_types": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_minor: 2, currency: 'mxn', payment_method_types: ['<string>']})
};
fetch('https://api.simplepay.mx/v1/payment-policy/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.simplepay.mx/v1/payment-policy/evaluate"
payload = {
"amount_minor": 2,
"currency": "mxn",
"payment_method_types": ["<string>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"version": "simplepay_payment_policy_preflight.v1",
"allowed": true,
"code": "<string>",
"pricing": {
"base_amount_minor": 123,
"gross_amount_minor": 123,
"payer_financing_fee_minor": 123,
"merchant_financing_markup_minor": 123,
"monthly_payment_minor": 123,
"selected_months": 123,
"quote_id": "<string>",
"quote_hash": "<string>",
"quote_expires_at": "2023-11-07T05:31:56Z",
"disclosure_snapshot": {}
},
"evaluated_methods": [
{}
],
"installment_quote": {
"quote_id": "<string>",
"hash": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"snapshot": {},
"options": [
{
"months": 123,
"customer_total_minor": 123,
"monthly_payment_minor": 123,
"payer_financing_fee_minor": 123,
"merchant_net_minor": 123,
"simplepay_fee_minor": 123,
"merchant_markup_minor": 123,
"platform_margin_minor": 123,
"display_label": "<string>",
"disclosure_text": "<string>"
}
]
}
}Evaluate a proposed payment against the tenant's effective SimplePay payment policy
Referencia detallada para POST /v1/payment-policy/evaluate.
POST
https://api.simplepay.mx
/
v1
/
payment-policy
/
evaluate
Evaluate a proposed payment against the tenant's effective SimplePay payment policy
curl --request POST \
--url https://api.simplepay.mx/v1/payment-policy/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount_minor": 2,
"currency": "mxn",
"payment_method_types": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_minor: 2, currency: 'mxn', payment_method_types: ['<string>']})
};
fetch('https://api.simplepay.mx/v1/payment-policy/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.simplepay.mx/v1/payment-policy/evaluate"
payload = {
"amount_minor": 2,
"currency": "mxn",
"payment_method_types": ["<string>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"version": "simplepay_payment_policy_preflight.v1",
"allowed": true,
"code": "<string>",
"pricing": {
"base_amount_minor": 123,
"gross_amount_minor": 123,
"payer_financing_fee_minor": 123,
"merchant_financing_markup_minor": 123,
"monthly_payment_minor": 123,
"selected_months": 123,
"quote_id": "<string>",
"quote_hash": "<string>",
"quote_expires_at": "2023-11-07T05:31:56Z",
"disclosure_snapshot": {}
},
"evaluated_methods": [
{}
],
"installment_quote": {
"quote_id": "<string>",
"hash": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"snapshot": {},
"options": [
{
"months": 123,
"customer_total_minor": 123,
"monthly_payment_minor": 123,
"payer_financing_fee_minor": 123,
"merchant_net_minor": 123,
"simplepay_fee_minor": 123,
"merchant_markup_minor": 123,
"platform_margin_minor": 123,
"display_label": "<string>",
"disclosure_text": "<string>"
}
]
}
}Uso
Usalo para inspeccionar o evaluar reglas efectivas antes de crear cobros, reservas o flujos con monto variable.Antes de llamar
| Tema | Detalle |
|---|---|
| Metodo | POST |
| Ruta | /v1/payment-policy/evaluate |
| Auth | Bearer API key del ambiente correcto. |
| Scope | policies:read |
| Idempotencia | Recomendada para cualquier retry. Usa una key deterministica por operacion de negocio. |
| Guia relacionada | API Reference overview |
Patron recomendado
- Ejecuta este endpoint desde backend o job seguro, nunca desde frontend con API keys.
- Manda
Idempotency-Keycuando el endpoint cree, convierta, reprograme, cancele, capture o reembolse estado. - Persiste IDs SimplePay (
spcs_...,sppi_...,splink_..., refund IDs o booking IDs) para reconciliacion. - Consulta el bloque OpenAPI de esta pagina para el shape exacto de parametros, body y respuestas.
Ejemplo minimo
terminal
curl -sS -X POST "https://api.simplepay.mx/v1/payment-policy/evaluate" \
-H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: evaluate-payment-policy_v1" \
-d '{ ... }'
Errores a manejar
400indica payload, parametros o estado invalido.401o403indican API key, ambiente o scopes incorrectos.409suele indicar conflicto de estado, duplicado o idempotencia incompatible.429y5xxse pueden reintentar con backoff; en writes conserva la misma idempotency key.
Contrato OpenAPI
El playground, parametros, body y respuestas de abajo salen de/openapi.json. Si el contrato cambia, actualiza la spec y regenera esta pagina.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
8 - 255Body
application/json
Required range:
x >= 1Available options:
mxn Minimum array length:
1Available options:
hosted_checkout, payment_link Available options:
hosted_checkout, payment_link, bookable_payments Optional card installments capability request. This is a payment capability, not a SimplePay product.
Hide child attributes
Hide child attributes
Available options:
3, 6, 9, 12, 18 Available options:
3, 6, 9, 12, 18 Available options:
merchant_absorbed, payer_transparent, blended_price, pass_through_plus_margin Required range:
0 <= x <= 10000Pattern:
^[a-f0-9]{64}$Response
200 - application/json
Sanitized policy preflight result
Available options:
simplepay_payment_policy_preflight.v1 Hide child attributes
Hide child attributes
Available options:
merchant_absorbed, payer_transparent, blended_price, pass_through_plus_margin Pattern:
^spq_[a-f0-9]{32}$Pattern:
^[a-f0-9]{64}$Policy-controlled card installments quote matrix. Use quote_hash on payment creation to detect stale pricing or policy changes.
Hide child attributes
Hide child attributes
Pattern:
^spq_[a-f0-9]{32}$Pattern:
^[a-f0-9]{64}$Hide child attributes
Hide child attributes
Last modified on June 21, 2026
⌘I