Send an offer
Freezes the draft and emails the recipient a link to the offer with the PDF attached, plus a text message when `smsPhone` is set. The first send gives the offer its number, and sending a newer version supersedes the one sent before it. If the deal has no value yet, it takes the offer's net total. Sending a version that is already sent returns it unchanged. Refusals: - 400: the draft has no lines or more than 200, a line quantity or unit price is out of range, or the total is too large. - 400: `recipientEmail` differs from the email of the deal's contact and `divergenceAttested` is not true. - 503: the offer is sent but the email could not be delivered. Call retry-delivery.
Freezes the draft and emails the recipient a link to the offer with the PDF attached, plus a text message when smsPhone is set. The first send gives the offer its number, and sending a newer version supersedes the one sent before it. If the deal has no value yet, it takes the offer's net total. Sending a version that is already sent returns it unchanged.
Refusals:
- 400: the draft has no lines or more than 200, a line quantity or unit price is out of range, or the total is too large.
- 400:
recipientEmaildiffers from the email of the deal's contact anddivergenceAttestedis not true. - 503: the offer is sent but the email could not be delivered. Call retry-delivery.
Authorization
x-api-key Company API key, created under Settings > API Keys.
In: header
Path Parameters
The draft version id.
Header Parameters
Optional with an API key or OAuth token: leave it out and the company the key or token belongs to is used. If sent, it must be that same company, otherwise the request is refused with 403 API_KEY_WRONG_COMPANY or OAUTH_WRONG_COMPANY.
^[0-9a-fA-F]{24}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/crm/offers/string/send" \ -H "Content-Type: application/json" \ -d '{ "recipientEmail": "[email protected]", "recipientType": "BUSINESS", "surfaceLang": "EN" }'{ "acceptanceDepth": "CLICK", "acceptanceWithdrawnAt": "2019-08-24T14:15:22Z", "authLevel": "LINK_POSSESSION", "dealId": "string", "decidedAt": "2019-08-24T14:15:22Z", "divergenceAttested": true, "firstViewedAt": "2019-08-24T14:15:22Z", "id": "string", "introMessage": "string", "isReadOnly": true, "lines": [ { "catalogItemId": "string", "description": "string", "discountPct": 0, "proposalId": "string", "proposalWorkKey": "string", "qty": 0, "source": "string", "unit": "string", "unitPriceOre": 0, "vatRate": 0 } ], "money": { "incVatOre": 0, "netOre": 0, "vatOre": 0 }, "number": 0, "pdfSizeBytes": 0, "personalMessage": "string", "recipientDiverged": true, "recipientEmail": "string", "recipientName": "string", "recipientPhone": "string", "recipientType": "BUSINESS", "sealState": "FAILED", "sender": { "addressLines": [ "string" ], "companyName": "string", "email": "string", "logoUrl": "string", "orgNumber": "string", "phone": "string" }, "sentAt": "2019-08-24T14:15:22Z", "siblings": [ { "acceptanceDepth": "CLICK", "acceptanceWithdrawnAt": "2019-08-24T14:15:22Z", "authLevel": "LINK_POSSESSION", "decidedAt": "2019-08-24T14:15:22Z", "id": "string", "money": { "incVatOre": 0, "netOre": 0, "vatOre": 0 }, "recipientType": "BUSINESS", "sentAt": "2019-08-24T14:15:22Z", "status": "ACCEPTED", "version": 0 } ], "status": "ACCEPTED", "surfaceLang": "EN", "terms": "string", "threadId": "string", "title": "string", "trail": [ { "actorName": "string", "at": "2019-08-24T14:15:22Z", "id": "string", "ip": "string", "kind": "ACCEPTED", "payload": { "authLevel": "string", "channels": [ "string" ], "comment": "string", "depth": "string", "diverged": true, "documentSha256": "string", "name": "string", "note": "string", "number": 0, "reason": "string", "recipientEmail": "string", "sealLogSeq": 0, "sealedSha256": "string", "signatureMode": "string", "version": 0, "property1": null, "property2": null }, "source": "INTERNAL", "userAgent": "string" } ], "validUntil": "2019-08-24T14:15:22Z", "version": 0}Retry sealing an accepted offer POST
Queues sealing again for an offer accepted with a signature, after `sealState` came back `FAILED`. Sealing produces the tamper-evident PDF and the certificate of completion. An offer that is already sealed is returned unchanged. An offer that is not accepted, or was accepted with a click, returns 409.
Update an offer draft PATCH
Changes the draft. Only the fields you send change, and `lines` replaces every line. More than 200 lines returns 400. A version that is no longer a draft returns 409; start a new version to change a sent offer.