Creating and Managing CPNs (Customer Part Numbers)

A Customer Part Number can be used across designs to reference a shared Approved Manufacturer or Approved Vendor List.

Approved Vendor Lists (AVLs) specify the allowed parts for a particular bill of materials entry. When a Customer Part Number is added to an AVL, that AVL will be shared across all PCB BoMs that reference that CPN. In this way, you can manage your internal part numbers and automatically populate your bills of materials across multiple designs, updating and removing candidates via a central method.

To manage your CPNs via the MacroFab API, you can use the following recipe:

  • Create a new CPN using the Create Customer Part Number endpoint, and providing the CPN you wish to use as the customer_part_number body parameter
    • Upon successful creation, the AVL object will be returned. The key approved_vendor_list_id in the returned object will need to be retained for the next steps
  • Find the Internal Part Number (IPN) for the part(s) that should be added to the AVL
    • Since manufacturer names and part numbers can change over time, the MacroFab API uses IPNs as a static reference ID for a manufacturer / MPN combination
    • Use the Search for Parts endpoint to find the parts that you wish to add, making a note of the value of the part_id field
    • Find the IPN for each part ID using the Get Internal Part Number endpoint
  • Using the approved_vendor_list_id returned from the previous call, submit a call to Add Part to Approved Vendor List endpoint with the IPN for each component you wish to add to the AVL represented by the CPN
  • The precedence of the items within the AVL can be altered using the Update Approved Vendor List Parts endpoint

These CPNs will be immediately available for use in the MacroFab platform.

Understanding the Precedence of AVLs

The Create Customer Part Number endpoint accepts a body parameter titled <precedence_preference>, this controls how the MacroFab purchasing system will choose parts from the AVL. If is chosen as the value, the MacroFab purchasing system will automatically choose the lowest cost member of the AVL with sufficient market availability to cover the current demand. If manual is chosen, parts will be purchased according the preference of the individual component in the AVL, only moving to the next if there is not enough availability to cover current demand.