Update a collection
Updates specific fields of a collection.
Restrictions:
- Cannot update collections in
discardedorfailedstates or withprune_statusnot null - Only the following fields can be updated:
nicknameenabledexpires_at(must be in the future)minimum_attempt_amount(only for multiple_use)maximum_attempt_amount(only for multiple_use)total_minimum_amount(may trigger state change)total_maximum_amount(must be >= currentpaid_amount, may trigger state change)
State changes for total_minimum_amount:
- If
paid_amount>= newtotal_minimum_amount, state changes tominimum_paid(if currentlyready) - If
paid_amount< newtotal_minimum_amount, state changes toready(if currentlyminimum_paid)
State changes for total_maximum_amount:
- If
readyorminimum_paid, and newtotal_maximum_amount==paid_amount, state changes topaid - If
paidand newtotal_maximum_amountis null, state changes toreadyorminimum_paid(depending on whethertotal_minimum_amountis set and reached) - If
paidand newtotal_maximum_amount>paid_amount, state changes toreadyorminimum_paid(depending on whethertotal_minimum_amountis set and reached)
Webhooks:
- A
collection.updatedwebhook is sent after the update - If a state change occurs due to the update, it is included in the
collection.updatedwebhook but does NOT trigger separate state change webhooks
Authorization
oauth collectionsIn: header
Scope: collections
Path Parameters
The collection ID
^[A-Za-z]{2,7}_[\w-]{22}$"bbcol_5tgliBmzjZ6mpQPRbQjfKj"Request Body
application/json
Collection update data
TypeScript Definitions
Use the request body type in TypeScript.
Whether the collection is enabled to receive payments
New expiration date for the collection. Must be in the future.
date-time"2022-01-01T01:00:00Z"Maximum amount allowed per payment attempt. Only valid for multiple_use collections.
Minimum amount allowed per payment attempt. Only valid for multiple_use collections.
Description used by client to identify by purpose, product or service
length <= 255"Updated subscription name"Maximum total amount the collection can receive. Cannot be less than the current paid_amount.
Minimum total amount required for the collection to be considered fulfilled. Updating this may cause a state change if paid_amount crosses the new threshold.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://breb-participant.sandbox.mono.la/api/v1/collections/bbcol_5tgliBmzjZ6mpQPRbQjfKj" \ -H "Content-Type: application/json" \ -d '{}'{
"custom_key_value": "INV12345",
"custom_merchant_name": "Acme Corp",
"enabled": true,
"expected_payers": [
{
"document_number": "1234567890",
"document_type": "CC"
}
],
"expires_at": "2022-01-01T01:00:00Z",
"expires_in": 1,
"external_id": "invoice-12345",
"failed_attempts": 0,
"id": "bbcol_5tgliBmzjZ6mpQPRbQjfKj",
"inserted_at": "2022-01-01T01:00:00Z",
"key_pruned_at": "2022-01-01T01:00:00Z",
"keys": [
{
"name": "Acme Corp - INV12345",
"state": "active",
"type": "alphanumeric",
"value": "@MONO1A2B3C4D5E"
}
],
"maximum_attempt_amount": {
"amount": 100000000,
"currency": "COP"
},
"metadata": {
"id": 3,
"reference": 123
},
"minimum_attempt_amount": {
"amount": 100000000,
"currency": "COP"
},
"nickname": "Monthly subscription",
"paid_amount": {
"amount": 100000000,
"currency": "COP"
},
"prune_status": null,
"reference": "Payment for November 2025",
"state": "created",
"state_reason": null,
"successful_attempts": 0,
"tenant_account_id": "bbtacc_5tgliBmzjZ6mpQPRbQjfKj",
"total_maximum_amount": {
"amount": 100000000,
"currency": "COP"
},
"total_minimum_amount": {
"amount": 100000000,
"currency": "COP"
},
"updated_at": "2022-01-01T01:00:00Z",
"usage_mode": "single_use"
}{
"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": "collection_not_found",
"message": "The collection doesn't exist",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Resource not defined"
}{
"code": "409 Conflict",
"errors": [
{
"error_code": "collection_invalid_state",
"message": "The collection is in an invalid state for this operation",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Conflict"
}{
"code": "500 Internal Server Error",
"errors": [
{
"error_code": "internal_error",
"message": "An unexpected error occurred",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Something went wrong on the Server"
}