Deletes a template
Soft-deletes a payin template: marks it as deleted so it stops accepting payins and
frees its external_id for reuse. Scoped to the requesting client.
A template can be deleted only when it holds no money — no successful payins
(paid_amount = 0) and none in flight (pending_amount = 0) — and is in a deletable
state: not created, discarded or failed, and not being pruned (prune_state is
null). The deletion is serialized with payin processing through the template lock.
Authorization
authorization AuthorizationBearer <token>
In: header
Path Parameters
idstring
Template ID
Match
^[A-Za-z]{2,7}_[\w-]{22}$Example
"cpitpl_5tgliBmzjZ6mpQPRbQjfKj"Response Body
application/json
application/json
application/json
application/json
curl -X DELETE "https://api.sandbox.cuentamono.com/v1/core/payins/templates/cpitpl_5tgliBmzjZ6mpQPRbQjfKj"Empty
{
"code": "401 Unauthorized",
"errors": [
{
"error_code": "expired_token",
"message": "The token is expired, inactive, or doesn't exist.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Authorization header is missing or invalid."
}{
"code": "403 Forbidden",
"errors": [
{
"error_code": "not_authorized",
"message": "Not authorized to have access to this resource.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Not authorized to have access to this resource"
}{
"code": "404 Not Found",
"errors": [
{
"error_code": "item_not_found",
"message": "The item doesn't exist",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Resource not defined"
}{
"code": "409 Conflict",
"errors": [
{
"error_code": "template_has_payments",
"message": "The template cannot be deleted because it has received or has in-flight payments.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Conflict"
}