Mono Colombia

Creates an intent

Creates an intent: a single expected payment declared before the funds arrive, configured from a template the client owns or created templateless against one of its subaccounts (template_id and subaccount_id are mutually exclusive). The request is idempotent on external_id — repeating it returns the existing intent instead of creating a duplicate.

POST
/v1/core/payins/intents

Authorization

authorization
AuthorizationBearer <token>

In: header

Request Body

application/json

Attributes to create an intent

TypeScript Definitions

Use the request body type in TypeScript.

method_params?BreBIntentParams

Bre-B configuration for the intent. If omitted, the values configured on the parent template are used.

custom_merchant_name?string|null

Merchant name shown to the payer for this intent. Optional override of the value defined on the parent template.

Length5 <= length <= 50
Example"string"
expected_payers?array|null

If set, only these payers are allowed to pay the intent. If omitted, the template's expected payers apply (none for a templateless intent).

external_idstring

Tenant-side identifier. Must be unique per tenant.

Length1 <= length <= 255
Example"string"
merchant_amount?object|null

Amount expected to be received by the merchant. Provide exactly one of merchant_amount or payer_amount; the other is computed from the one provided.

methodstring

Payment method of the intent.

Value in"co_breb"
Example"co_breb"
payer_amount?object|null

Amount expected to be paid by the payer. Provide exactly one of payer_amount or merchant_amount; the other is computed from the one provided.

payin_data?object
subaccount_id?string|null

Subaccount that owns the intent: provided directly for a templateless intent (mutually exclusive with template_id), inherited from the template otherwise.

Match^[A-Za-z]{2,7}_[\w-]{22}$
Example"lacc_5tgliBmzjZ6mpQPRbQjfKj"
template_id?string|null

