Ir al contenido
UnoPagoDocumentación
Referencia de la APIBillingInvoices

Create invoices in bulk for multiple customers

POST
/v1/invoices/bulk

Issues the same invoice (items, discounts, dates) to each customer in customerInvoices.

Autorización

bearerAuth
headerAutorizaciónBearer <token>

Your API key, created in Configuración → Claves API. The key alone, without the Bearer prefix, is accepted too.

application/json
  1. body
customerInvoices*array<>
Elementos1 <= items
currency*string
Valor en"VES""USD""EUR"
issueDate?string
dueDate?string

After this day the invoice is OVERDUE and the late fee, if any, applies.

lateFee?number

Added once dueDate has passed: a fixed amount, or a percentage of the items' subtotal, per lateFeeType.

Rango0 <= value <= 1000000000
lateFeeType?string
Valor en"PERCENTAGE""FIXED"
accountPaymentMethodIds?array<string>

Ids from GET /v1/payment-methods. Limits how the customer can pay this invoice; without it, any of your account's methods.

items*array<>
Elementos1 <= items <= 50
discounts?array<>
Elementositems <= 5
Por defecto[]

Cuerpo de la respuesta

Successful response

application/json
  1. response
[index: integer]?
Ejemplo de solicitud
curl -X POST 'https://api.unopago.com/v1/invoices/bulk' \  -H 'Content-Type: application/json' \  -d '{  "customerInvoices": [    {      "customerId": "string"    }  ],  "currency": "VES",  "items": [    {      "description": "string",      "quantity": 1,      "amount": 0.01    }  ]}'
Ejemplo de respuesta
[  {    "lateFeeType": "PERCENTAGE",    "currency": "VES",    "pricingMode": "CURRENCY",    "status": "DRAFT",    "source": "STANDARD",    "id": "string",    "externalId": "string",    "accountId": "string",    "customerId": "string",    "printJobId": "string",    "fiscalRecordId": "string",    "billingDetailsId": "string",    "description": "string",    "issueDate": "string",    "dueDate": "string",    "expired": true,    "paidAt": "string",    "voidedAt": "string",    "planDate": "string",    "billingRunKey": "string",    "lateFee": 0,    "fiscalInvoicing": true,    "createdAt": "string",    "updatedAt": "string",    "total": 0,    "balance": 0,    "feesTotals": [      {        "type": "IGTF",        "rateBase": 0,        "rate": 0,        "total": 0      }    ],    "customer": {      "id": "string",      "accountId": "string",      "externalId": "string",      "mainContactId": "string",      "nationalId": "string",      "firstName": "string",      "lastName": "string",      "email": "string",      "phoneNumber": "string",      "address": "string",      "createdAt": "string",      "updatedAt": "string"    },    "discounts": [      {        "valueType": "PERCENTAGE",        "id": "string",        "accountId": "string",        "invoiceId": "string",        "fromPaymentId": "string",        "description": "string",        "value": 0,        "expiresAt": "string",        "expired": true,        "createdAt": "string",        "updatedAt": "string"      }    ],    "fees": [      {        "type": "IGTF",        "id": "string",        "accountId": "string",        "invoiceId": "string",        "fromPaymentId": "string",        "amount": 0,        "rate": 0,        "rateBase": 0,        "createdAt": "string",        "updatedAt": "string"      }    ],    "items": [      {        "discountValueType": "PERCENTAGE",        "id": "string",        "accountId": "string",        "invoiceId": "string",        "productId": "string",        "studentId": "string",        "description": "string",        "amount": 0,        "quantity": -9007199254740991,        "exento": true,        "isService": true,        "subscriptionId": "string",        "ivaRatePercent": -9007199254740991,        "discountValue": 0,        "discountExpiresAt": "string",        "discountExpired": true,        "createdAt": "string",        "updatedAt": "string"      }    ],    "transactions": [      {        "kind": "ITEMS",        "currency": "VES",        "id": "string",        "accountId": "string",        "customerId": "string",        "invoiceId": "string",        "statementId": "string",        "description": "string",        "transactionDate": "string",        "exchangeRate": 0,        "rateDate": "string",        "credit": 0,        "debit": 0,        "paymentId": "string",        "fromPaymentId": "string",        "retentionId": "string",        "createdAt": "string",        "updatedAt": "string"      }    ],    "paymentMethods": [      {        "id": "string",        "invoiceId": "string",        "accountPaymentMethodId": "string",        "createdAt": "string",        "updatedAt": "string"      }    ],    "paymentLink": "string",    "invoiceSequence": "string",    "fiscalInvoice": {      "source": "UNOPRINT",      "invoiceNumber": "string",      "controlNumber": "string",      "issuedAt": "string"    }  }]