Factuarea APIDevelopers
Added

Promotions and previous price

Put products and packs on offer with dates and channels. Reads expose the offer and the legal previous price, and price resolution takes a date, a channel and the customer of the web.

Promotions are now part of the public contract. They are available on every plan that includes products, from Esencial.

  • A new promotions resource creates offers with items, dates and channels (documents and web), with their own scopes promotions:read, promotions:write and promotions:delete.
  • Reading products and packs always includes promotion (the offer or null) with label, previous_price, reduction_percent and announce_reduction.
  • price-lists/resolve and price-lists/resolve-many take date, channel and client_id. The price list is chosen as in a document: a price_list_id wins (null means no price list), otherwise the default price list of the customer applies, and an inactive one answers 422.
  • Every resolved price carries regular_unit_price, regular_source and promotion (null when none applies). The gross amounts use the VAT of the item and the regime of the company. For the exact amount, including the customer's equivalence surcharge or exemption, use the totals calculation.
  • The price breakdown of a pack takes client_id and channel, and returns the offer of the pack with its regular price.
  • Price lists and their prices accept the updated[gte] and updated[lte] filters. The updated_at of a price list also moves when one of its prices changes.
  • Document lines take sold_on and channel, so that an offer only for the web reaches the invoice of the order. A web sale charged at the offer price counts as sold with the offer.
  • PDF templates add the option show_regular_price, which prints the regular price and the rebate under the concept of a line sold with an offer.

Read Promotions and previous price and Your store with Factuarea.

Events

EventChange
promotion.created, promotion.updated, promotion.started, promotion.ended and promotion.cancelledNew, with the promotion
promotion.deletedNew, with {id, object: "promotion", deleted: true}
price_list.created, price_list.updated and price_list.item_updatedNew, with the price list or the price. Use them to refresh a cache of prices
price_list.deleted and price_list.item_deletedNew, with {id, object, deleted: true}. The price carries its price_list_id
product.updated and pack.updatedAlso when an offer starts or ends

New errors: promotion_not_found, promotion_started, promotion_read_only, invalid_promotion_item and duplicate_promotion_item. The MCP server adds list_promotions, get_promotion, create_promotion, update_promotion, cancel_promotion and delete_promotion, and resolve_catalog_price and resolve_many_catalog_prices take client_id.

New endpoints6

EndpointDescription
GET/v1/companies/{company}/promotionsList all promotions
POST/v1/companies/{company}/promotionsCreate a promotion
GET/v1/companies/{company}/promotions/{promotion}Retrieve a promotion
PATCH/v1/companies/{company}/promotions/{promotion}Update a promotion
DEL/v1/companies/{company}/promotions/{promotion}Delete a promotion
POST/v1/companies/{company}/promotions/{promotion}/cancelCancel a promotion

Updated endpoints67

