Mono Colombia

Create a collection link

This endpoint allows you to create a collection link to share it with anybody.

POST
/v1/collection_links

Authorization

authorization

AuthorizationBearer <token>

In: header

Header Parameters

x-idempotency-key?string

Idempotency key in UUID v4 format

Formatuuid
Example"f30f1d0b-795f-49f5-80dc-41a7bffccfde"

Request Body

application/json

Attributes to create a collection link

account_idstring

Indicates the format for resource's ID

Match^[A-Za-z]{2,6}_[\w-]{22}$
Example"acc_5tgliBmzjZ6mpQPRbQjfKj"
amountobject

Money schema

amount_validationstring

Sets the collection link validations of the amount field. Two validations will always be present in the checkout form amount field:

  1. The amount must be greater than zero.
  2. The amount must be within the limits allowed by Mono.

The field "amount_validation" is an additional validation configured to be applied to the checkout form's amount field.

  • fixed: No validation will be applied to the amount field in the checkout form, and the user will not be able to enter an amount. The checkout form's amount field will contain the configured amount (the amount is fixed).
  • free: No validation will be applied, and the user can enter any amount in the checkout form.
  • can_be_less: The amount entered by the user can be less than or equal to the configured amount.
  • can_be_greater: The amount entered by the user can be greater than or equal to the configured amount.
Default"free"
Value in"free" | "fixed" | "can_be_less" | "can_be_greater"
expires_at?string|null

Sets an expiration date and time for the collection link. If a user attempts to enter an expired link, a message will be displayed informing them that the link has expired.

Formatdate-time
Example"2022-01-01T01:00:00Z"
external_id?string|null

Associates the collection link with an external register. For example, this field may contain identifiers of entities that could be used in some external system.

Example"37979c4d-9a6b-40de-b258-42e62f7ee4f1"
payer?object

Sets the payer data, which will be preloaded into the checkout form. This payer data can be optional

realtime_transfer?boolean|null

Sets the preference for whether this collection link should use realtime transfers. Will only be true if the system allows it.

Examplefalse
redirect_url?string|null

Sets a URL on the redirect button on the payment receipt after payment is made. The URL contains three parameters from the query string:

  1. id: this contains the same value as the field "external_id"
  2. clink_id: this is the collection link ID
  3. intent_id: this is the collection intent ID or the payment ID
Formaturi-reference
Example"https://www.mono.la/"
reference?object

Sets the reference field in the checkout form. When there is no reference, and it is configured not to be editable, the checkout form reference field will not be visible.

usage_typestring

Sets the collection link type. There are two types of collection links:

  1. single_use: As the name suggests, this type of collection link can only be used once. When a successful payment is made, the link will be disabled. The collection link will display a message if a user tries to access it again after the payment has been made.
  2. multi_use: As the name suggests, this type of collection link can be used multiple times
Value in"single_use" | "multi_use"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.cert.monoban.co/v1/collection_links" \  -H "Content-Type: application/json" \  -d '{    "account_id": "acc_5tgliBmzjZ6mpQPRbQjfKj",    "amount": {      "amount": 100000000,      "currency": "COP"    },    "amount_validation": "free",    "usage_type": "single_use"  }'
{
  "account_id": "acc_5tgliBmzjZ6mpQPRbQjfKj",
  "amount": {
    "amount": 100000000,
    "currency": "COP"
  },
  "amount_validation": "free",
  "enabled": false,
  "expires_at": "2022-01-01T01:00:00Z",
  "external_id": "37979c4d-9a6b-40de-b258-42e62f7ee4f1",
  "id": "clink_5tgliBmzjZ6mpQPRbQjfKj",
  "inserted_at": "2022-01-01T01:00:00Z",
  "link": "https://cuentamono.com/collections/0nhhhaDS62th4QyoS6oi8h",
  "payer": {
    "document_number": "string",
    "document_type": "CC",
    "email": "someone@gmail.com",
    "name": "string",
    "note": {
      "editable": false,
      "required": false,
      "value": "string"
    },
    "phone": "+573000000000"
  },
  "realtime_transfer": false,
  "redirect_url": "https://www.mono.la/",
  "reference": {
    "editable": false,
    "required": false,
    "value": "string"
  },
  "successful_payments": 1,
  "updated_at": "2022-01-01T01:00:00Z",
  "usage_type": "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": "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": "422 Unprocessable Entity",
  "errors": [
    {
      "error_code": "missing_field",
      "message": "The field is missing on the request body or parameters.",
      "path": "#/path/to/field",
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Validation errors"
}