Every quote made through the partner API belongs to a CRM opportunity. Salesforce is the supported format: your integration sends the opportunity's link with the quote, every quote and every webhook carries it back, and quotes can be looked up by it.
Opportunity links
opportunityUrl is required on POST /quotes. It must be a Salesforce opportunity link:
https, on a Salesforce host:*.lightning.force.com,*.my.salesforce.comor*.salesforce.com. A programme may accept links from its own Salesforce org only.- In Lightning form (
/lightning/r/Opportunity/006…/view) or Classic form (/006…). - Naming an opportunity record: a 15- or 18-character id starting
006. A link to a lead, an account or a report is refused with400.
The platform matches on the opportunity id, not the URL: on its first 15 characters, which are the same in the 15- and 18-character forms. Quotes and webhooks carry both the link as you sent it and that id:
A worked flow
- The opportunity is ready to quote. Your integration builds the request from it (below), generates an
Idempotency-Key, stores the key on the opportunity, then callsPOST /quotes. - Store what comes back on the opportunity: the quote's
id(quo_…) andnumber, and on the CRM account, the account'sid(acc_…). ShowneedsReviewandwarningsto the account executive: a quote with lines needing review cannot be sent until someone resolves them in the platform. - Send it with
POST /quotes/:id/sendwhen it is right. The account executive can send it from the platform or the Slack app instead. - Follow it from webhooks, writing each moment back to the opportunity (below).
- Reconcile from time to time with
GET /quotes?opportunityUrl=, which also finds quotes made for the opportunity in the platform or from Slack.
Building the request from the opportunity
A typical mapping:
| Request field | From |
|---|---|
opportunityUrl | The opportunity's own link. Required |
ownerEmail | The opportunity owner's email. They must be an active sales user in the platform; if not, the quote is created unowned and warnings says so |
customer.accountId | The acc_… stored on the CRM account from an earlier quote, to quote an existing customer |
customer.name, legalName, email, phone, address | The CRM account, for a new customer. Send the full service address: where the programme calculates sales tax, a quote without one cannot be sent |
customer.contact | The person who receives the proposal and signs, such as the opportunity's primary contact. Required |
currency | The opportunity's currency: usd or cad |
lines | The opportunity's products, each by your product code as supplierCode, with its quantity |
termMonths, billingStarts, startDate | The deal's terms, if your opportunity records them |
| Configuration fields | Whatever the programme's catalogue prices its subscription by |
Every field is on Quotes.
- Send codes and quantities, not prices. Every line is priced from the programme's catalogue. The one price a request can carry,
agreedUnitPrice, can only lower a recurring line. - Reuse the account. There is no API to list or search accounts. The
acc_…comes back on every quote (account.id) and every webhook (data.accountId): store it on the CRM account the first time, and send it ascustomer.accountIdfor the customer's next quote.
Retries and idempotency
A CRM's outbound calls are retried: after a timeout, a worker restart, a second click. Make each one safe to repeat.
- One key per intended quote. Generate the
Idempotency-Keyonce, when the integration decides to create the quote, and store it on the opportunity before the first call. Every retry sends the same key with the same body. - A retry gets the first answer. With the same key and body, the stored answer comes back with
Idempotent-Replayed: true. Once a quote exists, a retry answers201with that quote, never a second one. - Do not derive the key from the opportunity alone. A second, deliberate quote for the same opportunity would then replay the first answer, or be refused with
422if its body differs. Each new quote gets a new key. - A key lasts seven days. For a retry later than that, look first:
GET /quotes?opportunityUrl=shows whether the quote was made. 409means the first request with that key is still being processed. Wait, then retry with the same key.- Send takes a key too. A retried
POST /quotes/:id/sendwith the same key replays the first answer rather than emailing the customer again.
See Idempotency for exactly what is stored and replayed.
Finding an opportunity's quotes
- The answer is
{ "data": [ … ] }, newest first, each a full quote. - Matched on the opportunity id, so a Classic link finds quotes created from a Lightning one.
limitis 50 by default, and at most 200.- An opportunity can have several quotes: a deal quoted again, or re-quoted after one expired. A quote can also have several versions:
versiongoes up when a sent quote is revised in the platform, and the customer's link always opens the latest.
Writing progress back
Every webhook carries the deal's opportunity, so writing back needs no lookup on our side.
- Verify the signature and answer
2xxwithin 10 seconds. Update the CRM after answering, not before. - De-duplicate on the event
id. - Find the opportunity by
data.opportunityId, or by thedata.quoteIdyou stored. - Apply the moment. A typical mapping:
| Event | On the opportunity |
|---|---|
quote.viewed | The proposal was opened. Sent once per quote version |
quote.accepted | Accepted, by acceptedName (acceptedEmail). Store data.contractId |
contract.signed | The agreement is signed |
payment_method.saved | A payment method is on file |
installation.recorded | Installed, with service from serviceStartDate |
billing.live | Billing: the first invoice went out |
- Never move an opportunity backwards. Deliveries can arrive out of order: order the moments by each event's
createdAt, and keep the furthest one reached.
Service events (service.suspended, service.restored, service.reversed) are about the customer's service, not one deal, and can happen many times. Record them on the CRM account found by data.accountId, once per data.occurrenceId. See Service events.
Every event's fields, and more on handling them, are on Webhook events.
Verifying in Apex
If your receiver runs in Salesforce, the same check is a few lines of Apex. t and v1 come from the X-ByRecord-Signature header, and rawBody is the request body exactly as received:
Accept the delivery only when both hold. The full method is on Verifying the signature.
Keys for a CRM
- A key of its own. Create one key for the integration, named for it, with See quotes and Make and send quotes. A reporting job that only reads gets its own key with See quotes alone. Keys are made on API & webhooks by the vendor's finance team or ByRecord's admins; see Authentication and keys.
- 60 requests a minute per key. A reconcile over many opportunities should pace itself; see Rate limits.
- Build it in the sandbox first. Sandbox keys and endpoints are separate from production's; see Sandbox and testing.