Understanding Deals and Orders

This document describes the relationship between Deals and Orders, and how to effectively use the API to gather both

In the MacroFab API, you'll find two object types related to the orders you may place with MacroFab, they are Deals and Orders.

Orders

Everything to be built by MacroFab is represented by an Order. Each Order can contain only one PCB design, one quantity, and one delivery date.

Deals

A Deal represents a custom-priced agreement to build a product that may consist of one or more PCBs, with one or more delivery dates for every included PCB. Deals are artifacts that indicate a custom quote was created for this product and used to generate the Order(s) to build them in the platform.

A Deal, then, is a container for one or more orders, which allows us to build more than one PCB (in the case of a complex product), or have more than one release (in the case of a quote to build the same product over time).

The relationship between Deals and Orders is shown below:

The Orders associated with a Deal represent a Release Schedule for the Deal. Each Order will contain the costs associated with that particular PCB's release and the identified quantity for the release of that PCB. Therefore, when looking at an individual Order in a Deal, you will see the applied costs for that particular Order. To gather total costs, you would use the Deal's values.

Understanding When to Gather Deals or Orders

Self-service, or Transactional, Orders which are placed through the MacroFab Platform will never have an associated deal, and may stand alone. If you received a custom quotation from our sales team, then there will be a matching Deal available via the API.

When retrieving Orders, each Order will have an optional attribute deal_id. If this attribute is present, it means it is a release within a Deal, and you should retrieve that Deal to get complete information such as pricing, and other related Orders.