quotes

Approve a quote version

Changed on

This endpoint approves a quote version and generates the order form to send to the customer for signature. Only a draft version can be approved, and its billing_items must be complete: approval validates them against the catalog and against the customer, and returns a 422 when the deal cannot be executed as quoted. The expires_at of the generated order form is bounded by the deal's own term, so a signing window reaching beyond the day the deal stops being executable is rejected. A concurrent write on the same quote is reported as a 422 rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.

post/quote_versions/{lago_id}/approve

Request

Request body

expires_atstring date-time

The date and time in UTC (ISO 8601) when the order form generated by the approval expires. It must be in the future, and must fall strictly before the day the quoted deal stops being executable, otherwise the approval is rejected with a 422. That boundary is the earliest of the endDate of any quoted plan and the expirationAt of any quoted wallet credit or recurring top-up rule. A one_off quote carries none of them, so its signing window is never bounded. When expires_at is omitted, the order form never expires.

Example request

{
  "expires_at": "2026-06-30T23:59:59Z"
}

Response

Quote version approved

Example response

{
  "quote_version": {
    "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "lago_quote_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "version": 1,
    "status": "draft",
    "currency": "USD",
    "billing_entity_code": "acme_corp",
    "void_reason": "manual",
    "approved_at": "2026-04-29T08:59:51Z",
    "voided_at": "2026-04-29T08:59:51Z",
    "created_at": "2026-04-29T08:59:51Z",
    "updated_at": "2026-04-29T08:59:51Z",
    "content": "<h1>Quote QT-2026-0001</h1><p>Prepared for Acme Corp.</p>",
    "billing_items": {
      "addOns": [
        {
          "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
          "type": "add_on",
          "payload": {
            "code": "setup_fee",
            "units": 1,
            "unitAmountCents": 10000,
            "totalAmountCents": 10000,
            "fromDatetime": "2026-01-01T00:00:00Z",
            "toDatetime": "2026-12-31T23:59:59Z"
          },
          "overrides": {
            "description": "Onboarding package, discounted for the first year",
            "units": 2,
            "unitAmountCents": 8000,
            "totalAmountCents": 16000,
            "invoiceDisplayName": "Onboarding",
            "fromDatetime": "2026-01-01T00:00:00Z",
            "toDatetime": "2026-12-31T23:59:59Z"
          }
        }
      ],
      "plans": [
        {
          "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
          "type": "plan",
          "payload": {
            "code": "premium_plan",
            "subscriptionExternalId": "sub_1234567890",
            "subscriptionName": "Premium plan - Acme Corp",
            "billingTime": "calendar",
            "startDate": "2026-01-01T00:00:00Z",
            "endDate": "2027-01-01T00:00:00Z",
            "paymentMethodId": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "charges": [
              {
                "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                "billableMetric": {
                  "code": "api_calls"
                },
                "chargeModel": "standard"
              }
            ],
            "fixedCharges": [
              {
                "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                "addOn": {
                  "code": "seats"
                },
                "chargeModel": "standard"
              }
            ]
          },
          "overrides": {
            "amountCents": 50000,
            "amountCurrency": "USD",
            "invoiceDisplayName": "Premium",
            "name": "Premium plan - Acme Corp",
            "description": "Negotiated premium plan",
            "trialPeriod": 30,
            "minimumCommitment": {
              "amountCents": 100000,
              "invoiceDisplayName": "Annual commitment"
            },
            "usageThresholds": [
              {
                "amountCents": 100000,
                "thresholdDisplayName": "First 1,000 EUR of usage"
              }
            ],
            "charges": [
              {
                "billableMetricCode": "api_calls",
                "chargeModel": "standard",
                "properties": {
                  "amount": "0.02"
                },
                "minAmountCents": 10000,
                "invoiceDisplayName": "API calls"
              }
            ],
            "fixedCharges": [
              {
                "addOnCode": "seats",
                "units": "10",
                "properties": {
                  "amount": "5"
                },
                "invoiceDisplayName": "Seats"
              }
            ]
          }
        }
      ],
      "coupons": [
        {
          "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
          "type": "coupon",
          "payload": {
            "code": "welcome_offer",
            "type": "fixed_amount",
            "amountCents": 10000,
            "currency": "USD",
            "percentageRate": 10.5,
            "frequency": "once",
            "frequencyDuration": 3
          },
          "overrides": {
            "amountCents": 15000,
            "amountCurrency": "USD",
            "percentageRate": 15,
            "frequency": "recurring",
            "frequencyDuration": 6
          }
        }
      ],
      "walletCredits": [
        {
          "localId": "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b",
          "type": "wallet_credit",
          "payload": {
            "paidCredits": "100.0",
            "grantedCredits": "20.0",
            "rateAmount": "1.0",
            "currency": "USD",
            "expirationAt": "2027-01-01T00:00:00Z",
            "appliesTo": {
              "feeTypes": [
                "charge"
              ],
              "billableMetricCodes": [
                "api_calls"
              ]
            },
            "recurringTransactionRules": [
              {
                "trigger": "interval",
                "interval": "monthly",
                "thresholdCredits": "10.0",
                "method": "fixed",
                "targetOngoingBalance": "100.0",
                "paidCredits": "100.0",
                "grantedCredits": "20.0",
                "startedAt": "2026-01-01T00:00:00Z",
                "expirationAt": "2027-01-01T00:00:00Z",
                "transactionName": "Monthly top-up"
              }
            ]
          }
        }
      ]
    }
  }
}

Changes