Simulates a payment (sandbox)
Simulates a payer transferring to one of your templates or intents, running the provider's real rail: the payin is created, authorized and funded exactly as a production payment would be, and its outcome reaches you over the same webhooks.
Sandbox only. In any other environment the endpoint answers 403.
A payment to a template is unreferenced — the template accepts many, so
the request brings its own method and amount. A payment to an intent is
referenced — the intent was declared for it and already fixes both.
A co_pse payment is always referenced, to an intent awaiting it (its PSE
charge mounted): the simulation does what the sandbox bank page does when
the payer picks an outcome, so from there the payment is approved or
rejected, and its money arrives, as in production. Only whole pesos can be
simulated.
Use error to provoke a failure. Leaving it out simulates a payment that
succeeds, though the payment authorization may still refuse it on its own
validations — an amount outside the template's bounds, a payer it does not
expect. That refusal happens before a payin exists, so the response comes
back with no payin_id and the reason instead. Provoking those rejections
is exactly how you test them.
In: header
Request Body
application/json
Payment to simulate
TypeScript Definitions
Use the request body type in TypeScript.
Amount the payer transfers.
The failure to simulate. Omit it to simulate a payment that succeeds — which can still be refused, since the payment authorization runs its own validations on it either way.
Each method takes the failures its provider can provoke, and any other
fails with payin_simulation_error_not_supported:
co_breb:risk_control,provider_unavailable,breb_timeout,unknown.co_pse:payer_did_not_authorize,payer_did_not_complete,payer_account_inactive,provider_unavailable,pse_rejected,risk_control,authorization_denied, andunknownfor a rejection without a PSE code.
"unknown" | "provider_unavailable" | "risk_control" | "breb_timeout" | "payer_did_not_authorize" | "payer_did_not_complete" | "pse_rejected" | "payer_account_inactive" | "authorization_denied""risk_control"Method to pay with. Must be one the template accepts.
"co_breb" | "co_pse""co_breb"Method-specific simulation data. For co_breb: payment_id.
Who pays. Generated at random when absent. co_pse takes none: the
intent's instrument already says who pays.
Indicates the format for resource's ID
^[A-Za-z]{2,7}_[\w-]{22}$"cpitpl_5tgliBmzjZ6mpQPRbQjfKj"Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.cert.monoban.co/v1/core/payins/sandbox/payments" \ -H "Content-Type: application/json" \ -d '{ "amount": { "amount": 100000000, "currency": "COP" }, "method": "co_breb", "template_id": "cpitpl_5tgliBmzjZ6mpQPRbQjfKj" }'{
"payin_id": null,
"state_reason": "amount_below_minimum"
}{
"payin_id": "cpin_5tgliBmzjZ6mpQPRbQjfKj",
"state_reason": null
}{
"code": "400 Bad Request",
"errors": [
{
"error_code": "method_not_allowed",
"message": "The payin method is not available for this template",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Malformed request"
}{
"code": "401 Unauthorized",
"errors": [
{
"error_code": "missing_authorization_header",
"message": "`Authorization` header is missing.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Authorization header is missing or invalid."
}{
"code": "403 Forbidden",
"errors": [
{
"error_code": "feature_not_enabled",
"message": "This feature is not enabled for this account.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Not authorized to have access to this resource"
}{
"code": "404 Not Found",
"errors": [
{
"error_code": "template_not_found",
"message": "The template doesn't exist.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Resource not defined"
}{
"code": "422 Unprocessable Content",
"errors": [
{
"error_code": "missing_field",
"message": "The field is missing on the request body or parameters.",
"path": "#/path/to/field",
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Validation errors"
}{
"code": "503 Service Unavailable",
"errors": [
{
"error_code": "unavailable",
"message": "The service is unavailable, Please try again later",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Service unavailable"
}