Mono Colombia

Update a collection

Updates specific fields of a collection.

Restrictions:

  • Cannot update collections in discarded or failed states or with prune_status not null
  • Only the following fields can be updated:
    • nickname
    • enabled
    • expires_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 >= current paid_amount, may trigger state change)

State changes for total_minimum_amount:

  • If paid_amount >= new total_minimum_amount, state changes to minimum_paid (if currently ready)
  • If paid_amount < new total_minimum_amount, state changes to ready (if currently minimum_paid)

State changes for total_maximum_amount:

  • If ready or minimum_paid, and new total_maximum_amount == paid_amount, state changes to paid
  • If paid and new total_maximum_amount is null, state changes to ready or minimum_paid (depending on whether total_minimum_amount is set and reached)
  • If paid and new total_maximum_amount > paid_amount, state changes to ready or minimum_paid (depending on whether total_minimum_amount is set and reached)

Webhooks:

  • A collection.updated webhook is sent after the update
  • If a state change occurs due to the update, it is included in the collection.updated webhook but does NOT trigger separate state change webhooks
PATCH
/api/v1/collections/{id}

Authorization

oauth collections
AuthorizationBearer <token>

In: header

Scope: collections

Path Parameters

idstring

The collection ID

Match^[A-Za-z]{2,7}_[\w-]{22}$
Example"bbcol_5tgliBmzjZ6mpQPRbQjfKj"

Request Body

application/json

Collection update data

enabled?boolean

Whether the collection is enabled to receive payments

expires_at?string|null

New expiration date for the collection. Must be in the future.

Formatdate-time
Example"2022-01-01T01:00:00Z"
maximum_attempt_amount?object|null

Maximum amount allowed per payment attempt. Only valid for multiple_use collections.

minimum_attempt_amount?object|null

Minimum amount allowed per payment attempt. Only valid for multiple_use collections.

nickname?string|null

Description used by client to identify by purpose, product or service

Lengthlength <= 255
Example"Updated subscription name"
total_maximum_amount?object|null

Maximum total amount the collection can receive. Cannot be less than the current paid_amount.

total_minimum_amount?object|null

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.cert.monoban.co/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": "identification",
      "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": "invalid_expires_at",
      "message": "The expiration date must be in the future",
      "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"
}