Skip to main content

Keeping the catalog in sync

Your system is the source of truth for the drug list. Parchment holds a copy per organization. Sync by item, not by wiping the catalog: a wipe leaves the organization with no drugs until the re-create finishes, and it changes every custom_drug_id. Two ids are involved:
  • custom_product_id is yours. Send it on create. Parchment stores it as-is and never generates it.
  • custom_drug_id is Parchment’s. It is returned on create and used for update, delete, and prescription prefill.
1

Initial load

Create the catalog in one bulk call. Set custom_product_id on every item.
Store each created[].custom_drug_id against your custom_product_id.
2

Changed item

Send only the fields that changed.
3

Removed item

Idempotent. Deleting an id that is already gone returns 200.
4

New item

Bulk create with a one-element array. Store the returned custom_drug_id.

Recovering a lost mapping

If you no longer hold the custom_drug_id for an item, look it up by your own id.
custom_product_id is not checked for uniqueness. If you sent the same value twice, the filter returns both drugs.

Full replace

Use only when the mapping is lost or the catalog is small enough that a gap does not matter.
Every custom_drug_id changes. Any prefill links or stored mappings that use the old ids stop working.

Field rules

Notes

  • Organization-level endpoints require the token’s user to be an organization owner or admin.
  • Per-item update and delete use the update:custom_drug and delete:custom_drug scopes.
  • Prescribers keep personal drugs under the user-level endpoints. Those are never touched by the organization sync.