VELARISAPI Docs
Api referenceInvoices

Generate invoice for policy

POST
/api/invoice/generate/{policyId}

Generate a new invoice for a policy based on enrolled properties and their nightly rates.

Path Parameters

policyId*string

The policy ID to generate an invoice for

Response Body

application/json

curl -X POST "https://example.com/api/invoice/generate/string"
{
  "id": "string",
  "organizationId": "string",
  "organizationPolicyId": "string",
  "invoiceReference": "string",
  "stateCode": "string",
  "periodStart": "2019-08-24",
  "periodEnd": "2019-08-24",
  "lineItems": [
    {
      "description": "string",
      "organizationPolicyId": "string",
      "orderId": "string",
      "orderLineId": "string",
      "policyId": "string",
      "orderReference": "string",
      "propertyName": "string",
      "quantity": 0,
      "unitPrice": 0,
      "amount": 0,
      "lossFundCharge": 0,
      "category": "INSURANCE_PREMIUM",
      "stayMonth": "string",
      "manual": true,
      "productLine": "string",
      "components": [
        {
          "code": "string",
          "treatment": "INSURANCE_PREMIUM",
          "amount": 0,
          "taxable": true
        }
      ],
      "audiences": {
        "customerCents": 0,
        "organizationCents": 0,
        "partnerCents": 0,
        "velarisCostCents": 0
      }
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "subtotalsByCategory": {
    "property1": 0,
    "property2": 0
  },
  "currency": "string",
  "status": "DRAFT",
  "dueDate": "2019-08-24",
  "paidDate": "2019-08-24",
  "stripePaymentIntentId": "string",
  "stripeInvoiceId": "string",
  "sentAt": "2019-08-24T14:15:22Z",
  "retryAttempt": 0,
  "lastRetryAt": "2019-08-24T14:15:22Z",
  "nextRetryAt": "2019-08-24T14:15:22Z",
  "lastFailureReason": "string",
  "suspendedAt": "2019-08-24T14:15:22Z",
  "reserveSplitsPublishedAt": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "createdDate": "2019-08-24T14:15:22Z",
  "lastModifiedBy": "string",
  "lastModifiedDate": "2019-08-24T14:15:22Z",
  "version": 0
}