Tips on address & pricing validation, job creation and customer payment

Hello,

I’m currently looking into implementing Stuart, into our systems. I really like it, everything seems relly great and all (the docs is really clear and easy to use). But I have a few questions :

  1. When calling validate address (/v2/addresses/validate), with aproximative adresse, we are asked to input a phone number. Unfortunately, our customers will pick the delivery point via a map, and if it is an approximate address, we will need to pass a phone number. I understood that the phone number is requiered when creating the job, but is it requiered when we juste want to validate an adresse ?

  2. An approximate address, is something like ‘Avenue Jean Jaurès, 75019 Paris’ while ‘114 Avenue Jean Jaurès, 75019 Paris’ is a Precise address ?

  3. On our websites, the customers will :

  • create his order (we will call stuart api beforehand to check that the adresse and everything is ok for the delivery)
  • pay his order

Once the order is paid (we received a notification about the payment) we will create our Job using the Stuart API. But unfortunately, there can be some times between the moment ou client create the order and the moment the order is paid. How can we be sure that, the Job will be accepted ? And that the delivery cost would still be the same amount as when we created theJob.

Is it possible to create a Job, in a kind of pending status ? We would create the Job at the order creation and change the Job status once we have the confirmation of payment.

Not sure if what I said was clear enough to be understood.

Thanks

Hello @yunai39,

We’re happy to hear you’re interested in integrating our API, thank you for using our community forum to ask your related questions, we’re happy to help answering these.

  1. Yes that’s correct, if the address is approximate you’ll require a valid phone number to get the ‘success’ response. This helps to align your address validation with the job creation validation. If you don’t have the end customer phone number at this phase, perhaps you could use a valid default number.

  2. Typically yes, full addresses including a house number are usually precise. However results can vary depending of the accuracy result from Google geocoding service.

  3. You can use our request job pricing endpoint with the same payload as the job creation to get the price of the job. Since this is based on the distance and package type this should match the final price of the job.

Once the job is created it will be carried out based on the time it was scheduled for. So you might want to schedule the order for some time in the future and cancel before this time if the payment falls through.

Hopefully this answers your queries, let us know if anything is unclear.

Best,

Thanks for your answers

  1. Yes I was thinking of using our store phone number while trying to validate the addresse
  2. We are using google or photon but get something alike
  3. I think we will create the job, once we create the order, and if the order is not paid after a certains amount of time, we will cancel the order.

Perfect!

Don’t hesitate to reach out if you have any other questions in the future :slight_smile: