Mono Colombia

Create QR code

Creates a QR code for a collection. The collection must be in ready or minimum_paid state.

The QR usage is determined by the usage_mode parameter:

  • single_use: Creates a dynamic QR (requires amount, has expiration)
  • multiple_use: Creates a static QR (amount is optional)

When an amount is provided, it must comply with the collection's rules:

  • Must be within minimum_attempt_amount and maximum_attempt_amount range
  • Must not exceed remaining balance (total_maximum_amount - paid_amount)
POST
/api/v1/collections/{collection_id}/qr

Authorization

oauth collections
AuthorizationBearer <token>

In: header

Scope: collections

Path Parameters

collection_idstring

The collection ID

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

Request Body

application/json

QR code creation data

TypeScript Definitions

Use the request body type in TypeScript.

amount?object|null

Fixed amount for the QR code. Required when usage_mode is single_use. Optional for multiple_use.

error_correction_level?string

Error correction level for the QR code. Higher levels allow more damage recovery but result in denser QR codes. Defaults to medium.

Default"medium"
Value in"low" | "medium" | "quarter" | "high"
expiration_seconds?integer

Expiration time in seconds. Required for single_use. Not allowed for multiple_use.

Range1 <= value <= 6220800
image_width?integer

Width of the QR code image in pixels. Defaults to 400.

Default400
Range400 <= value <= 2048
key_type?string

Specific key type to use. Must be provided together with key_value. If not provided, the most recent available key for the collection will be used.

Value in"identification" | "cellphone" | "email" | "alphanumeric" | "merchant_code"
key_value?string

Specific key value to use. Must be provided together with key_type. If not provided, the most recent available key for the collection will be used.

Example"@MN1A2B3C4D5E"
usage_modestring

single_use creates a dynamic QR code (single payment). multiple_use creates a static QR code (multiple payments).

Value in"single_use" | "multiple_use"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://breb-participant.sandbox.mono.la/api/v1/collections/bbcol_5tgliBmzjZ6mpQPRbQjfKj/qr" \  -H "Content-Type: application/json" \  -d '{    "usage_mode": "single_use"  }'
{
  "amount": {
    "amount": 100000000,
    "currency": "COP"
  },
  "canceled": true,
  "collection_id": "bbcol_5tgliBmzjZ6mpQPRbQjfKj",
  "emvco": "12340101567826430014XX.YYY.ZZZ.AAA0421@ABC1234567890XYZW5802CO5913EXAMPLE MERCHANT6010MEDELLIN6304FF00",
  "error_correction_level": "low",
  "expires_at": "2022-01-01T01:00:00Z",
  "failed_attempts": 0,
  "id": "bbqr_5tgliBmzjZ6mpQPRbQjfKj",
  "image": "string",
  "image_width": 0,
  "inserted_at": "2022-01-01T01:00:00Z",
  "key_type": "identification",
  "key_value": "@MN1A2B3C4D5E",
  "payment_id": "CO.COM.CRB.TRXIDP1234567891234",
  "successful_attempts": 0,
  "updated_at": "2022-01-01T01:00:00Z",
  "usage_mode": "single_use"
}
{
  "code": "400 Bad Request",
  "errors": [
    {
      "error_code": "qr_type_not_allowed",
      "message": "Static QR is not allowed for fixed-value single-use collections",
      "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"
}
{
  "code": "503 Service Unavailable",
  "errors": [
    {
      "error_code": "service_is_unavailable",
      "message": "The service is unavailable, Please try again later",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Service unavailable"
}