API · Create payments

API v1

An MCP tool wraps this operation: Stored cards and bulk collections.

POST /api/v1/collect/set/payments

What it does#

Create payments.

Authentication#

Host: https://app.tilopay.com. Requires the API bearer token in Authorization: Bearer <token> and the integration key in the body (key).

Get the API token.

Parameters#

keystringrequired#

Integration key.

captureinteger#

1 captures; 0 only authorizes.

reasonstringrequired#

Payment reason.

usersarray#

Affiliates: array of {id, amount, currency, date}.

groupsarray#

Groups: array of {id, amount, currency, date}; amount is per affiliate.

The date field is empty for immediate charges or YYYY-MM-DD for scheduled charges. In groups, amount is per affiliate.

Request example#

<api_key> is the placeholder for your integration key.

{
  "key": "<api_key>",
  "capture": 1,
  "reason": "Cobro mensualidad",
  "users": [
    {
      "id": "5",
      "amount": "500.00",
      "currency": "CRC",
      "date": ""
    },
    {
      "id": "32",
      "amount": "1000.00",
      "currency": "CRC",
      "date": "2024-06-20"
    },
    {
      "id": "25",
      "amount": "10.00",
      "currency": "USD",
      "date": "2024-06-20"
    }
  ],
  "groups": [
    {
      "id": "10",
      "amount": "25.00",
      "currency": "USD",
      "date": ""
    }
  ]
}

Response#

batch is the batch code for get/massive/detail. Empty date = immediate; YYYY-MM-DD = scheduled. Repeating this operation creates another charge.

statusunknown#

status.

errorsunknown#

errors.

users_errorsstring | array#

users_errors.

groups_errorsstring | array#

groups_errors.

programedsobject#

programeds.

batchunknown#

batch.

{
  "status": 200,
  "errors": "",
  "users_errors": "",
  "groups_errors": "",
  "programeds": {
    "users": [
      "5",
      "32",
      "25"
    ],
    "groups": [
      "10"
    ]
  },
  "batch": "SGZqbHlHalJiWmRNSEszd3ZEZHo4dz09"
}
{
  "type": "object",
  "properties": {
    "status": {
      "type": "integer"
    },
    "errors": {
      "type": "string"
    },
    "users_errors": {
      "type": [
        "string",
        "array"
      ],
      "items": {}
    },
    "groups_errors": {
      "type": [
        "string",
        "array"
      ],
      "items": {}
    },
    "programeds": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "batch": {
      "type": "string"
    }
  }
}

Error response#

HTTP 400:

{
  "status": "400",
  "errors": "Please verify the data sent",
  "users_errors": [
    {
      "id": "32",
      "amount": "1000.00",
      "currency": "CRC",
      "date": "invalidDate"
    }
  ],
  "groups_errors": [
    {
      "id": "10",
      "amount": "25.00",
      "currency": null,
      "date": null
    }
  ]
}

Safe retries.

Last verified: 2026-10-20

View as raw Markdown