This walks through one deal in the sandbox. By the end you will have created a draft quote, read it back, sent it to the customer, opened it as the customer, and received and verified the webhooks that follow.
You need:
- a sign-in to the programme's sandbox as the vendor's finance team, the people who manage API keys;
curl, Node 18 or later, or Python 3 withrequests;- for step 7, a receiver on a public
httpsaddress. Steps 1 to 6 need none.
<sandbox host> is given to you when your programme is set up. Nothing done in the sandbox charges anyone, emails a real customer or calls your systems; see Sandbox and testing.
1. Get a sandbox key
- Sign in at
https://<sandbox host>as the vendor's finance sign-in. The sandbox's sign-in page lists who you can be. - Open API & webhooks and choose Create a key. Name it (for example "Quickstart"), keep both See quotes and Make and send quotes, and choose Create the key.
- Copy the key now. It is shown once.
Check that it works:
A 401 means the key was mistyped, revoked, or made in the other environment. See Authentication and keys.
2. Point a webhook at the echo receiver
On the same page, choose Add a webhook. For the first run, point it at the sandbox's own receiver, which checks every signature the way yours will:
Choose Every deal update, then Add the webhook. The page shows the endpoint's signing secret (whsec_…) once. You do not need this one: the echo receiver knows it.
3. Create a quote
Save the request body as quote.json. Replace the product code and the configuration fields with your programme's: the ones here are the video-security illustration used throughout these docs.
opportunityUrlis required: a Salesforce opportunity link. If the programme accepts links from its own Salesforce org only, use one on it. See Connecting a CRM.- Send the customer's full address. Where the programme calculates sales tax, a quote without one cannot be sent.
- Add
ownerEmailwith an account executive's sign-in email to give the deal an owner.
Then create it. Every POST carries a new Idempotency-Key:
The answer is 201 with the draft quote, priced from the programme's catalogue:
needsReviewlists lines whose code matched nothing in the catalogue. The quote is created with the rest, and stays a draft until someone resolves them in the platform. Use a code the catalogue knows to carry on.warningslists what a person should check, such as anownerEmailthat is not an active sales user, or an agreed price that was not applied.- Retrying is safe. Send the same body again with the same
Idempotency-Key, and you get this same quote back withIdempotent-Replayed: true. See Idempotency.
Every field is on Quotes.
4. Read it back
The same quote, as it stands now. GET /quotes/quo_…/pdf returns the proposal the customer will see, as a PDF.
5. Send it
In the sandbox the proposal email goes to the sandbox's test inbox, not to the contact. A 409 means lines still need review.
6. Open it as the customer
Open quoteUrl in a private browser window, signed out. Opening it marks the quote viewed and sends quote.viewed.
On API & webhooks, open the echo endpoint: the delivery shows as delivered, because the echo receiver checked its signature and answered 200. The body it was sent looks like this:
Leave the proposal open: you accept it in step 8.
7. Receive and verify on your own endpoint
Your receiver must read the raw body, verify the signature, answer 2xx within 10 seconds, and de-duplicate on the event id. The verify function is on Verifying the signature.
Run it on a public https address. The sandbox, like production, refuses http, localhost and private addresses; for a receiver on your own machine, use a tunnel that gives it a public https address.
Then, on API & webhooks, choose Add a webhook again, with your receiver's address and Every deal update. Copy its signing secret, shown once, into BYRECORD_WEBHOOK_SECRET, and start the receiver. Each endpoint has its own secret.
8. Accept the quote
In the proposal window, accept the quote. Acceptance generates the agreement and sends quote.accepted to both endpoints. Your receiver prints:
and both deliveries show as delivered on API & webhooks. If yours shows as failed, the recorded error says why in a few words: "Answered 400" is a signature your receiver did not accept, usually a parsed and re-serialised body or the wrong secret.
Next
- Sign the agreement (
contract.signed) and save a test card on the next page (payment_method.saved). The test details, and how to take a deal through installation and billing, are on Sandbox and testing. - Every event and its fields: Webhook events.
- Creating quotes from opportunities and writing progress back: Connecting a CRM.