Skip to content

Quote routes: accept, decline, expire

The Quote Verbs accept, decline, expire as api.sb routes, with inputs, result, refusals and an example.

Reference for Quote, one group of Quote routes.

Quote.accept

Accept takes a sent Quote before it expires, turning one-time lines into an Order and recurring lines into a Subscription. Verb page.

Text
POST /{namespace}/quotes/{quote}/accept

Path: quote. Body, as JSON: the other inputs. Emits Quote.accepted.

Inputs

InputTypeRequiredDescription
quoteQuoterequiredThe sent Quote.
partyPartyrequiredThe Contact or Organization accepting, who becomes the Customer.

Returns

OutputTypeRequiredDescription
orderOrderThe Order for the one-time lines, when the Quote has any.
subscriptionSubscriptionThe Subscription for the recurring lines, at each line’s quantity and term.
quoteQuoterequiredThe Quote, now accepted.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/quotes/qt_GZnH5OK100/accept \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"party":"party_hmQWaPrAyZ"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "order": {
    "$id": "https://api.sb/leaseline.app/orders/order_dswDnxf2vt",
    "$type": "Order",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "status": "placed"
  },
  "subscription": {
    "$id": "https://api.sb/leaseline.app/subscriptions/sub_jpvy3zejKB",
    "$type": "Subscription",
    "status": "active"
  },
  "quote": {
    "$id": "https://api.sb/leaseline.app/quotes/qt_GZnH5OK100",
    "$type": "Quote",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "validUntil": "2026-10-22",
    "status": "accepted",
    "lines": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Quote.accept",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Quote.decline

Decline records the buyer’s refusal of a sent Quote, with the reason in their words. Verb page.

Text
POST /{namespace}/quotes/{quote}/decline

Path: quote. Body, as JSON: the other inputs. Emits Quote.declined.

Inputs

InputTypeRequiredDescription
quoteQuoterequiredThe sent Quote.
reasontextWhy the buyer declined, kept verbatim.

Returns

OutputTypeRequiredDescription
quoteQuoterequiredThe declined Quote.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/quotes/qt_GZnH5OK100/decline \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "quote": {
    "$id": "https://api.sb/leaseline.app/quotes/qt_GZnH5OK100",
    "$type": "Quote",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "validUntil": "2026-10-22",
    "status": "declined",
    "lines": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Quote.decline",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Quote.expire

Expire closes a sent Quote that reached its validUntil date unaccepted; it never converts afterward. Verb page.

Text
POST /{namespace}/quotes/{quote}/expire

Path: quote. Emits Quote.expired.

Inputs

InputTypeRequiredDescription
quoteQuoterequiredThe Quote past its date.

Returns

OutputTypeRequiredDescription
quoteQuoterequiredThe expired Quote.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/quotes/qt_GZnH5OK100/expire \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "quote": {
    "$id": "https://api.sb/leaseline.app/quotes/qt_GZnH5OK100",
    "$type": "Quote",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "validUntil": "2026-10-22",
    "status": "expired",
    "lines": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Quote.expire",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}