EndpointDescription
POST/v1/companies/{company}/pdf-templates/{template}/archiveArchive a PDF template
POST/v1/companies/{company}/invoices/bulk-createBulk create invoices
POST/v1/accounts/{account}/webhooksCreate an account webhook endpoint
POST/v1/accounts/{account}/api-keysCreate an API key
POST/v1/companies/{company}/delivery-notesCreate a delivery note
POST/v1/companies/{company}/invoicesCreate an invoice
POST/v1/companies/{company}/pdf-template-previewsCreate a PDF template preview
POST/v1/companies/{company}/price-listsCreate a price list
GET/v1/companies/{company}/price-listsList price lists
POST/v1/companies/{company}/productsCreate a product
GET/v1/companies/{company}/productsList all products
POST/v1/companies/{company}/products/{product}/presentationsCreate a product presentation
GET/v1/companies/{company}/products/{product}/presentationsList product presentations
POST/v1/companies/{company}/products/{product}/variantsCreate a product variant
GET/v1/companies/{company}/products/{product}/variantsList product variants
POST/v1/companies/{company}/proformasCreate a proforma
POST/v1/companies/{company}/purchase-invoicesCreate an expense
POST/v1/companies/{company}/quotesCreate a quote
POST/v1/companies/{company}/recurring-invoicesCreate a recurring invoice
POST/v1/companies/{company}/pdf-templatesCreate a PDF template
GET/v1/companies/{company}/pdf-templatesList PDF templates
POST/v1/companies/{company}/webhook-endpointsCreate a webhook endpoint
GET/v1/companies/{company}/webhook-endpointsList all webhook endpoints
PATCH/v1/accounts/{account}/webhooks/{webhook}Update an account webhook endpoint
PATCH/v1/companies/{company}/delivery-notes/{delivery_note}Update a delivery note
PATCH/v1/companies/{company}/invoices/{invoice}Update an invoice
GET/v1/companies/{company}/price-lists/{priceList}Retrieve a price list
PATCH/v1/companies/{company}/price-lists/{priceList}Update a price list
GET/v1/companies/{company}/products/{product}Retrieve a product
PATCH/v1/companies/{company}/products/{product}Update a product
PATCH/v1/companies/{company}/products/{product}/presentations/{presentation}Update a product presentation
PATCH/v1/companies/{company}/products/{product}/variants/{variant}Update a product variant
POST/v1/companies/{company}/products/{product}/videoUpload a video to a product
PATCH/v1/companies/{company}/proformas/{proforma}Update a proforma
PATCH/v1/companies/{company}/purchase-invoices/{purchase_invoice}Update an expense
PATCH/v1/companies/{company}/quotes/{quote}Update a quote
PATCH/v1/companies/{company}/recurring-invoices/{recurring_invoice}Update a recurring invoice
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}Retrieve a webhook endpoint
PATCH/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}Update a webhook endpoint
POST/v1/companies/{company}/pdf-templates/{template}/duplicateDuplicate a PDF template
POST/v1/companies/{company}/products/find-by-external-idFind a product by external ID
POST/v1/companies/{company}/products/find-by-skuFind a product by SKU
GET/v1/companies/{company}/pdf-templates/{template}Retrieve a PDF template
PATCH/v1/companies/{company}/pdf-templates/{template}Update PDF template metadata
GET/v1/companies/{company}/products/low-stock-reportList products below the stock threshold
GET/v1/companies/{company}/pdf-templates/{template}/revisions/{revision}Retrieve a PDF template revision
GET/v1/companies/{company}/eventsList all events
GET/v1/companies/{company}/price-lists/{priceList}/itemsList price list items
POST/v1/companies/{company}/price-lists/{priceList}/itemsUpsert a price list item
GET/v1/companies/{company}/price-lists/optionsList active price list options
GET/v1/companies/{company}/products/{product}/configurationsList product commercial combinations
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveriesList webhook deliveries
POST/v1/companies/{company}/pdf-templates/{template}/revisionsPublish a PDF template revision
POST/v1/companies/{company}/price-lists/{priceList}/items/{item}/reassignReassign a retired price list item
POST/v1/companies/{company}/products/{product}/base-unit-replacementReplace a product by changing its base unit
POST/v1/companies/{company}/price-lists/resolveResolve a catalog price
POST/v1/companies/{company}/products/{product}/resolve-selectionResolve a catalog selection
POST/v1/companies/{company}/price-lists/resolve-manyResolve many catalog prices
POST/v1/companies/{company}/pdf-templates/{template}/restoreRestore a PDF template
POST/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/rotate-secretRotate webhook secret
GET/v1/companies/{company}/products/searchSearch products
POST/v1/accounts/{account}/webhooks/{webhook}/testSend a test event to an account webhook endpoint
POST/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/test-eventSend a test event
GET/v1/companies/{company}/events/{event}Retrieve an event
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveries/{delivery}Retrieve webhook delivery
POST/v1/companies/{company}/products/{product}/toggle-activeToggle product active state
PATCH/v1/companies/{company}/products/{product}/stockUpdate product stock

On this page

Need a hand?Contact support