Create Pipedrive deals from orders
Lesson 29 of 30 8 min read
Place each order's deal in the right pipeline and stage, link it to the right organisation and contact, and fill custom fields, products and a link back to the source record.
With Pipedrive, Supply Lens writes to the CRM. When an order (or a quote) is created in the back office, typically Unleashed, Supply Lens creates a Pipedrive deal for it, linked to the right organisation and person, with the details sales care about. This lesson covers creating the deal. The next covers what happens as the order progresses.
By the end of this lesson you'll be able to configure where Pipedrive deals land, how customers are found, and what data goes on the deal.
Where does the deal go?
| tagToPipelineIdMap | Maps order tags to a Pipedrive pipeline ID. First matching tag wins; a default catches the rest. |
|---|---|
| tagToStageIdMap | Maps order tags to a stage ID within the pipeline. First matching tag wins; a default catches the rest. |
These are tag maps, exactly as in the patterns module. Always set defaults, so every deal lands somewhere.
Which organisation and person?
| customerFieldIdentifiers | Maps customer identifier types to Pipedrive person or organisation field names, so the deal is linked to the right customer. |
|---|---|
| useNewestMatchingOrganisation | Default false. When several organisations match, the deal fails, because they're duplicates. When true, the newest (highest ID) is used and a warning lists every match for merging. |
| deliveryContactPerson | Finds or creates the order's delivery contact as a Pipedrive person and links them to the deal. Orders only, because Unleashed's API doesn't expose a quote's delivery contact. |
Duplicates stop deals
By default a customer that matches more than one Pipedrive organisation fails the deal. That's
deliberate. Fix the duplicates in Pipedrive, or turn on useNewestMatchingOrganisation and work
through the warnings.
How the delivery contact is matched
deliveryContactPerson has three parts: enabled (off by default), an optional contactIdField
(a person custom field holding the source system's contact ID) and contactIdTag (the tag holding
that ID, by default unleashed:delivery_contact_guid, which the Unleashed order import adds).
A matched person gets the contact's name, and the contact's email and phone as their primary ones. Their other emails, phones and fields are left alone. If finding or creating the person fails, it's logged and the deal is created without one.
What goes on the deal?
| includeProductsOnDeal | When true, the order's product lines are added to the deal. When false or unset, only the deal is created. |
|---|---|
| customFieldMapping | Maps document fields (each identified by a CustomFieldType) to Pipedrive custom field API keys, so order data fills deal custom fields. |
| customFieldDateFormat | The date format for dates written to custom fields, in .NET format syntax, for example yyyy-MM-dd. |
| profitMarginDecimalPlaces | The decimal places used when writing profit margin to a custom field. |
| recordUrlFormat / recordUrlField | A link to the record in the source system, written to the deal custom field named in recordUrlField. The number 0 in braces stands for the record's number. |
For Unleashed, the link uses the record's number (not its ID) and starts with the account's region, for example:
https://au.unleashedsoftware.com/v2/SalesOrder/Update/{0}
and .../SalesQuote/Update/{0} on the quote settings.
Fern & Finch's sales visibility
Fern & Finch's account managers live in Pipedrive; orders are entered in Unleashed.
tagToPipelineIdMapdefaults to the "Orders" pipeline;tagToStageIdMapdefaults to "New".customerFieldIdentifiersmaps the Unleashed customer code to a Pipedrive organisation field that holds it.deliveryContactPersonis enabled withcontactIdFieldpointing at a person field called "Unleashed contact ID", so contacts are matched reliably on later orders.includeProductsOnDealis on;customFieldMappingwrites the required date to a custom field withcustomFieldDateFormatdd/MM/yyyy.recordUrlFormatuses the Unleashed URL for the account's region, so each deal links straight to its sales order.
Recap
- Pipedrive receives orders and quotes as deals.
- Tag maps choose the pipeline and stage; always set defaults.
- Organisations are matched by
customerFieldIdentifiers; duplicates fail the deal unlessuseNewestMatchingOrganisationis on. deliveryContactPersonmatches by contact ID, then email, then name, and links nobody when a step finds several.- Products, custom fields and a link back to the source record can all go on the deal.
Quick guides for this topic
Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.