Updates a template
Updates specific fields of a payin template. Scoped to the requesting client.
The update is presence-aware: an omitted field keeps its current value and an
explicit null clears a nullable field. payin_data, form_customization and
method_params are partial objects merged field by field; expected_payers
replaces the whole list.
Expected payers can only be set on a template one of whose methods validates
them: on a template that only offers co_pse the request fails with
payin_expected_payers_not_supported.
method_params only takes co_pse, whose payer is the suggested payer the
hosted checkout pre-fills: a complete payer replaces it, null removes it and an
omitted payer keeps it. On a template that does not offer co_pse the request
fails with payin_unsupported_method_params.
A template cannot be updated while still created (its Bre-B setup may be in
flight), in discarded or failed state, as a consumed (paid) single-use
template, or while being pruned (prune_state not null). The update is
serialized with payin processing through the template lock.
Updating total_minimum_amount/total_maximum_amount may transition the
template state (ready ⇄ minimum_paid, → paid, or back out of paid).
The transition is included in the payin_template_updated webhook — which every
successful update emits, with the previous values of the changed fields — and
does NOT trigger the separate state-change webhooks.
In: header
Path Parameters
Template ID
^[A-Za-z]{2,7}_[\w-]{22}$"cpitpl_5tgliBmzjZ6mpQPRbQjfKj"Request Body
application/json
Attributes to update the template
TypeScript Definitions
Use the request body type in TypeScript.
If set, only these payers are allowed to pay the template through Bre-B
(co_breb); a PSE (co_pse) payment is never restricted by them. The provided
list replaces the current one as a whole; null clears the restriction.
Expiration date for the template as ISO-8601 datetime. Must be in the future; null removes the expiration.
date-time"2022-01-01T01:00:00Z"Customization applied to the payment form. Partial: only the provided fields are updated; null clears the whole customization, brand included.
Maximum amount allowed in a single Payin.
Arbitrary tenant-defined metadata.
{
"id": 3,
"reference": 123
}Per-method configuration. Only co_pse can change after creation: a complete
payer replaces the suggested payer, null removes it and an omitted payer
keeps it. The template must offer co_pse.
Minimum amount allowed in a single Payin.
Human-readable name to identify the template.
5 <= length <= 255"string"Configuration applied to every payin of the template. Partial: only the provided fields are updated.
Free-format reference shown to the payer.
1 <= length <= 255"string"Maximum cumulative amount the template is allowed to collect. Cannot be less than the current paid_amount.
Minimum cumulative amount the template must collect.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://api.cert.monoban.co/v1/core/payins/templates/cpitpl_5tgliBmzjZ6mpQPRbQjfKj" \ -H "Content-Type: application/json" \ -d '{}'{
"reference": "Invoice #0042",
"maximum_payin_amount": {
"amount": 100000000,
"currency": "COP"
},
"prune_reason": null,
"inserted_at": "2022-01-01T01:00:00Z",
"payin_data": {
"fee_override": [
{
"fixed": {
"amount": 100000000,
"currency": "COP"
},
"percentage": "0.05",
"tx_description": "Collection service fee",
"type": "payin"
}
],
"metadata": {
"id": 3,
"reference": 123
},
"redirect_url": "https://merchant.example.com/checkout/return",
"subaccount_disbursement_trigger": "on_approval"
},
"type": "collection",
"minimum_payin_amount": {
"amount": 100000000,
"currency": "COP"
},
"total_maximum_amount": {
"amount": 100000000,
"currency": "COP"
},
"payment_tokens": {
"co_breb": {
"key_type": "alphanumeric",
"key_value": "@MN1A2B3C4D5E",
"qr": {
"amount": {
"amount": 100000000,
"currency": "COP"
},
"emvco": "00020101021226440014CO.COM.CRB.RED0122CO.COM.CRB.TRXIDP123456752045411530317054061000005802CO5910Acme Store6006Bogota6304A1B2",
"error_correction_level": "medium",
"expires_at": "2022-01-01T01:00:00Z",
"image": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB...",
"image_width": 512,
"payment_id": "CO.COM.CRB.TRXIDP1234567891234",
"usage_mode": "multiple_use"
},
"qr_error": null
}
},
"state_reason": null,
"total_minimum_amount": {
"amount": 100000000,
"currency": "COP"
},
"expires_at": "2022-01-01T01:00:00Z",
"usage_mode": "single_use",
"checkout_url": "https://www.mono.la/",
"updated_at": "2022-01-01T01:00:00Z",
"id": "cpitpl_5tgliBmzjZ6mpQPRbQjfKj",
"subaccount_id": "lacc_5tgliBmzjZ6mpQPRbQjfKj",
"pruned_at": "2022-01-01T01:00:00Z",
"prune_state": null,
"currency": "COP",
"enabled": false,
"expected_payers": [
{
"document_number": "1023711432",
"document_type": "CC",
"kind": "co_person_document"
}
],
"paid_amount": {
"amount": 100000000,
"currency": "COP"
},
"external_id": "invoice-2026-0042",
"method_params": {
"co_breb": {
"create_qr": false,
"custom_key_value": "MYSTORE01",
"key_per": "template",
"qr_code_data": {
"merchant_category_code": "5411",
"receiver_city": "Bogota",
"receiver_postal_code": "110111"
}
},
"co_pse": {
"payer": {
"address": "Calle 100 # 45-23, Bogotá",
"document_number": "1023711432",
"document_type": "CC",
"email": "lupita.perez@example.com",
"names": "Lupita",
"person_type": "natural",
"phone_number": "+573001234567",
"surnames": "Pérez Gómez"
}
}
},
"nickname": "Monthly rent - Apt 101",
"custom_merchant_name": "Acme Store",
"state": "ready",
"failed_payins": 1,
"successful_payins": 1,
"metadata": {
"id": 3,
"reference": 123
},
"form_customization": {
"brand_id": "cpitplb_5tgliBmzjZ6mpQPRbQjfKj",
"custom_fields": [
{
"default_value": "ORD-1042",
"description": "The one on the invoice, without dashes.",
"editable": true,
"label": "Order number",
"required": false,
"type": "text"
}
]
},
"expires_in": 1,
"available_methods": [
"co_breb"
]
}{
"code": "400 Bad Request",
"errors": [
{
"error_code": "validation_error",
"message": "Generic changeset errors",
"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": "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": "template_not_found",
"message": "The template doesn't exist.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Resource not defined"
}{
"code": "409 Conflict",
"errors": [
{
"error_code": "template_invalid_state",
"message": "The template is in an invalid state for this operation.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Conflict"
}{
"code": "422 Unprocessable Content",
"errors": [
{
"error_code": "invalid_enum",
"message": "The field contains an invalid value.",
"path": "#/path/to/field",
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Validation errors"
}