Skip to main content

kobana billing proposals

Commands of kobana billing proposals. Every global option (Global options) applies here.

CommandHTTPDescription
proposals bulk deleteDELETE /v1/proposals/bulkBulk delete proposals
proposals items listGET /v1/proposals/{id}/itemsList proposal items
proposals items createPOST /v1/proposals/{id}/itemsAdd item to proposal
proposals items getGET /v1/proposals/{id}/items/{item_id}Get proposal item
proposals items updatePATCH /v1/proposals/{id}/items/{item_id}Update proposal item
proposals items deleteDELETE /v1/proposals/{id}/items/{item_id}Delete proposal item
proposals statsGET /v1/proposals/statsGet proposal statistics
proposals listGET /v1/proposalsList proposals
proposals createPOST /v1/proposalsCreate proposal
proposals updatePUT /v1/proposalsUpsert proposal
proposals bulk-cancelPOST /v1/proposals/bulk-cancelBulk cancel proposals
proposals bulk-sendPOST /v1/proposals/bulk-sendBulk send proposals
proposals getGET /v1/proposals/{id}Get proposal
proposals deleteDELETE /v1/proposals/{id}Delete proposal
proposals acceptPOST /v1/proposals/{id}/acceptAccept proposal
proposals cancelPOST /v1/proposals/{id}/cancelCancel proposal
proposals duplicatePOST /v1/proposals/{id}/duplicateDuplicate proposal
proposals generate-pdfPOST /v1/proposals/{id}/generate-pdfGenerate proposal PDF
proposals jsonGET /v1/proposals/{id}/jsonGet proposal JSON snapshot
proposals pricingGET /v1/proposals/{id}/pricingGet proposal pricing breakdown
proposals publishPOST /v1/proposals/{id}/publishPublish proposal
proposals sendPOST /v1/proposals/{id}/sendSend proposal email
proposals undo-acceptPOST /v1/proposals/{id}/undo-acceptUndo proposal acceptance
proposals unpublishPOST /v1/proposals/{id}/unpublishUnpublish proposal

proposals bulk delete​

Bulk delete proposals

kobana billing proposals bulk delete [OPTIONS]

DELETE /v1/proposals/bulk

Deletes multiple proposals at once (up to 100). Returns success/failure counts and errors per id. Requires the delete access level. Replaces POST /v1/proposals/bulk-delete, which was removed.

Request body

NameTypeRequiredDescription
idsarray<string (uuid)>yesList of target proposal UUIDs. Minimum 1, maximum 100.

More fields and nested objects: kobana schema billing.proposals.bulk.delete.

Responses

HTTPDescription
200Bulk delete result.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals items list​

List proposal items

kobana billing proposals items list [ID] [OPTIONS]

GET /v1/proposals/{id}/items

Path arguments: id

Responses

HTTPDescription
200List of items.
404Resource not found in the current organization.

proposals items create​

Add item to proposal

kobana billing proposals items create [ID] [OPTIONS]

POST /v1/proposals/{id}/items

Path arguments: id

Request body

NameTypeRequiredDescription
product_idstring (uuid)yesProduct UUID. Required.
price_idstring (uuid)yesPrice UUID. Required.
unit_amountnumberyesUnit amount in sub-cents (float, up to 4 decimal places).
quantitynumbernoQuantity. Default: 1.
metadataobjectnoArbitrary item metadata.
custom_metadataobjectnoItem custom fields.

More fields and nested objects: kobana schema billing.proposals.items.create.

Responses

HTTPDescription
201Item created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals items get​

Get proposal item

kobana billing proposals items get [ID] [ITEM_ID] [OPTIONS]

GET /v1/proposals/{id}/items/{item_id}

Path arguments: id, item_id

Responses

HTTPDescription
200Item detail.
404Resource not found in the current organization.

proposals items update​

Update proposal item

kobana billing proposals items update [ID] [ITEM_ID] [OPTIONS]

PATCH /v1/proposals/{id}/items/{item_id}

Updates an item. Only allowed on draft (status = draft) proposals.

Path arguments: id, item_id

Request body

NameTypeRequiredDescription
quantityintegernoUpdate quantity.
unit_amountnumbernoUpdate unit amount in sub-cents (float, up to 4 decimal places).
setup_amountnumbernoUpdate unit setup amount in sub-cents (float, up to 4 decimal places).
custom_metadataobjectnoproposals.items.update.body.custom_metadata

