Treli API
Docs
Soporte
  1. Facturas
  • Introducción
  • Autenticación
  • Errores
  • Códigos de rechazo
  • Suscripciones
    • Suscripción
    • Crear suscripción
      POST
    • Actualizar suscripción
      POST
    • Cancelar suscripción
      POST
    • Obtener suscripción
      GET
    • Eliminar descuento
      DELETE
    • Pausar suscripción
      POST
    • Reanudar suscripción
      POST
    • Listar suscripciones
      GET
  • Items de suscripción
    • Obtener item de suscripción
      GET
    • Eliminar item de suscripción
      DELETE
    • Actualizar item de suscripción
      POST
    • Crear item de suscripción
      POST
  • Clientes
    • Cliente
    • Crear cliente
      POST
    • Actualizar cliente
      POST
    • Obtener cliente
      GET
    • Listar clientes
      GET
    • Registrar pago de facturas
      POST
  • Cobros
    • Cobro
    • Crear cobro
    • Registrar cobro parcial
    • Enviar notificación de cobro
    • Anular cobro
    • Marcar como incobrable
    • Pagar un cobro
    • Obtener un cobro
    • Listar cobros
    • Modificar total del cobro
    • Modificar items del cobro
    • Modificar descuentos del cobro
    • Eliminar descuento
  • Facturas
    • Cargar factura
      POST
    • Obtener factura
      GET
    • Listar facturas
      GET
    • Anular factura
      POST
    • Pagar una factura
      POST
  • Notas de crédito
    • Nota de crédito
    • Crear nota de crédito
    • Anular nota de crédito
    • Obtener nota de crédito
  • Productos
    • Crear producto
    • Actualizar producto
    • Obtener un producto
    • Listar productos
    • Eliminar producto
  • Precios
    • Crear precio
    • Actualizar precio
    • Obtener un precio
    • Listar precios
    • Eliminar precio
  • Enlaces de pago
    • Crear enlace de pago
  • Sesión de checkout
    • Sesión de checkout
    • Crear sesión de checkout
    • Obtener sesión de checkout
  • Cupones
    • Cupón
    • Crear cupón
    • Obtener un cupón
    • Eliminar un cupón
    • Actualizar cupón
    • Listar cupones
  • Pagos de facturas
    • Pago de facturas
    • Listar pagos de facturas
  • Eventos
    • Evento
    • Tipos de eventos
    • Webhooks
  • Catálogo de parámetros por país
    • Colombia
  1. Facturas

Pagar una factura

POST
/v1/invoices/{id}/pay
Te permite registrar el pago de una factura recibido por fuera de Treli.
Si defines amount y amount < invoice.balance, el pago se registrará como un pago parcial. De lo contrario, se marcara la factura se marcará como pagada en su totalidad.

Request

Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
Path Params

Body Params application/json

Examples

Responses

🟢200Success
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.treli.co/v1/invoices//pay' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "paid_out_of_band": true,
    "paid_date": "2019-08-24",
    "out_of_band_payment_method": "string",
    "out_of_band_payment_gateway": "string",
    "generate_receipt": "string",
    "amount": "string",
    "apply_early_offer": true,
    "receipt_number": "string"
}'
Response Response Example
{
    "id": "col_zdhBDP4k3JiRHNQ4RBUHyHgu",
    "items": [
        {
            "id": "si_d7d2UrHwSG5A5YkYF7vfZmFf",
            "name": "Nombre del producto",
            "unit_price": "20000.00",
            "quantity": 1,
            "subtotal": "20000.00",
            "total": "20000.00",
            "product": {
                "id": "prod_GYzZ5BXNRu6DxqQcEPJNoeCk",
                "name": "Nombre del producto",
                "description": "string",
                "status": "active",
                "product_merchant_id": null,
                "product_invoicing_id": null,
                "product_shopify_id": null,
                "product_woocommerce_id": null,
                "created_date": "2024-11-15 16:44:50",
                "image": "http://example.com",
                "is_test": false,
                "invoice_settings": {
                    "invoice_tax_id": "12345",
                    "invoice_tax_percentage": "19"
                }
            },
            "price": {
                "id": "price_zUI6hNgEkX8sOLIUjnB9JpaQ",
                "unit_price": "20000.00",
                "pricing_model": "standard",
                "currency": "COP",
                "billing_period": "day",
                "billing_interval": 1,
                "type": "recurring",
                "pricing_tiers": null,
                "ntp_pricing": null,
                "created_date": "2024-11-15 16:44:50",
                "active": true,
                "is_test": false,
                "product_id": "prod_GYzZ5BXNRu6DxqQcEPJNoeCk"
            }
        }
    ],
    "discounts": [
        {
            "id": "sd_aYbDFQaOd7TmBl0I58D5ax8l",
            "code": "10OFF",
            "amount": "10000.00",
            "percent": "10.00"
        }
    ],
    "description": "Cobro de factura",
    "subtotal": "string",
    "total": "string",
    "status": "pending",
    "currency": "COP",
    "created_date": "2024-11-15 16:44:50",
    "paid_date": "2019-08-24T14:15:22Z",
    "voided_at_date": "2019-08-24T14:15:22Z",
    "due_date": "2019-08-24T14:15:22Z",
    "collection_method": "charge",
    "collection_rule_id": "string",
    "type": "invoice",
    "is_test": false,
    "tag": "string",
    "source": "string",
    "meta_data": {},
    "payment_settings": null,
    "invoice_settings": {
        "invoice_document_id": "string",
        "invoice_cost_center": "string"
    },
    "invoice_retentions": {
        "reteica": "string",
        "retefte": "string"
    },
    "collection_attempts": 0,
    "collecting": true,
    "next_collection_attempt_date": "2019-08-24T14:15:22Z",
    "payment_method_gateway": "string",
    "payment_method_type": "string",
    "paid_out_of_band": true,
    "out_of_band_proof": "http://example.com",
    "customer": "string",
    "billing_address": {
        "address_1": "string",
        "address_2": null,
        "city": "string",
        "state": "string",
        "postcode": null,
        "country": "string"
    },
    "subscription": "string",
    "invoice": "string",
    "invoice_number": "string",
    "checkout_url": "string",
    "invoices": [
        "string"
    ]
}
Previous
Anular factura
Next
Nota de crédito
Built with