Template this intent belongs to. Mutually exclusive with subaccount_id.

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

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.sandbox.cuentamono.com/v1/core/payins/intents" \  -H "Content-Type: application/json" \  -d '{    "external_id": "string",    "method": "co_breb"  }'
{
  "method_params": {
    "create_qr": false,
    "custom_key_value": "string",
    "qr_code_data": {
      "merchant_category_code": "5411",
      "receiver_city": "Bogota",
      "receiver_postal_code": "110111"
    },
    "required_tokens": [
      "qr"
    ]
  },
  "payment_tokens": {
    "key_type": "alphanumeric",
    "key_value": "@MN1A2B3C4D5E",
    "qr": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "emvco": "00020101021226440014CO.COM.CRB.RED0122CO.COM.CRB.TRXIDP123456752045411530317054061000005802CO5910Acme Store6006Bogota6304A1B2",
      "error_correction_level": "medium",
      "expires_at": "2022-01-01T01:00:00Z",
      "image": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB...",
      "image_width": 512,
      "payment_id": "CO.COM.CRB.TRXIDP1234567891234",
      "usage_mode": "multiple_use"
    },
    "qr_error": null
  },
  "calculated_fees": {
    "payin": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "id": "fee_5tgliBmzjZ6mpQPRbQjfKj"
    },
    "payin_payer_spread": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "id": "fee_5tgliBmzjZ6mpQPRbQjfKj"
    },
    "payin_subaccount_spread": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "id": "fee_5tgliBmzjZ6mpQPRbQjfKj"
    }
  },
  "custom_merchant_name": "string",
  "expected_payers": [
    {
      "document_number": "1023711432",
      "document_type": "CC",
      "kind": "co_person_document"
    }
  ],
  "expires_at": "2022-01-01T01:00:00Z",
  "external_id": "string",
  "id": "cpint_5tgliBmzjZ6mpQPRbQjfKj",
  "inserted_at": "2022-01-01T01:00:00Z",
  "merchant_amount": {
    "amount": 100000000,
    "currency": "COP"
  },
  "method": "co_breb",
  "payer_amount": {
    "amount": 100000000,
    "currency": "COP"
  },
  "payin_data": {
    "fee_override": [
      {
        "fixed": {
          "amount": 100000000,
          "currency": "COP"
        },
        "percentage": "0.05",
        "tx_description": "Collection service fee",
        "type": "payin"
      }
    ],
    "metadata": {
      "id": 3,
      "reference": 123
    },
    "redirect_url": "https://merchant.example.com/checkout/return",
    "subaccount_disbursement_trigger": "on_approval"
  },
  "prune_reason": null,
  "prune_state": "pruning",
  "pruned_at": "2022-01-01T01:00:00Z",
  "state": "created",
  "state_reason": "unknown",
  "subaccount_id": "lacc_5tgliBmzjZ6mpQPRbQjfKj",
  "template_id": "cpitpl_5tgliBmzjZ6mpQPRbQjfKj",
  "updated_at": "2022-01-01T01:00:00Z",
  "url": "https://www.mono.la/"
}
{
  "method_params": {
    "create_qr": false,
    "custom_key_value": "string",
    "qr_code_data": {
      "merchant_category_code": "5411",
      "receiver_city": "Bogota",
      "receiver_postal_code": "110111"
    },
    "required_tokens": [
      "qr"
    ]
  },
  "payment_tokens": {
    "key_type": "alphanumeric",
    "key_value": "@MN1A2B3C4D5E",
    "qr": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "emvco": "00020101021226440014CO.COM.CRB.RED0122CO.COM.CRB.TRXIDP123456752045411530317054061000005802CO5910Acme Store6006Bogota6304A1B2",
      "error_correction_level": "medium",
      "expires_at": "2022-01-01T01:00:00Z",
      "image": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB...",
      "image_width": 512,
      "payment_id": "CO.COM.CRB.TRXIDP1234567891234",
      "usage_mode": "multiple_use"
    },
    "qr_error": null
  },
  "calculated_fees": {
    "payin": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "id": "fee_5tgliBmzjZ6mpQPRbQjfKj"
    },
    "payin_payer_spread": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "id": "fee_5tgliBmzjZ6mpQPRbQjfKj"
    },
    "payin_subaccount_spread": {
      "amount": {
        "amount": 100000000,
        "currency": "COP"
      },
      "id": "fee_5tgliBmzjZ6mpQPRbQjfKj"
    }
  },
  "custom_merchant_name": "string",
  "expected_payers": [
    {
      "document_number": "1023711432",
      "document_type": "CC",
      "kind": "co_person_document"
    }
  ],
  "expires_at": "2022-01-01T01:00:00Z",
  "external_id": "string",
  "id": "cpint_5tgliBmzjZ6mpQPRbQjfKj",
  "inserted_at": "2022-01-01T01:00:00Z",
  "merchant_amount": {
    "amount": 100000000,
    "currency": "COP"
  },
  "method": "co_breb",
  "payer_amount": {
    "amount": 100000000,
    "currency": "COP"
  },
  "payin_data": {
    "fee_override": [
      {
        "fixed": {
          "amount": 100000000,
          "currency": "COP"
        },
        "percentage": "0.05",
        "tx_description": "Collection service fee",
        "type": "payin"
      }
    ],
    "metadata": {
      "id": 3,
      "reference": 123
    },
    "redirect_url": "https://merchant.example.com/checkout/return",
    "subaccount_disbursement_trigger": "on_approval"
  },
  "prune_reason": null,
  "prune_state": "pruning",
  "pruned_at": "2022-01-01T01:00:00Z",
  "state": "created",
  "state_reason": "unknown",
  "subaccount_id": "lacc_5tgliBmzjZ6mpQPRbQjfKj",
  "template_id": "cpitpl_5tgliBmzjZ6mpQPRbQjfKj",
  "updated_at": "2022-01-01T01:00:00Z",
  "url": "https://www.mono.la/"
}
{
  "code": "400 Bad Request",
  "errors": [
    {
      "error_code": "method_disabled",
      "message": "The payin method is not enabled for this account",
      "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": "template_not_found",
      "message": "The template doesn't exist.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Resource not defined"
}
{
  "code": "409 Conflict",
  "errors": [
    {
      "error_code": "template_invalid_state",
      "message": "The template is in an invalid state for this operation.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Conflict"
}
{
  "code": "422 Unprocessable Content",
  "errors": [
    {
      "error_code": "invalid_enum",
      "message": "The field contains an invalid value.",
      "path": "#/path/to/field",
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Validation errors"
}