More fields and nested objects: kobana schema billing.proposals.items.update.

Responses

HTTPDescription
200Item updated.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals items delete​

Delete proposal item

kobana billing proposals items delete [ID] [ITEM_ID] [OPTIONS]

DELETE /v1/proposals/{id}/items/{item_id}

Removes an item. Only allowed on draft (status = draft) proposals.

Path arguments: id, item_id

Responses

HTTPDescription
200Item deleted.
404Resource not found in the current organization.
422Request body failed validation.

proposals stats​

Get proposal statistics

kobana billing proposals stats [OPTIONS]

GET /v1/proposals/stats

Returns proposal counts by status (draft, sent, viewed, accepted, rejected, expired, canceled) for the current organization.

Responses

HTTPDescription
200Proposal statistics.
404Resource not found in the current organization.

proposals list​

List proposals

kobana billing proposals list [OPTIONS]

GET /v1/proposals

Returns a paginated list of the current organization's commercial proposals.

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.
person_idstringnoFilter by associated person UUID.
person_document_numberstringnoFilter by person CPF/CNPJ (exact match).
person_name_containsstringnoFilter by person name (partial search, case-insensitive).
statusstringnoFilter by status: draft, sent, viewed, accepted, rejected, expired or canceled. Values: draft, sent, viewed, accepted, rejected, expired, canceled.
billing_account_idstringnoFilter by linked billing_account_id.
prospect_idstringnoFilter by prospect_id.
contact_idstringnoFilter by linked contact_id.
coupon_idstringnoFilter by applied coupon_id.
company_idstringnoFilter by issuing company_id.
template_idstringnoFilter by template_id used to generate the PDF.
codestringnoFilter by proposal short code (e.g.: PROP-0001).
external_idstringnoFilter by external identifier.
searchstringnoFree-text search.
created_afterstringnoStart of creation date range (YYYY-MM-DD).
created_beforestringnoEnd of creation date range (YYYY-MM-DD).
expires_afterstringnoFilter by start expires_at (ISO 8601, inclusive).
expires_beforestringnoFilter by end expires_at (ISO 8601, inclusive).
accepted_afterstringnoFilter by start accepted_at (ISO 8601, inclusive).
accepted_beforestringnoFilter by end accepted_at (ISO 8601, inclusive).
sent_afterstringnoFilter by start sent_at (ISO 8601, inclusive).
sent_beforestringnoFilter by end sent_at (ISO 8601, inclusive).
viewed_afterstringnoFilter by start viewed_at (ISO 8601, inclusive).
viewed_beforestringnoFilter by end viewed_at (ISO 8601, inclusive).
rejected_afterstringnoFilter by start rejected_at (ISO 8601, inclusive).
rejected_beforestringnoFilter by end rejected_at (ISO 8601, inclusive).
setup_amount_minnumber,nullnoFilter by minimum setup_amount (in BRL).
setup_amount_maxnumber,nullnoFilter by maximum setup_amount (in BRL).
monthly_amount_minnumber,nullnoFilter by minimum monthly_amount (in BRL).
monthly_amount_maxnumber,nullnoFilter by maximum monthly_amount (in BRL).

Responses

HTTPDescription
200Paginated list of proposals.
404Resource not found in the current organization.

proposals create​

Create proposal

kobana billing proposals create [OPTIONS]

POST /v1/proposals

Creates a commercial proposal. You must provide billing_account_id, prospect_id or prospect_data (inline prospect creation).

Request body

