Create a collection link
This endpoint allows you to create a collection link to share it with anybody.
Authorization
authorization
In: header
Header Parameters
Idempotency key in UUID v4 format
uuid"f30f1d0b-795f-49f5-80dc-41a7bffccfde"Request Body
application/json
Attributes to create a collection link
Indicates the format for resource's ID
^[A-Za-z]{2,6}_[\w-]{22}$"acc_5tgliBmzjZ6mpQPRbQjfKj"Money schema
Sets the collection link validations of the amount field. Two validations will always be present in the checkout form amount field:
- The amount must be greater than zero.
- 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.
"free""free" | "fixed" | "can_be_less" | "can_be_greater"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.
date-time"2022-01-01T01:00:00Z"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.
"37979c4d-9a6b-40de-b258-42e62f7ee4f1"Sets the payer data, which will be preloaded into the checkout form. This payer data can be optional
Sets the preference for whether this collection link should use realtime transfers. Will only be true if the system allows it.
falseSets a URL on the redirect button on the payment receipt after payment is made. The URL contains three parameters from the query string:
- id: this contains the same value as the field "external_id"
- clink_id: this is the collection link ID
- intent_id: this is the collection intent ID or the payment ID
uri-reference"https://www.mono.la/"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.
Sets the collection link type. There are two types of collection links:
- 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.
- multi_use: As the name suggests, this type of collection link can be used multiple times
"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"
}