1. Ask the person
Create signup intent needsemail, company_name, revenue, invoices, and erp. Ask the person for any you don’t know, in their words, and map their answer to the allowed values. Don’t guess: the answers decide the next step, so a guess can send the person to the wrong place.
2. Send the request
Send a newIdempotency-Key for each person, and keep it until you have an answer.
201
3. Tell the person what happens next
Streamlined returns one of three outcomes:
A
choice answer looks like self_serve:
201
sales answer has only the outcome:
201
The signup link
signup_url works for one signup, until expires_at, 7 days after it was created. Once it has been used, or once it expires, it opens an empty signup page. If the person needs a fresh link, send a new request with a new Idempotency-Key.
You don’t need to check whether the person already has an account. The answer is the same either way, and if they already have an account, the signup page sends them to sign in.
Testing in Sandbox
Send the same request tohttps://api.staging.streamlinedpayments.com/api/v1/signup_intents. You get the same outcomes, and signup_url opens the Sandbox app. Sandbox never contacts the person: our team doesn’t email them, whatever the outcome.
Retries
- After a timeout or a
5xx: retry with the sameIdempotency-Key. A repeat with the same key and email, from the same IP address, within 24 hours returns the first answer and creates nothing. It returns that answer even if its link has since been used or has expired, so for a fresh link, use a new key. The IP address is part of the match so that only the caller that made the request gets its link back. If yours changed, you get a link of your own instead. - After a
409(request_in_flight): the first request for this email is still being processed. This can happen with or without a key. Wait a second, then retry with the same key. - Didn’t send a key? No problem. Wait a moment and try again. You’ll get a fresh link, and either one works.
- After a
429: wait the number of seconds inRetry-After, then retry with the same key.
outcome. After 15 minutes, a request is a new signup.
Errors
Every error body has a stableerror code and a message for people, like the rest of the API. Branch on error; don’t parse message.
Each item in a
422’s errors names the field and a code. The values you sent are never repeated back.
422