NameTypeRequiredDescription
company_idstring (uuid)noIssuing company UUID. Use null to clear.
titlestringnoProposal title. Default: "Proposta Comercial".
descriptionstringnoFree-form proposal description.
billing_account_idstring (uuid)noTarget billing account UUID (existing customer). Required if prospect_id and prospect_data are not provided.
prospect_idstring (uuid)noUUID of an existing prospect. Alternative to billing_account_id/prospect_data.
contact_idstring (uuid)noUUID of an existing contact linked to the prospect.
prospect_dataobjectnoData to create a prospect inline (juridical person). Alternative to prospect_id/billing_account_id.
contact_dataobjectnoData to create a contact inline (natural person in charge).
coupon_idstring (uuid)noCoupon UUID to apply.
template_idstring (uuid)noTemplate UUID for PDF generation.
discount_percentnumbernoNegotiated discount percent (0–100), applied to the monthly amount; the cycle discount applies over the discounted value. Do not send together with discount_amount.
discount_amountnumbernoNegotiated fixed per-month discount in BRL (float, up to 4 decimal places), applied to the monthly amount; the cycle discount applies over the discounted value. Do not send together with discount_percent.
commitment_monthsintegernoCommitment period in months (1–120). Use null to clear. Copied to the subscription when the proposal is accepted.
expires_atstringnoExpiration date.
notesstringnoInternal notes.
itemsarray<object>noProposal items. Minimum 1.
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoCustom fields (validated against the organization's schema).

More fields and nested objects: kobana schema billing.proposals.create.

Responses

HTTPDescription
201Proposal created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals update​

Upsert proposal

kobana billing proposals update [OPTIONS]

PUT /v1/proposals

Takes the same body as POST, plus id and public_id, and dedups on id, public_id, external_id and the resource's natural keys, in that order, stopping at the first key that finds a record. A match is updated and returns 200; otherwise the record is created and returns 201. The POST's required fields are required only when no record is found, and updates are partial: absent fields keep their stored value.

Request body

NameTypeRequiredDescription
company_idstring (uuid)noIssuing company UUID. Use null to clear.
titlestringnoProposal title. Default: "Proposta Comercial".
descriptionstringnoFree-form proposal description.
billing_account_idstring (uuid)noTarget billing account UUID (existing customer). Required if prospect_id and prospect_data are not provided.
prospect_idstring (uuid)noUUID of an existing prospect. Alternative to billing_account_id/prospect_data.
contact_idstring (uuid)noUUID of an existing contact linked to the prospect.
prospect_dataobjectnoData to create a prospect inline (juridical person). Alternative to prospect_id/billing_account_id.
contact_dataobjectnoData to create a contact inline (natural person in charge).
coupon_idstring (uuid)noCoupon UUID to apply.
template_idstring (uuid)noTemplate UUID for PDF generation.
discount_percentnumbernoNegotiated discount percent (0–100), applied to the monthly amount; the cycle discount applies over the discounted value. Do not send together with discount_amount.
discount_amountnumbernoNegotiated fixed per-month discount in BRL (float, up to 4 decimal places), applied to the monthly amount; the cycle discount applies over the discounted value. Do not send together with discount_percent.
commitment_monthsintegernoCommitment period in months (1–120). Use null to clear. Copied to the subscription when the proposal is accepted.
expires_atstringnoExpiration date.
notesstringnoInternal notes.
itemsarray<object>noProposal items. Minimum 1.
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoCustom fields (validated against the organization's schema).
idstring (uuid)noRecord UUID. Used only to locate it β€” never written.
public_idstring (uuid)noPublic UUID of the record, used to locate it.

More fields and nested objects: kobana schema billing.proposals.update.

Responses

HTTPDescription
200Record updated.
201Record created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals bulk-cancel​

Bulk cancel proposals

kobana billing proposals bulk-cancel [OPTIONS]

POST /v1/proposals/bulk-cancel

Cancels multiple proposals at once (up to 100). Returns success/failure counts and errors per id.

Request body

NameTypeRequiredDescription
idsarray<string (uuid)>yesList of target proposal UUIDs. Minimum 1, maximum 100.

More fields and nested objects: kobana schema billing.proposals.bulk-cancel.

Responses

HTTPDescription
200Bulk cancel result.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals bulk-send​

Bulk send proposals

kobana billing proposals bulk-send [OPTIONS]

POST /v1/proposals/bulk-send

Sends multiple proposals at once (up to 100). Returns success/failure counts and errors per id.

Request body

NameTypeRequiredDescription
idsarray<string (uuid)>yesList of target proposal UUIDs. Minimum 1, maximum 100.

More fields and nested objects: kobana schema billing.proposals.bulk-send.

Responses

HTTPDescription
200Bulk send result.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals get​

Get proposal

kobana billing proposals get [ID] [OPTIONS]

GET /v1/proposals/{id}

Path arguments: id

Responses

HTTPDescription
200Proposal detail.
404Resource not found in the current organization.

proposals delete​

Delete proposal

kobana billing proposals delete [ID] [OPTIONS]

DELETE /v1/proposals/{id}

Path arguments: id

Responses

HTTPDescription
200Proposal deleted.
404Resource not found in the current organization.

proposals accept​

Accept proposal

kobana billing proposals accept [ID] [OPTIONS]

POST /v1/proposals/{id}/accept

Accepts the proposal and creates (or confirms) the corresponding subscription using the given cycle.

Path arguments: id

Request body

NameTypeRequiredDescription
cyclestringyesBilling cycle of the subscription created on acceptance: monthly, quarterly, semiannual or annual. Values: monthly, quarterly, semiannual, annual.

More fields and nested objects: kobana schema billing.proposals.accept.

Responses

HTTPDescription
200Proposal accepted β€” returns the proposal, subscription_id and invoice_id when applicable.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals cancel​

Cancel proposal

kobana billing proposals cancel [ID] [OPTIONS]

POST /v1/proposals/{id}/cancel

Cancels the proposal (status β†’ canceled).

Path arguments: id

Responses

HTTPDescription
200Proposal canceled.
404Resource not found in the current organization.

proposals duplicate​

Duplicate proposal

kobana billing proposals duplicate [ID] [OPTIONS]

POST /v1/proposals/{id}/duplicate

Creates a new proposal from the original (as draft), preserving items and configuration.

Path arguments: id

Responses

HTTPDescription
201Proposal duplicated.
404Resource not found in the current organization.

proposals generate-pdf​

Generate proposal PDF

kobana billing proposals generate-pdf [ID] [OPTIONS]

POST /v1/proposals/{id}/generate-pdf

Generates (or regenerates) the proposal PDF via Google App Scripts. Requires a template with app_script_url configured.

Path arguments: id

Responses

HTTPDescription
200PDF generated β€” returns the updated proposal and document/PDF URLs.
404Resource not found in the current organization.
422Request body failed validation.

proposals json​

Get proposal JSON snapshot

kobana billing proposals json [ID] [OPTIONS]

GET /v1/proposals/{id}/json

Returns the full data snapshot used to render the PDF template (mirrors what AppScript receives).

Path arguments: id

Responses

HTTPDescription
200Proposal JSON snapshot.
404Resource not found in the current organization.

proposals pricing​

Get proposal pricing breakdown

kobana billing proposals pricing [ID] [OPTIONS]

GET /v1/proposals/{id}/pricing

Returns the pricing breakdown per billing cycle (monthly, quarterly, semiannual, annual), with setup and discounts applied.

Path arguments: id

Responses

HTTPDescription
200Pricing breakdown.
404Resource not found in the current organization.

proposals publish​

Publish proposal

kobana billing proposals publish [ID] [OPTIONS]

POST /v1/proposals/{id}/publish

Publishes the proposal (draft β†’ sent) without sending the email, making it available on the portal.

Path arguments: id

Responses

HTTPDescription
200Proposal published.
404Resource not found in the current organization.
422Request body failed validation.

proposals send​

Send proposal email

kobana billing proposals send [ID] [OPTIONS]

POST /v1/proposals/{id}/send

Sends (or resends) the proposal email to the recipient. Allowed statuses: draft, sent or viewed. Optionally customize subject and message (HTML).

Path arguments: id

Request body

NameTypeRequiredDescription
subjectstringnoCustom email subject. Default: Proposta {code}.
messagestringnoCustom HTML message for the email body.

More fields and nested objects: kobana schema billing.proposals.send.

Responses

HTTPDescription
200Proposal sent.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

proposals undo-accept​

Undo proposal acceptance

kobana billing proposals undo-accept [ID] [OPTIONS]

POST /v1/proposals/{id}/undo-accept

Reverts the acceptance: removes the linked subscription and returns status to sent.

Path arguments: id

Responses

HTTPDescription
200Acceptance undone.
404Resource not found in the current organization.

proposals unpublish​

Unpublish proposal

kobana billing proposals unpublish [ID] [OPTIONS]

POST /v1/proposals/{id}/unpublish

Reverts the proposal to draft (sent/viewed β†’ draft).

Path arguments: id

Responses

HTTPDescription
200Proposal unpublished.
404Resource not found in the current organization.
422Request body failed validation.