Skip to content

Commit 4a8e550

Browse files
author
=
committed
Added request flow section
1 parent 6828157 commit 4a8e550

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ npm install @swiftcomplete/address-autocomplete
2222

2323
Each request needs to be authenticated with an API key, which you can obtain by **[creating a Swiftcomplete account](https://www.swiftcomplete.com/account/register/)**.
2424

25+
## Request flow
26+
27+
Each session should call *autocomplete()* for each keystroke to obtain a list of suggestions, and **must finish** by calling *populateResult(index, suggestions)* to select an address.
28+
29+
The only occasion a session should end without calling *populateResult()* is if you can't find your address.
30+
31+
If you build your integration incorrectly without calling *populateResult()*, your account will be billed per keystroke which is far less cost effective.
32+
2533
## Example: Search for an address
2634

2735
```js

0 commit comments

Comments
 (0)