@addresszen/openapi 4.1.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/openapi.yaml CHANGED
@@ -1,6 +1,6 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
- version: 4.1.1
3
+ version: 4.3.0
4
4
  license:
5
5
  name: Copyright (C) IDDQD Limited - All Rights Reserved
6
6
  url: https://terms.addresszen.com
@@ -90,7 +90,7 @@ info:
90
90
 
91
91
  ## Metadata
92
92
 
93
- You can annotate requests that affect your balance with arbitrary metadata. We store it with your lookup history, and you can query it later via the API or the dashboard. We call the ability to label your requests [tagging](https://docs.addresszen.com/docs/guides/tags).
93
+ You can annotate requests that affect your balance with arbitrary metadata. We store it with your lookup history, and you can query it later via the API or the dashboard. We call the ability to label your requests [tagging](https://docs.addresszen.com/docs/guides/tag-and-track).
94
94
 
95
95
  ## Response Codes
96
96
 
@@ -137,15 +137,15 @@ tags:
137
137
  - name: suggestion
138
138
  x-displayName: Address Suggestion
139
139
  description: |
140
- Address Suggestions are simple, human readable representations of an address. This format is sufficient for a user to determine an address match in an address autocomplete interface. A second request must be made to the API to gather fully validated address.
140
+ Address Suggestions are simple, human-readable representations of an address. This format is sufficient for a user to determine an address match in an address autocomplete interface. A second request must be made to the API to gather a fully validated address.
141
141
 
142
142
  See our Address Search APIs for more information on address autocompletion.
143
143
 
144
144
  <SchemaDefinition schemaRef="#/components/schemas/AddressSuggestion" />
145
145
  - name: usps_native
146
- x-displayName: USPS Zip+4
146
+ x-displayName: USPS ZIP+4
147
147
  description: |
148
- Raw USPS Zip+4 record.
148
+ Raw USPS ZIP+4 record.
149
149
 
150
150
  <SchemaDefinition schemaRef="#/components/schemas/UspsAddress" />
151
151
  - name: ecaf_address
@@ -297,16 +297,22 @@ paths:
297
297
  - lang: JavaScript
298
298
  label: JavaScript
299
299
  source: |
300
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test');
300
+ import { createZenClient, keyAvailability } from '@addresszen/sdk';
301
301
 
302
- const { result } = await response.json();
302
+ const client = createZenClient({ apiKey: 'ak_test' });
303
+
304
+ const { data } = await keyAvailability({
305
+ client,
306
+ path: { key: 'ak_test' },
307
+ });
303
308
  - lang: Python
304
309
  label: Python
305
310
  source: |
306
- import requests
311
+ # pip install addresszen
312
+ from addresszen import AddressZen
307
313
 
308
- response = requests.get("https://api.addresszen.com/v1/keys/ak_test")
309
- result = response.json()["result"]
314
+ with AddressZen("ak_test") as client:
315
+ result = client.key_availability("ak_test")
310
316
  - lang: Ruby
311
317
  label: Ruby
312
318
  source: |
@@ -366,26 +372,22 @@ paths:
366
372
  - lang: JavaScript
367
373
  label: JavaScript
368
374
  source: |
369
- const response = await fetch(
370
- 'https://api.addresszen.com/v1/keys/ak_test/details?' +
371
- new URLSearchParams({
372
- user_token: 'uk_secret',
373
- })
374
- );
375
+ import { createZenClient, keyDetails } from '@addresszen/sdk';
375
376
 
376
- const { result } = await response.json();
377
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
378
+
379
+ const { data } = await keyDetails({
380
+ client,
381
+ path: { key: 'ak_test' },
382
+ });
377
383
  - lang: Python
378
384
  label: Python
379
385
  source: |
380
- import requests
386
+ # pip install addresszen
387
+ from addresszen import AddressZen
381
388
 
382
- response = requests.get(
383
- "https://api.addresszen.com/v1/keys/ak_test/details",
384
- params={
385
- "user_token": "uk_secret",
386
- },
387
- )
388
- result = response.json()["result"]
389
+ with AddressZen("ak_test") as client:
390
+ result = client.key_details("ak_test", user_token="uk_secret")
389
391
  - lang: Ruby
390
392
  label: Ruby
391
393
  source: |
@@ -410,7 +412,7 @@ paths:
410
412
  tags:
411
413
  - Keys
412
414
  summary: Update Details
413
- description: Updates a key's settings and returns its private details. Only the fields you send change. A key on an unlimited plan ignores changes to `datasets`, `daily_limit` and `monthly_limit`.
415
+ description: 'Updates a key''s settings and returns its private details. Only the fields you send change. A key on an unlimited plan ignores changes to `datasets`, `daily_limit` and `monthly_limit`. Datasets set by your plan cannot be changed here: sending one with a different value returns a 400.'
414
416
  operationId: UpdateKeyDetails
415
417
  security:
416
418
  - ManagementKey: []
@@ -450,7 +452,9 @@ paths:
450
452
  -H 'Content-Type: application/json' \
451
453
  -d '{
452
454
  "name": "My Updated Key",
453
- "daily_limit": 1000,
455
+ "daily_limit": {
456
+ "limit": 1000
457
+ },
454
458
  "notifications": {
455
459
  "enabled": true
456
460
  }
@@ -458,36 +462,37 @@ paths:
458
462
  - lang: JavaScript
459
463
  label: JavaScript
460
464
  source: |
461
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/details?user_token=uk_secret', {
462
- method: 'PUT',
463
- headers: { 'Content-Type': 'application/json' },
464
- body: JSON.stringify({
465
+ import { createZenClient, updateKeyDetails } from '@addresszen/sdk';
466
+
467
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
468
+
469
+ const { data } = await updateKeyDetails({
470
+ client,
471
+ path: { key: 'ak_test' },
472
+ body: {
465
473
  name: 'My Updated Key',
466
- daily_limit: 1000,
474
+ daily_limit: {
475
+ limit: 1000,
476
+ },
467
477
  notifications: {
468
478
  enabled: true,
469
479
  },
470
- }),
480
+ },
471
481
  });
472
-
473
- const { result } = await response.json();
474
482
  - lang: Python
475
483
  label: Python
476
484
  source: |
477
- import requests
478
-
479
- response = requests.put(
480
- "https://api.addresszen.com/v1/keys/ak_test/details",
481
- params={"user_token": "uk_secret"},
482
- json={
483
- "name": "My Updated Key",
484
- "daily_limit": 1000,
485
- "notifications": {
486
- "enabled": True,
487
- },
488
- },
489
- )
490
- result = response.json()["result"]
485
+ # pip install addresszen
486
+ from addresszen import AddressZen
487
+
488
+ with AddressZen("ak_test") as client:
489
+ result = client.update_key_details(
490
+ "ak_test",
491
+ user_token="uk_secret",
492
+ name="My Updated Key",
493
+ daily_limit={"limit": 1000},
494
+ notifications={"enabled": True},
495
+ )
491
496
  - lang: Ruby
492
497
  label: Ruby
493
498
  source: |
@@ -497,7 +502,9 @@ paths:
497
502
  uri = URI("https://api.addresszen.com/v1/keys/ak_test/details?user_token=uk_secret")
498
503
  body = {
499
504
  name: "My Updated Key",
500
- daily_limit: 1000,
505
+ daily_limit: {
506
+ limit: 1000,
507
+ },
501
508
  notifications: {
502
509
  enabled: true,
503
510
  },
@@ -514,7 +521,9 @@ paths:
514
521
  CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
515
522
  CURLOPT_POSTFIELDS => json_encode([
516
523
  "name" => "My Updated Key",
517
- "daily_limit" => 1000,
524
+ "daily_limit" => [
525
+ "limit" => 1000,
526
+ ],
518
527
  "notifications" => [
519
528
  "enabled" => true,
520
529
  ],
@@ -569,26 +578,22 @@ paths:
569
578
  - lang: JavaScript
570
579
  label: JavaScript
571
580
  source: |
572
- const response = await fetch(
573
- 'https://api.addresszen.com/v1/keys/ak_test/usage?' +
574
- new URLSearchParams({
575
- user_token: 'uk_secret',
576
- })
577
- );
581
+ import { createZenClient, keyUsage } from '@addresszen/sdk';
578
582
 
579
- const { result } = await response.json();
583
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
584
+
585
+ const { data } = await keyUsage({
586
+ client,
587
+ path: { key: 'ak_test' },
588
+ });
580
589
  - lang: Python
581
590
  label: Python
582
591
  source: |
583
- import requests
592
+ # pip install addresszen
593
+ from addresszen import AddressZen
584
594
 
585
- response = requests.get(
586
- "https://api.addresszen.com/v1/keys/ak_test/usage",
587
- params={
588
- "user_token": "uk_secret",
589
- },
590
- )
591
- result = response.json()["result"]
595
+ with AddressZen("ak_test") as client:
596
+ result = client.key_usage("ak_test", user_token="uk_secret")
592
597
  - lang: Ruby
593
598
  label: Ruby
594
599
  source: |
@@ -640,7 +645,7 @@ paths:
640
645
 
641
646
  ## Data redaction
642
647
 
643
- We redact personally identifiable data (PII) in your usage log weekly, covering the IP, source IP, search term and URL columns.
648
+ We redact personally identifiable information (PII) in your usage log weekly, covering the IP, source IP, search term and URL columns.
644
649
 
645
650
  The default retention is 28 days. Change the period from your dashboard. Set it to `0` days to stop collecting PII altogether.
646
651
  security:
@@ -683,26 +688,22 @@ paths:
683
688
  - lang: JavaScript
684
689
  label: JavaScript
685
690
  source: |
686
- const response = await fetch(
687
- 'https://api.addresszen.com/v1/keys/ak_test/lookups?' +
688
- new URLSearchParams({
689
- user_token: 'uk_secret',
690
- })
691
- );
691
+ import { createZenClient, keyLogs } from '@addresszen/sdk';
692
692
 
693
- const { result } = await response.json();
693
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
694
+
695
+ const { data: csv } = await keyLogs({
696
+ client,
697
+ path: { key: 'ak_test' },
698
+ });
694
699
  - lang: Python
695
700
  label: Python
696
701
  source: |
697
- import requests
702
+ # pip install addresszen
703
+ from addresszen import AddressZen
698
704
 
699
- response = requests.get(
700
- "https://api.addresszen.com/v1/keys/ak_test/lookups",
701
- params={
702
- "user_token": "uk_secret",
703
- },
704
- )
705
- result = response.json()["result"]
705
+ with AddressZen("ak_test") as client:
706
+ result = client.key_logs("ak_test", user_token="uk_secret")
706
707
  - lang: Ruby
707
708
  label: Ruby
708
709
  source: |
@@ -733,21 +734,26 @@ paths:
733
734
 
734
735
  Submit the whole address in `query`, or the first address line in `query` with either `zip_code`, or `city` and `state`. A freeform `query` is parsed into those components before the search runs.
735
736
 
736
- A match returns the standardized address lines, city, state and ZIP+4, scored by `fit` and `confidence`. It also carries the CASS record behind the match: delivery point, DPV flags, carrier route, eLOT, county, congressional district, RDI, time zone and coordinates. No match returns `200` with a `count` of `0`, a `null` `match` and empty address fields.
737
+ A match returns the standardized address lines, city, state and ZIP+4, scored by `fit` and `confidence`. It also carries the CASS record behind the match: delivery point, DPV flags, carrier route, eLOT, county, congressional district, RDI, time zone and coordinates. CASS corrects what it can, so an address with the wrong city or state for its ZIP code still verifies, with the corrected values.
738
+
739
+ An address that cannot be verified returns `200` with a `count` of `0`, a `null` `match` and empty address fields. `match_information` says why, e.g. `Address not found` or `House number not valid for this street`. It is for people to read and its wording may change, so test `match` for `null` rather than parsing it.
737
740
 
738
- Only a match draws on your balance. A key without address verification enabled returns `401`. A verification still running after 9.5 seconds aborts with `429`.
741
+ In the United States every verification the CASS engine answers draws on your balance, matched or not. A query that cannot be parsed into an address does not. Elsewhere only a match draws on your balance. A key without address verification enabled returns `401`. A verification still running after 9.5 seconds aborts with `429`.
739
742
 
740
743
  ## Countries
741
744
 
742
745
  Verify defaults to the United States, where it is CASS certified. Pass `context` with an ISO 3166-1 alpha-3 country code to verify an address elsewhere, e.g. `context=GBR` or `context=FRA`. The address datasets your key is licensed for decide which countries it can verify.
743
746
 
744
- Outside the United States there is no CASS record to return, so `match` carries the standardized address from that country's dataset instead. The top-level fields (`address_line_one`, `city`, `state`, `zip_code`, `country_iso_2`) are populated for every country, along with `confidence` and `fit`.
747
+ Outside the United States there is no CASS record, so `match` is the address in the same format Retrieve Address returns: USPS-style field names, empty strings where the country has no equivalent, and the raw dataset record in `native`. Check `dataset` to tell the two apart: it is present on every non-US match and absent from a CASS match.
748
+
749
+ The top-level fields (`address_line_one`, `address_line_two`, `city`, `state`, `zip_code`, `country_iso_2`) are populated for every country, along with `confidence` and `fit`.
745
750
  operationId: AddressVerify
746
751
  security:
747
752
  - ApiKey: []
748
753
  parameters:
749
754
  - $ref: '#/components/parameters/ApiKeyParam'
750
755
  - $ref: '#/components/parameters/TagsParam'
756
+ - $ref: '#/components/parameters/RemoveFirmParam'
751
757
  - name: context
752
758
  in: query
753
759
  schema:
@@ -790,7 +796,7 @@ paths:
790
796
  state:
791
797
  type: string
792
798
  description: |
793
- State of an address. For the US, use the 2 letter state abbreviation.
799
+ State of an address. For the US, use the 2-letter state abbreviation.
794
800
  example: CO
795
801
  responses:
796
802
  '200':
@@ -818,31 +824,24 @@ paths:
818
824
  - lang: JavaScript
819
825
  label: JavaScript
820
826
  source: |
821
- const response = await fetch('https://api.addresszen.com/v1/verify/addresses', {
822
- method: 'POST',
823
- headers: {
824
- 'Authorization': 'api_key="ak_test"',
825
- 'Content-Type': 'application/json',
826
- },
827
- body: JSON.stringify({
827
+ import { createZenClient, addressVerify } from '@addresszen/sdk';
828
+
829
+ const client = createZenClient({ apiKey: 'ak_test' });
830
+
831
+ const { data } = await addressVerify({
832
+ client,
833
+ body: {
828
834
  query: '123 Main St, Springfield, IL 62701',
829
- }),
835
+ },
830
836
  });
831
-
832
- const { result } = await response.json();
833
837
  - lang: Python
834
838
  label: Python
835
839
  source: |
836
- import requests
840
+ # pip install addresszen
841
+ from addresszen import AddressZen
837
842
 
838
- response = requests.post(
839
- "https://api.addresszen.com/v1/verify/addresses",
840
- headers={"Authorization": 'api_key="ak_test"'},
841
- json={
842
- "query": "123 Main St, Springfield, IL 62701",
843
- },
844
- )
845
- result = response.json()["result"]
843
+ with AddressZen("ak_test") as client:
844
+ result = client.address_verify(query="123 Main St, Springfield, IL 62701")
846
845
  - lang: Ruby
847
846
  label: Ruby
848
847
  source: |
@@ -885,7 +884,7 @@ paths:
885
884
 
886
885
  ## Coverage
887
886
 
888
- Each search runs in one country, selected with `context`. A missing or unrecognized `context` falls back to your account default. Results come from the datasets enabled on your key: USPS Zip+4 for the US and its territories, and the country datasets you license elsewhere. Where a key has more than one dataset for a country, `dataset` narrows the search.
887
+ Each search runs in one country, selected with `context`. A missing or unrecognized `context` falls back to your account default. Results come from the datasets enabled on your key: USPS ZIP+4 for the US and its territories, and the country datasets you license elsewhere. Where a key has more than one dataset for a country, `dataset` narrows the search.
889
888
 
890
889
  ## Filters
891
890
 
@@ -895,7 +894,7 @@ paths:
895
894
 
896
895
  ## Address bias
897
896
 
898
- Bias terms carry the `bias_` prefix and promote addresses rather than restricting the set, so unmatched addresses still appear, lower down. For example, `bias_state_code=NY,NJ` favors addresses in New York and New Jersey, `bias_lonlat` favors addresses near a point. Invalid bias terms have no effect. Multiple bias terms are allowed unless stated otherwise, with a combined maximum of 5.
897
+ Bias terms carry the `bias_` prefix and promote addresses rather than restricting the set, so unmatched addresses still appear, lower down. For example, `bias_state_code=NY,NJ` favors addresses in New York and New Jersey, and `bias_lonlat` favors addresses near a point. Invalid bias terms have no effect. Multiple bias terms are allowed unless stated otherwise, with a combined maximum of 5.
899
898
 
900
899
  ## Suggestion format
901
900
 
@@ -1025,28 +1024,37 @@ paths:
1025
1024
  - lang: JavaScript
1026
1025
  label: JavaScript
1027
1026
  source: |
1028
- const response = await fetch(
1029
- 'https://api.addresszen.com/v1/autocomplete/addresses?' +
1030
- new URLSearchParams({
1031
- api_key: 'ak_test',
1032
- query: '1600 Pennsylvania',
1033
- })
1034
- );
1027
+ import { createZenClient } from '@addresszen/sdk';
1028
+ import { createAutocomplete } from '@addresszen/sdk/autocomplete';
1035
1029
 
1036
- const { result } = await response.json();
1030
+ const client = createZenClient({ apiKey: 'ak_test' });
1031
+
1032
+ // Debounces keystrokes, drops superseded requests and caches suggestions
1033
+ const autocomplete = createAutocomplete({ client });
1034
+
1035
+ const hits = await autocomplete.find({ query: '1600 Pennsylvania' });
1036
+ if (hits?.length) {
1037
+ const address = await autocomplete.retrieve({ hit: hits[0] });
1038
+ }
1039
+ - lang: JavaScript
1040
+ label: JavaScript (direct)
1041
+ source: |
1042
+ import { createZenClient, findAddress } from '@addresszen/sdk';
1043
+
1044
+ const client = createZenClient({ apiKey: 'ak_test' });
1045
+
1046
+ const { data } = await findAddress({
1047
+ client,
1048
+ query: { query: '1600 Pennsylvania' },
1049
+ });
1037
1050
  - lang: Python
1038
1051
  label: Python
1039
1052
  source: |
1040
- import requests
1053
+ # pip install addresszen
1054
+ from addresszen import AddressZen
1041
1055
 
1042
- response = requests.get(
1043
- "https://api.addresszen.com/v1/autocomplete/addresses",
1044
- params={
1045
- "api_key": "ak_test",
1046
- "query": "1600 Pennsylvania",
1047
- },
1048
- )
1049
- result = response.json()["result"]
1056
+ with AddressZen("ak_test") as client:
1057
+ result = client.find_address(query="1600 Pennsylvania")
1050
1058
  - lang: Ruby
1051
1059
  label: Ruby
1052
1060
  source: |
@@ -1099,6 +1107,7 @@ paths:
1099
1107
  - $ref: '#/components/parameters/LicenseeParam'
1100
1108
  - $ref: '#/components/parameters/FilterParam'
1101
1109
  - $ref: '#/components/parameters/TagsParam'
1110
+ - $ref: '#/components/parameters/RemoveFirmParam'
1102
1111
  responses:
1103
1112
  '200':
1104
1113
  description: Success
@@ -1132,26 +1141,37 @@ paths:
1132
1141
  - lang: JavaScript
1133
1142
  label: JavaScript
1134
1143
  source: |
1135
- const response = await fetch(
1136
- 'https://api.addresszen.com/v1/autocomplete/addresses/usps_V118834572%7C310%7C%7C3191/usa?' +
1137
- new URLSearchParams({
1138
- api_key: 'ak_test',
1139
- })
1140
- );
1144
+ import { createZenClient } from '@addresszen/sdk';
1145
+ import { createAutocomplete } from '@addresszen/sdk/autocomplete';
1141
1146
 
1142
- const { result } = await response.json();
1147
+ const client = createZenClient({ apiKey: 'ak_test' });
1148
+
1149
+ // Debounces keystrokes, drops superseded requests and caches suggestions
1150
+ const autocomplete = createAutocomplete({ client });
1151
+
1152
+ const hits = await autocomplete.find({ query: '1600 Pennsylvania' });
1153
+ if (hits?.length) {
1154
+ const address = await autocomplete.retrieve({ hit: hits[0] });
1155
+ }
1156
+ - lang: JavaScript
1157
+ label: JavaScript (direct)
1158
+ source: |
1159
+ import { createZenClient, retrieveAddress } from '@addresszen/sdk';
1160
+
1161
+ const client = createZenClient({ apiKey: 'ak_test' });
1162
+
1163
+ const { data } = await retrieveAddress({
1164
+ client,
1165
+ path: { address: 'usps_V118834572|310||3191' },
1166
+ });
1143
1167
  - lang: Python
1144
1168
  label: Python
1145
1169
  source: |
1146
- import requests
1170
+ # pip install addresszen
1171
+ from addresszen import AddressZen
1147
1172
 
1148
- response = requests.get(
1149
- "https://api.addresszen.com/v1/autocomplete/addresses/usps_V118834572%7C310%7C%7C3191/usa",
1150
- params={
1151
- "api_key": "ak_test",
1152
- },
1153
- )
1154
- result = response.json()["result"]
1173
+ with AddressZen("ak_test") as client:
1174
+ result = client.retrieve_address("usps_V118834572|310||3191")
1155
1175
  - lang: Ruby
1156
1176
  label: Ruby
1157
1177
  source: |
@@ -1274,28 +1294,22 @@ paths:
1274
1294
  - lang: JavaScript
1275
1295
  label: JavaScript
1276
1296
  source: |
1277
- const response = await fetch(
1278
- 'https://api.addresszen.com/v1/places?' +
1279
- new URLSearchParams({
1280
- api_key: 'ak_test',
1281
- query: 'london',
1282
- })
1283
- );
1297
+ import { createZenClient, findPlace } from '@addresszen/sdk';
1284
1298
 
1285
- const { result } = await response.json();
1299
+ const client = createZenClient({ apiKey: 'ak_test' });
1300
+
1301
+ const { data } = await findPlace({
1302
+ client,
1303
+ query: { query: 'london' },
1304
+ });
1286
1305
  - lang: Python
1287
1306
  label: Python
1288
1307
  source: |
1289
- import requests
1308
+ # pip install addresszen
1309
+ from addresszen import AddressZen
1290
1310
 
1291
- response = requests.get(
1292
- "https://api.addresszen.com/v1/places",
1293
- params={
1294
- "api_key": "ak_test",
1295
- "query": "london",
1296
- },
1297
- )
1298
- result = response.json()["result"]
1311
+ with AddressZen("ak_test") as client:
1312
+ result = client.find_place(query="london")
1299
1313
  - lang: Ruby
1300
1314
  label: Ruby
1301
1315
  source: |
@@ -1517,42 +1531,38 @@ paths:
1517
1531
  - lang: http
1518
1532
  label: URL
1519
1533
  source: |
1520
- https://api.addresszen.com/v1/places/geonames_5353?api_key=ak_test
1534
+ https://api.addresszen.com/v1/places/geonames_2643743?api_key=ak_test
1521
1535
  - lang: cURL
1522
1536
  label: curl
1523
1537
  source: |
1524
- curl -G 'https://api.addresszen.com/v1/places/geonames_5353' \
1538
+ curl -G 'https://api.addresszen.com/v1/places/geonames_2643743' \
1525
1539
  -d 'api_key=ak_test'
1526
1540
  - lang: JavaScript
1527
1541
  label: JavaScript
1528
1542
  source: |
1529
- const response = await fetch(
1530
- 'https://api.addresszen.com/v1/places/geonames_5353?' +
1531
- new URLSearchParams({
1532
- api_key: 'ak_test',
1533
- })
1534
- );
1543
+ import { createZenClient, resolvePlace } from '@addresszen/sdk';
1535
1544
 
1536
- const { result } = await response.json();
1545
+ const client = createZenClient({ apiKey: 'ak_test' });
1546
+
1547
+ const { data } = await resolvePlace({
1548
+ client,
1549
+ path: { place: 'geonames_2643743' },
1550
+ });
1537
1551
  - lang: Python
1538
1552
  label: Python
1539
1553
  source: |
1540
- import requests
1554
+ # pip install addresszen
1555
+ from addresszen import AddressZen
1541
1556
 
1542
- response = requests.get(
1543
- "https://api.addresszen.com/v1/places/geonames_5353",
1544
- params={
1545
- "api_key": "ak_test",
1546
- },
1547
- )
1548
- result = response.json()["result"]
1557
+ with AddressZen("ak_test") as client:
1558
+ result = client.resolve_place("geonames_2643743")
1549
1559
  - lang: Ruby
1550
1560
  label: Ruby
1551
1561
  source: |
1552
1562
  require "net/http"
1553
1563
  require "json"
1554
1564
 
1555
- uri = URI("https://api.addresszen.com/v1/places/geonames_5353")
1565
+ uri = URI("https://api.addresszen.com/v1/places/geonames_2643743")
1556
1566
  uri.query = URI.encode_www_form(api_key: "ak_test")
1557
1567
  result = JSON.parse(Net::HTTP.get(uri))["result"]
1558
1568
  - lang: PHP
@@ -1560,7 +1570,7 @@ paths:
1560
1570
  source: |
1561
1571
  <?php
1562
1572
  $response = file_get_contents(
1563
- "https://api.addresszen.com/v1/places/geonames_5353?" .
1573
+ "https://api.addresszen.com/v1/places/geonames_2643743?" .
1564
1574
  http_build_query([
1565
1575
  "api_key" => "ak_test",
1566
1576
  ])
@@ -1579,12 +1589,11 @@ paths:
1579
1589
  - $ref: '#/components/parameters/ApiKeyPathParam'
1580
1590
  - name: starting_after
1581
1591
  in: query
1582
- description: ID of the licensee after which to list results
1592
+ description: ID of the licensee after which to list results. Pass the `id` of the last licensee on the previous page.
1583
1593
  style: form
1584
1594
  explode: false
1585
1595
  schema:
1586
- type: integer
1587
- format: int32
1596
+ type: string
1588
1597
  - $ref: '#/components/parameters/UserTokenParam'
1589
1598
  - $ref: '#/components/parameters/LimitParam'
1590
1599
  - name: query
@@ -1620,26 +1629,22 @@ paths:
1620
1629
  - lang: JavaScript
1621
1630
  label: JavaScript
1622
1631
  source: |
1623
- const response = await fetch(
1624
- 'https://api.addresszen.com/v1/keys/ak_test/licensees?' +
1625
- new URLSearchParams({
1626
- user_token: 'uk_secret',
1627
- })
1628
- );
1632
+ import { createZenClient, listLicensees } from '@addresszen/sdk';
1629
1633
 
1630
- const { result } = await response.json();
1634
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
1635
+
1636
+ const { data } = await listLicensees({
1637
+ client,
1638
+ path: { key: 'ak_test' },
1639
+ });
1631
1640
  - lang: Python
1632
1641
  label: Python
1633
1642
  source: |
1634
- import requests
1643
+ # pip install addresszen
1644
+ from addresszen import AddressZen
1635
1645
 
1636
- response = requests.get(
1637
- "https://api.addresszen.com/v1/keys/ak_test/licensees",
1638
- params={
1639
- "user_token": "uk_secret",
1640
- },
1641
- )
1642
- result = response.json()["result"]
1646
+ with AddressZen("ak_test") as client:
1647
+ result = client.list_licensees("ak_test", user_token="uk_secret")
1643
1648
  - lang: Ruby
1644
1649
  label: Ruby
1645
1650
  source: |
@@ -1708,10 +1713,14 @@ paths:
1708
1713
  - lang: JavaScript
1709
1714
  label: JavaScript
1710
1715
  source: |
1711
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret', {
1712
- method: 'POST',
1713
- headers: { 'Content-Type': 'application/json' },
1714
- body: JSON.stringify({
1716
+ import { createZenClient, createLicensee } from '@addresszen/sdk';
1717
+
1718
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
1719
+
1720
+ const { data } = await createLicensee({
1721
+ client,
1722
+ path: { key: 'ak_test' },
1723
+ body: {
1715
1724
  name: 'Qwerty Widgets Limited',
1716
1725
  address: '12 High Street, Manchester',
1717
1726
  postcode: 'BR8 7RE',
@@ -1719,29 +1728,24 @@ paths:
1719
1728
  daily: {
1720
1729
  limit: 10000,
1721
1730
  },
1722
- }),
1731
+ },
1723
1732
  });
1724
-
1725
- const { result } = await response.json();
1726
1733
  - lang: Python
1727
1734
  label: Python
1728
1735
  source: |
1729
- import requests
1730
-
1731
- response = requests.post(
1732
- "https://api.addresszen.com/v1/keys/ak_test/licensees",
1733
- params={"user_token": "uk_secret"},
1734
- json={
1735
- "name": "Qwerty Widgets Limited",
1736
- "address": "12 High Street, Manchester",
1737
- "postcode": "BR8 7RE",
1738
- "whitelist": [],
1739
- "daily": {
1740
- "limit": 10000,
1741
- },
1742
- },
1743
- )
1744
- result = response.json()["result"]
1736
+ # pip install addresszen
1737
+ from addresszen import AddressZen
1738
+
1739
+ with AddressZen("ak_test") as client:
1740
+ result = client.create_licensee(
1741
+ "ak_test",
1742
+ user_token="uk_secret",
1743
+ name="Qwerty Widgets Limited",
1744
+ address="12 High Street, Manchester",
1745
+ postcode="BR8 7RE",
1746
+ whitelist=[],
1747
+ daily={"limit": 10000},
1748
+ )
1745
1749
  - lang: Ruby
1746
1750
  label: Ruby
1747
1751
  source: |
@@ -1820,26 +1824,22 @@ paths:
1820
1824
  - lang: JavaScript
1821
1825
  label: JavaScript
1822
1826
  source: |
1823
- const response = await fetch(
1824
- 'https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?' +
1825
- new URLSearchParams({
1826
- user_token: 'uk_secret',
1827
- })
1828
- );
1827
+ import { createZenClient, retrieveLicensee } from '@addresszen/sdk';
1829
1828
 
1830
- const { result } = await response.json();
1829
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
1830
+
1831
+ const { data } = await retrieveLicensee({
1832
+ client,
1833
+ path: { key: 'ak_test', licensee: 'sl_ijoiqsxeQgXW2gkiE0X94' },
1834
+ });
1831
1835
  - lang: Python
1832
1836
  label: Python
1833
1837
  source: |
1834
- import requests
1838
+ # pip install addresszen
1839
+ from addresszen import AddressZen
1835
1840
 
1836
- response = requests.get(
1837
- "https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94",
1838
- params={
1839
- "user_token": "uk_secret",
1840
- },
1841
- )
1842
- result = response.json()["result"]
1841
+ with AddressZen("ak_test") as client:
1842
+ result = client.retrieve_licensee("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94", user_token="uk_secret")
1843
1843
  - lang: Ruby
1844
1844
  label: Ruby
1845
1845
  source: |
@@ -1891,7 +1891,7 @@ paths:
1891
1891
  - deleted
1892
1892
  properties:
1893
1893
  deleted:
1894
- type: number
1894
+ type: integer
1895
1895
  format: int32
1896
1896
  example: 1
1897
1897
  minimum: 0
@@ -1918,19 +1918,22 @@ paths:
1918
1918
  - lang: JavaScript
1919
1919
  label: JavaScript
1920
1920
  source: |
1921
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret', {
1922
- method: 'DELETE',
1921
+ import { createZenClient, deleteLicensee } from '@addresszen/sdk';
1922
+
1923
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
1924
+
1925
+ const { data } = await deleteLicensee({
1926
+ client,
1927
+ path: { key: 'ak_test', licensee: 'sl_ijoiqsxeQgXW2gkiE0X94' },
1923
1928
  });
1924
1929
  - lang: Python
1925
1930
  label: Python
1926
1931
  source: |
1927
- import requests
1932
+ # pip install addresszen
1933
+ from addresszen import AddressZen
1928
1934
 
1929
- response = requests.delete(
1930
- "https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94",
1931
- params={"user_token": "uk_secret"},
1932
- )
1933
- response.raise_for_status()
1935
+ with AddressZen("ak_test") as client:
1936
+ result = client.delete_licensee("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94", user_token="uk_secret")
1934
1937
  - lang: Ruby
1935
1938
  label: Ruby
1936
1939
  source: |
@@ -1995,32 +1998,32 @@ paths:
1995
1998
  - lang: JavaScript
1996
1999
  label: JavaScript
1997
2000
  source: |
1998
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret', {
1999
- method: 'POST',
2000
- headers: { 'Content-Type': 'application/json' },
2001
- body: JSON.stringify({
2001
+ import { createZenClient, updateLicensee } from '@addresszen/sdk';
2002
+
2003
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
2004
+
2005
+ const { data } = await updateLicensee({
2006
+ client,
2007
+ path: { key: 'ak_test', licensee: 'sl_ijoiqsxeQgXW2gkiE0X94' },
2008
+ body: {
2002
2009
  daily: {
2003
2010
  limit: 20000,
2004
2011
  },
2005
- }),
2012
+ },
2006
2013
  });
2007
-
2008
- const { result } = await response.json();
2009
2014
  - lang: Python
2010
2015
  label: Python
2011
2016
  source: |
2012
- import requests
2017
+ # pip install addresszen
2018
+ from addresszen import AddressZen
2013
2019
 
2014
- response = requests.post(
2015
- "https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94",
2016
- params={"user_token": "uk_secret"},
2017
- json={
2018
- "daily": {
2019
- "limit": 20000,
2020
- },
2021
- },
2022
- )
2023
- result = response.json()["result"]
2020
+ with AddressZen("ak_test") as client:
2021
+ result = client.update_licensee(
2022
+ "ak_test",
2023
+ "sl_ijoiqsxeQgXW2gkiE0X94",
2024
+ user_token="uk_secret",
2025
+ daily={"limit": 20000},
2026
+ )
2024
2027
  - lang: Ruby
2025
2028
  label: Ruby
2026
2029
  source: |
@@ -2077,6 +2080,49 @@ paths:
2077
2080
  application/json:
2078
2081
  schema:
2079
2082
  $ref: '#/components/schemas/ErrorResponse'
2083
+ x-codeSamples:
2084
+ - lang: cURL
2085
+ label: curl
2086
+ source: |
2087
+ curl -X POST 'https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94/regenerate-key?user_token=uk_secret'
2088
+ - lang: JavaScript
2089
+ label: JavaScript
2090
+ source: |
2091
+ import { createZenClient, regenerateLicenseeKey } from '@addresszen/sdk';
2092
+
2093
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
2094
+
2095
+ const { data } = await regenerateLicenseeKey({
2096
+ client,
2097
+ path: { key: 'ak_test', licensee: 'sl_ijoiqsxeQgXW2gkiE0X94' },
2098
+ });
2099
+ - lang: Python
2100
+ label: Python
2101
+ source: |
2102
+ # pip install addresszen
2103
+ from addresszen import AddressZen
2104
+
2105
+ with AddressZen("ak_test") as client:
2106
+ result = client.regenerate_licensee_key("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94", user_token="uk_secret")
2107
+ - lang: Ruby
2108
+ label: Ruby
2109
+ source: |
2110
+ require "net/http"
2111
+ require "json"
2112
+
2113
+ uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94/regenerate-key?user_token=uk_secret")
2114
+ response = Net::HTTP.post(uri, "")
2115
+ result = JSON.parse(response.body)["result"]
2116
+ - lang: PHP
2117
+ label: PHP
2118
+ source: |
2119
+ <?php
2120
+ $ch = curl_init("https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94/regenerate-key?user_token=uk_secret");
2121
+ curl_setopt_array($ch, [
2122
+ CURLOPT_POST => true,
2123
+ CURLOPT_RETURNTRANSFER => true,
2124
+ ]);
2125
+ $result = json_decode(curl_exec($ch), true)["result"];
2080
2126
  /keys/{key}/configs:
2081
2127
  get:
2082
2128
  tags:
@@ -2115,26 +2161,22 @@ paths:
2115
2161
  - lang: JavaScript
2116
2162
  label: JavaScript
2117
2163
  source: |
2118
- const response = await fetch(
2119
- 'https://api.addresszen.com/v1/keys/ak_test/configs?' +
2120
- new URLSearchParams({
2121
- user_token: 'uk_secret',
2122
- })
2123
- );
2164
+ import { createZenClient, listConfigs } from '@addresszen/sdk';
2124
2165
 
2125
- const { result } = await response.json();
2166
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
2167
+
2168
+ const { data } = await listConfigs({
2169
+ client,
2170
+ path: { key: 'ak_test' },
2171
+ });
2126
2172
  - lang: Python
2127
2173
  label: Python
2128
2174
  source: |
2129
- import requests
2175
+ # pip install addresszen
2176
+ from addresszen import AddressZen
2130
2177
 
2131
- response = requests.get(
2132
- "https://api.addresszen.com/v1/keys/ak_test/configs",
2133
- params={
2134
- "user_token": "uk_secret",
2135
- },
2136
- )
2137
- result = response.json()["result"]
2178
+ with AddressZen("ak_test") as client:
2179
+ result = client.list_configs("ak_test", user_token="uk_secret")
2138
2180
  - lang: Ruby
2139
2181
  label: Ruby
2140
2182
  source: |
@@ -2198,30 +2240,33 @@ paths:
2198
2240
  - lang: JavaScript
2199
2241
  label: JavaScript
2200
2242
  source: |
2201
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/configs?user_token=uk_secret', {
2202
- method: 'POST',
2203
- headers: { 'Content-Type': 'application/json' },
2204
- body: JSON.stringify({
2243
+ import { createZenClient, createConfig } from '@addresszen/sdk';
2244
+
2245
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
2246
+
2247
+ const { data } = await createConfig({
2248
+ client,
2249
+ path: { key: 'ak_test' },
2250
+ body: {
2205
2251
  name: 'woocommerce',
2206
2252
  payload: '{"removeOrganisation": false}',
2207
- }),
2253
+ },
2208
2254
  });
2209
-
2210
- const { result } = await response.json();
2211
2255
  - lang: Python
2212
2256
  label: Python
2213
2257
  source: |
2214
- import requests
2258
+ # pip install addresszen
2259
+ import json
2215
2260
 
2216
- response = requests.post(
2217
- "https://api.addresszen.com/v1/keys/ak_test/configs",
2218
- params={"user_token": "uk_secret"},
2219
- json={
2220
- "name": "woocommerce",
2221
- "payload": "{\"removeOrganisation\": false}",
2222
- },
2223
- )
2224
- result = response.json()["result"]
2261
+ from addresszen import AddressZen
2262
+
2263
+ with AddressZen("ak_test") as client:
2264
+ result = client.create_config(
2265
+ "ak_test",
2266
+ user_token="uk_secret",
2267
+ name="woocommerce",
2268
+ payload=json.dumps({"removeOrganisation": False}),
2269
+ )
2225
2270
  - lang: Ruby
2226
2271
  label: Ruby
2227
2272
  source: |
@@ -2293,26 +2338,22 @@ paths:
2293
2338
  - lang: JavaScript
2294
2339
  label: JavaScript
2295
2340
  source: |
2296
- const response = await fetch(
2297
- 'https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?' +
2298
- new URLSearchParams({
2299
- user_token: 'uk_secret',
2300
- })
2301
- );
2341
+ import { createZenClient, retrieveConfig } from '@addresszen/sdk';
2302
2342
 
2303
- const { result } = await response.json();
2343
+ const client = createZenClient({ apiKey: 'ak_test' });
2344
+
2345
+ const { data } = await retrieveConfig({
2346
+ client,
2347
+ path: { key: 'ak_test', config: 'woocommerce' },
2348
+ });
2304
2349
  - lang: Python
2305
2350
  label: Python
2306
2351
  source: |
2307
- import requests
2352
+ # pip install addresszen
2353
+ from addresszen import AddressZen
2308
2354
 
2309
- response = requests.get(
2310
- "https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce",
2311
- params={
2312
- "user_token": "uk_secret",
2313
- },
2314
- )
2315
- result = response.json()["result"]
2355
+ with AddressZen("ak_test") as client:
2356
+ result = client.retrieve_config("ak_test", "woocommerce")
2316
2357
  - lang: Ruby
2317
2358
  label: Ruby
2318
2359
  source: |
@@ -2364,7 +2405,7 @@ paths:
2364
2405
  - deleted
2365
2406
  properties:
2366
2407
  deleted:
2367
- type: number
2408
+ type: integer
2368
2409
  format: int32
2369
2410
  example: 1
2370
2411
  minimum: 0
@@ -2397,19 +2438,22 @@ paths:
2397
2438
  - lang: JavaScript
2398
2439
  label: JavaScript
2399
2440
  source: |
2400
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret', {
2401
- method: 'DELETE',
2441
+ import { createZenClient, deleteConfig } from '@addresszen/sdk';
2442
+
2443
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
2444
+
2445
+ const { data } = await deleteConfig({
2446
+ client,
2447
+ path: { key: 'ak_test', config: 'woocommerce' },
2402
2448
  });
2403
2449
  - lang: Python
2404
2450
  label: Python
2405
2451
  source: |
2406
- import requests
2452
+ # pip install addresszen
2453
+ from addresszen import AddressZen
2407
2454
 
2408
- response = requests.delete(
2409
- "https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce",
2410
- params={"user_token": "uk_secret"},
2411
- )
2412
- response.raise_for_status()
2455
+ with AddressZen("ak_test") as client:
2456
+ result = client.delete_config("ak_test", "woocommerce", user_token="uk_secret")
2413
2457
  - lang: Ruby
2414
2458
  label: Ruby
2415
2459
  source: |
@@ -2478,28 +2522,32 @@ paths:
2478
2522
  - lang: JavaScript
2479
2523
  label: JavaScript
2480
2524
  source: |
2481
- const response = await fetch('https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret', {
2482
- method: 'POST',
2483
- headers: { 'Content-Type': 'application/json' },
2484
- body: JSON.stringify({
2525
+ import { createZenClient, updateConfig } from '@addresszen/sdk';
2526
+
2527
+ const client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });
2528
+
2529
+ const { data } = await updateConfig({
2530
+ client,
2531
+ path: { key: 'ak_test', config: 'woocommerce' },
2532
+ body: {
2485
2533
  payload: '{"removeOrganisation": true}',
2486
- }),
2534
+ },
2487
2535
  });
2488
-
2489
- const { result } = await response.json();
2490
2536
  - lang: Python
2491
2537
  label: Python
2492
2538
  source: |
2493
- import requests
2539
+ # pip install addresszen
2540
+ import json
2494
2541
 
2495
- response = requests.post(
2496
- "https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce",
2497
- params={"user_token": "uk_secret"},
2498
- json={
2499
- "payload": "{\"removeOrganisation\": true}",
2500
- },
2501
- )
2502
- result = response.json()["result"]
2542
+ from addresszen import AddressZen
2543
+
2544
+ with AddressZen("ak_test") as client:
2545
+ result = client.update_config(
2546
+ "ak_test",
2547
+ "woocommerce",
2548
+ user_token="uk_secret",
2549
+ payload=json.dumps({"removeOrganisation": True}),
2550
+ )
2503
2551
  - lang: Ruby
2504
2552
  label: Ruby
2505
2553
  source: |
@@ -2592,28 +2640,22 @@ paths:
2592
2640
  - lang: JavaScript
2593
2641
  label: JavaScript
2594
2642
  source: |
2595
- const response = await fetch(
2596
- 'https://api.addresszen.com/v1/emails?' +
2597
- new URLSearchParams({
2598
- api_key: 'ak_test',
2599
- query: 'foo@domain.com',
2600
- })
2601
- );
2643
+ import { createZenClient, emailValidation } from '@addresszen/sdk';
2602
2644
 
2603
- const { result } = await response.json();
2645
+ const client = createZenClient({ apiKey: 'ak_test' });
2646
+
2647
+ const { data } = await emailValidation({
2648
+ client,
2649
+ query: { query: 'foo@domain.com' },
2650
+ });
2604
2651
  - lang: Python
2605
2652
  label: Python
2606
2653
  source: |
2607
- import requests
2654
+ # pip install addresszen
2655
+ from addresszen import AddressZen
2608
2656
 
2609
- response = requests.get(
2610
- "https://api.addresszen.com/v1/emails",
2611
- params={
2612
- "api_key": "ak_test",
2613
- "query": "foo@domain.com",
2614
- },
2615
- )
2616
- result = response.json()["result"]
2657
+ with AddressZen("ak_test") as client:
2658
+ result = client.email_validation(query="foo@domain.com")
2617
2659
  - lang: Ruby
2618
2660
  label: Ruby
2619
2661
  source: |
@@ -2723,28 +2765,22 @@ paths:
2723
2765
  - lang: JavaScript
2724
2766
  label: JavaScript
2725
2767
  source: |
2726
- const response = await fetch(
2727
- 'https://api.addresszen.com/v1/phone_numbers?' +
2728
- new URLSearchParams({
2729
- api_key: 'ak_test',
2730
- query: '02071128019',
2731
- })
2732
- );
2768
+ import { createZenClient, phoneNumberValidation } from '@addresszen/sdk';
2733
2769
 
2734
- const { result } = await response.json();
2770
+ const client = createZenClient({ apiKey: 'ak_test' });
2771
+
2772
+ const { data } = await phoneNumberValidation({
2773
+ client,
2774
+ query: { query: '02071128019' },
2775
+ });
2735
2776
  - lang: Python
2736
2777
  label: Python
2737
2778
  source: |
2738
- import requests
2779
+ # pip install addresszen
2780
+ from addresszen import AddressZen
2739
2781
 
2740
- response = requests.get(
2741
- "https://api.addresszen.com/v1/phone_numbers",
2742
- params={
2743
- "api_key": "ak_test",
2744
- "query": "02071128019",
2745
- },
2746
- )
2747
- result = response.json()["result"]
2782
+ with AddressZen("ak_test") as client:
2783
+ result = client.phone_number_validation(query="02071128019")
2748
2784
  - lang: Ruby
2749
2785
  label: Ruby
2750
2786
  source: |
@@ -2994,13 +3030,13 @@ paths:
2994
3030
  properties:
2995
3031
  user_token:
2996
3032
  type: string
2997
- description: User-level token used to manage account resources via the api.
3033
+ description: User-level token used to manage account resources via the API.
2998
3034
  test_api_key:
2999
3035
  type: string
3000
3036
  description: Initial test API key for the account.
3001
3037
  user_id:
3002
3038
  type: string
3003
- description: Internal api user id.
3039
+ description: Internal API user id.
3004
3040
  '202':
3005
3041
  description: Pending, keep polling
3006
3042
  content:
@@ -3117,7 +3153,7 @@ components:
3117
3153
  description: |
3118
3154
  **API Key**
3119
3155
 
3120
- The API Key to retrieve. Begins `ak_`.
3156
+ The API Key. Begins `ak_`.
3121
3157
  UserTokenParam:
3122
3158
  in: query
3123
3159
  style: form
@@ -3130,9 +3166,9 @@ components:
3130
3166
 
3131
3167
  A secret key used to manage your account and API Keys. It was previously called the user token.
3132
3168
 
3133
- Your management key can be retrieved and managed from your [accounts page](https://addresszen.com/account).
3169
+ Your management key can be retrieved and managed from your [accounts page](https://account.addresszen.com/tokens).
3134
3170
 
3135
- Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
3171
+ Typically begins `uk_`. Prefer sending it in the `Authorization` header as `Bearer uk_...` instead of this query parameter. The `Authorization: user_token="uk_..."` header also works.
3136
3172
  example: uk_B59ScW1p1HHouf1VqclEPZUx
3137
3173
  StartParam:
3138
3174
  name: start
@@ -3203,6 +3239,24 @@ components:
3203
3239
  schema:
3204
3240
  type: string
3205
3241
  style: form
3242
+ RemoveFirmParam:
3243
+ name: remove_firm
3244
+ in: query
3245
+ style: form
3246
+ explode: false
3247
+ required: false
3248
+ description: |
3249
+ **Remove Firm**
3250
+
3251
+ Removes firm names from the address lines (`line_1`, `line_2`, ...). Outside the USA this covers organization and department names. Remaining lines move up. Useful when delivering to people rather than businesses.
3252
+
3253
+ Set `remove_firm=true` to enable.
3254
+
3255
+ Firm fields and the `native` record are unchanged. If removing the firm would leave no address lines, it is kept and the lines are returned unchanged. Building names are not removed.
3256
+ schema:
3257
+ type: string
3258
+ enum:
3259
+ - 'true'
3206
3260
  DatasetParam:
3207
3261
  name: dataset
3208
3262
  in: query
@@ -3218,7 +3272,8 @@ components:
3218
3272
  Comma-separated list of datasets to search within.
3219
3273
 
3220
3274
  Filters results to only include addresses from the specified datasets. Useful for keys with multiple overlapping datasets enabled (e.g. `paf` and `abp`).
3221
- example: usps
3275
+ example:
3276
+ - usps
3222
3277
  ContextParam:
3223
3278
  name: context
3224
3279
  in: query
@@ -3620,7 +3675,7 @@ components:
3620
3675
  - Daily limit has been reached on the key
3621
3676
  - Daily individual limit has been reached
3622
3677
  - Key is not being used via an authorised URL
3623
- - (Sublicensed key only) Key has a valid licensee attached
3678
+ - (Sublicensed key only) Key has no valid licensee attached
3624
3679
  - (Sublicensed key only) Key is not being used via an authorised URL specified by licensee
3625
3680
  type: boolean
3626
3681
  example: true
@@ -4114,7 +4169,7 @@ components:
4114
4169
  nullable: true
4115
4170
  type: integer
4116
4171
  description: |-
4117
- `number` or `null` Limit set on the number of lookups that can be
4172
+ `number` or `null`. Limit set on the number of lookups that can be
4118
4173
  performed from a single IP address. `null` means the limit is currently
4119
4174
  disabled.
4120
4175
  format: int32
@@ -4173,7 +4228,7 @@ components:
4173
4228
  description: Accept IP addresses forwarded in the `AZ-Source-IP` header
4174
4229
  datasets:
4175
4230
  title: API Key Dataset Availability
4176
- description: Indicates which datasets are available and added by default to the address responses
4231
+ description: 'Datasets you can switch on or off for this key. Datasets set by your plan (`paf`, `mr`, `nyb`, `ecad`, `ecaf`) cannot be changed here: sending one with a different value returns a 400.'
4177
4232
  type: object
4178
4233
  properties:
4179
4234
  pafa:
@@ -4441,7 +4496,7 @@ components:
4441
4496
  check_digit:
4442
4497
  type: string
4443
4498
  description: |
4444
- Character following the 5 or 9 digit ZIP Code. Part of the 11-digit barcode
4499
+ Character following the 5-digit or 9-digit ZIP Code. Part of the 11-digit barcode
4445
4500
  city:
4446
4501
  type: string
4447
4502
  description: |
@@ -4457,7 +4512,7 @@ components:
4457
4512
  country_code:
4458
4513
  type: string
4459
4514
  description: |
4460
- ISO3166 country code. Empty string if not present
4515
+ ISO 3166 country code. Empty string if not present
4461
4516
  county:
4462
4517
  type: string
4463
4518
  description: |
@@ -4524,7 +4579,7 @@ components:
4524
4579
  - 'U1' Unique 5-digit ZIP code.
4525
4580
  dpv_no_stat:
4526
4581
  type: string
4527
- description: "Delivery Point Validation (DPV) NoStat code.\n\nIndicates whether the address is a vacant property, it receives mail as a part of a drop, or it does not have an established delivery yet.\n\nPossible values:\n- 'Y'\tConfirmed\n- 'N'\tNot confirmed\n- '' Empty string if address is not DPV validated.\n"
4582
+ description: "Delivery Point Validation (DPV) NoStat code.\n\nIndicates whether the address is a vacant property, it receives mail as a part of a drop or it does not have an established delivery yet.\n\nPossible values:\n- 'Y'\tConfirmed\n- 'N'\tNot confirmed\n- '' Empty string if address is not DPV validated.\n"
4528
4583
  enum:
4529
4584
  - 'Y'
4530
4585
  - 'N'
@@ -4629,7 +4684,7 @@ components:
4629
4684
  parsed_pmb_number:
4630
4685
  type: string
4631
4686
  description: |
4632
- Information if a Private Mail Box (PMB) is found in an address. Empty string if not present
4687
+ Private Mail Box (PMB) number, if one is found in an address. Empty string if not present
4633
4688
  parsed_post_directional:
4634
4689
  type: string
4635
4690
  description: |
@@ -4748,208 +4803,10 @@ components:
4748
4803
  time_zone: MST
4749
4804
  urbanization: ''
4750
4805
  zip_code: 88310-5631
4751
- UsaVerifyMatch:
4752
- title: Address Match
4753
- type: object
4754
- required:
4755
- - query
4756
- - query_city
4757
- - query_state
4758
- - query_zip_code
4759
- - match
4760
- - count
4761
- - fit
4762
- - confidence
4763
- - match_information
4764
- - address_line_one
4765
- - address_line_two
4766
- - city
4767
- - state
4768
- - zip_code
4769
- - country_iso_2
4770
- properties:
4771
- query:
4772
- type: string
4773
- description: Submitted query
4774
- query_city:
4775
- type: string
4776
- description: Submitted city
4777
- query_state:
4778
- type: string
4779
- description: Submitted state
4780
- query_zip_code:
4781
- type: string
4782
- description: Submitted zip_code
4783
- match:
4784
- description: Nearest matching address
4785
- allOf:
4786
- - $ref: '#/components/schemas/UsaCassVerifiedAddress'
4787
- count:
4788
- type: number
4789
- description: |
4790
- The number of addresses we matched to the input. We return the closest match by default.
4791
- maximum: 10
4792
- minimum: 0
4793
- fit:
4794
- type: number
4795
- description: |
4796
- A score represented as number between 1 and 0. Fit compares the address elements present in your query against the matching address elements. It does not incorporate elements you have not presented in the score. A partial address (e.g. 123 Main St) will have a fit of 1 even though it is missing city and zip code. Its confidence score will be less than 1 however because it is missing some crucial elements.
4797
- maximum: 1
4798
- minimum: 0
4799
- confidence:
4800
- type: number
4801
- maximum: 1
4802
- minimum: 0
4803
- description: |
4804
- A confidence score represented as number between 1 and 0. 1 indicates a full match. 0 indicates no complete matching elements.
4805
- match_information:
4806
- type: string
4807
- description: |
4808
- Additional information about the match.
4809
-
4810
- This information is for human consumption and may not be present in all responses.
4811
- example: Single Response - The delivery address was found in the National Database and no further information was required.
4812
- address_line_one:
4813
- type: string
4814
- description: |
4815
- Primary delivery address
4816
- example: 123 Main St
4817
- address_line_two:
4818
- type: string
4819
- description: |
4820
- Secondary address information
4821
- example: ''
4822
- city:
4823
- type: string
4824
- description: |
4825
- City name
4826
- example: Springfield
4827
- state:
4828
- type: string
4829
- description: |
4830
- State name
4831
- example: CO
4832
- zip_code:
4833
- type: string
4834
- description: |
4835
- Zip code
4836
- example: 81073-1119
4837
- country_iso_2:
4838
- type: string
4839
- description: |
4840
- 2 letter ISO country code
4841
- example: US
4842
- UsaVerifyNoMatch:
4843
- type: object
4844
- title: No Address Match
4845
- required:
4846
- - query
4847
- - query_city
4848
- - query_state
4849
- - query_zip_code
4850
- - match
4851
- - count
4852
- - fit
4853
- - confidence
4854
- - address_line_one
4855
- - address_line_two
4856
- - city
4857
- - state
4858
- - zip_code
4859
- - country_iso_2
4860
- properties:
4861
- query:
4862
- type: string
4863
- description: Originally submitted query
4864
- query_city:
4865
- type: string
4866
- description: Originally submitted city
4867
- query_state:
4868
- type: string
4869
- description: Originally submitted state
4870
- query_zip_code:
4871
- type: string
4872
- description: Originally submitted zip_code
4873
- match:
4874
- description: Nearest matching address
4875
- type: object
4876
- nullable: true
4877
- enum:
4878
- - null
4879
- count:
4880
- type: number
4881
- description: ''
4882
- enum:
4883
- - 0
4884
- fit:
4885
- type: number
4886
- format: float
4887
- description: ''
4888
- enum:
4889
- - 0
4890
- confidence:
4891
- type: number
4892
- format: float
4893
- description: ''
4894
- enum:
4895
- - 0
4896
- address_line_one:
4897
- type: string
4898
- description: |
4899
- Empty if no match
4900
- enum:
4901
- - ''
4902
- address_line_two:
4903
- type: string
4904
- description: |
4905
- Empty if no match
4906
- enum:
4907
- - ''
4908
- city:
4909
- type: string
4910
- description: |
4911
- Empty if no match
4912
- enum:
4913
- - ''
4914
- state:
4915
- type: string
4916
- description: |
4917
- Empty if no match
4918
- enum:
4919
- - ''
4920
- zip_code:
4921
- type: string
4922
- description: |
4923
- Empty if no match
4924
- enum:
4925
- - ''
4926
- country_iso_2:
4927
- type: string
4928
- description: |
4929
- Empty if no match
4930
- enum:
4931
- - ''
4932
- VerifyResponse:
4933
- title: Address Verify Response
4934
- type: object
4935
- required:
4936
- - message
4937
- - code
4938
- - result
4939
- properties:
4940
- code:
4941
- type: integer
4942
- format: int32
4943
- enum:
4944
- - 2000
4945
- message:
4946
- type: string
4947
- enum:
4948
- - Success
4949
- result:
4950
- oneOf:
4951
- - $ref: '#/components/schemas/UsaVerifyMatch'
4952
- - $ref: '#/components/schemas/UsaVerifyNoMatch'
4806
+ ID:
4807
+ title: Address Identifier
4808
+ type: string
4809
+ description: Globally unique internally generated identifier for an address
4953
4810
  Dataset:
4954
4811
  title: Dataset
4955
4812
  type: string
@@ -4988,61 +4845,8 @@ components:
4988
4845
  - bev
4989
4846
  - ban
4990
4847
  - swt
4991
- ID:
4992
- title: Address Identifier
4993
- type: string
4994
- description: Global unique internally generated identifier for an address
4995
- AddressSuggestion:
4996
- title: Address Suggestion
4997
- description: Represents an address suggestion for any address in the world
4998
- type: object
4999
- required:
5000
- - id
5001
- - suggestion
5002
- - urls
5003
- example:
5004
- id: usps_V210079628|10||3797
5005
- suggestion: 10 Downing St, Montpelier, VT, 05602
5006
- urls: {}
5007
- properties:
5008
- id:
5009
- $ref: '#/components/schemas/ID'
5010
- suggestion:
5011
- type: string
5012
- description: Address Suggestion to be displayed to the user
5013
- urls:
5014
- title: URLs
5015
- type: object
5016
- description: Always an empty object (`{}`). Retrieve the full address with `id`
5017
- additionalProperties: false
5018
- AutocompleteResponse:
5019
- title: Address Autocomplete Response
5020
- type: object
5021
- required:
5022
- - message
5023
- - code
5024
- - result
5025
- properties:
5026
- result:
5027
- type: object
5028
- required:
5029
- - hits
5030
- properties:
5031
- hits:
5032
- type: array
5033
- items:
5034
- $ref: '#/components/schemas/AddressSuggestion'
5035
- code:
5036
- type: integer
5037
- format: int32
5038
- enum:
5039
- - 2000
5040
- message:
5041
- type: string
5042
- enum:
5043
- - Success
5044
- CountryISO:
5045
- title: ISO Country Code (3)
4848
+ CountryISO:
4849
+ title: ISO Country Code (3)
5046
4850
  type: string
5047
4851
  description: |2
5048
4852
  3 letter country code (ISO 3166-1)
@@ -6828,8 +6632,11 @@ components:
6828
6632
  maxLength: 6
6829
6633
  nullable: true
6830
6634
  description: |
6831
- Current AddressBase classification code (e.g. `RD` residential,
6832
- `CR` commercial retail). Top-level categories: `R` Residential,
6635
+ Current AddressBase classification code, passed through verbatim at
6636
+ whatever level the custodian recorded. Usually tertiary (e.g. `RD03`
6637
+ semi-detached, `RD04` terraced, `RD06` self-contained flat, `CR01`
6638
+ retail), but can be quaternary (`LP03PA`), secondary (`RD`) or primary
6639
+ (`C`). Match on prefix rather than equality. Top-level categories: `R` Residential,
6833
6640
  `C` Commercial, `L` Land, `M` Military, `O` Other, `P` Parent shell,
6834
6641
  `U` Unclassified, `X` Dual use, `Z` Object of interest. NULL when no
6835
6642
  current classification row exists for the UPRN.
@@ -14757,11 +14564,11 @@ components:
14757
14564
  secondary_number:
14758
14565
  title: Secondary Number
14759
14566
  type: string
14760
- description: Number of the sub unit, apartment, suite etc.
14567
+ description: Number of the subunit, apartment, suite etc.
14761
14568
  plus_4_code:
14762
14569
  title: Plus 4 Code
14763
14570
  type: string
14764
- description: 4 digit ZIP add-on code. USPS addresses only.
14571
+ description: 4-digit ZIP add-on code. USPS addresses only.
14765
14572
  line_1:
14766
14573
  title: First Address Line
14767
14574
  type: string
@@ -14777,7 +14584,7 @@ components:
14777
14584
  zip_code:
14778
14585
  title: ZIP Code
14779
14586
  type: string
14780
- description: Postal code identifying the delivery area. For US addresses this is the 5 digit ZIP Code.
14587
+ description: Postal code identifying the delivery area. For US addresses this is the 5-digit ZIP Code.
14781
14588
  zip_plus_4_code:
14782
14589
  title: ZIP + 4 Code
14783
14590
  type: string
@@ -14812,7 +14619,7 @@ components:
14812
14619
  title: Carrier Route ID
14813
14620
  type: string
14814
14621
  description: |-
14815
- A 4 character ID identifying the USPS postal route for the address. The first character indicates the route type:
14622
+ A 4-character ID identifying the USPS postal route for the address. The first character indicates the route type:
14816
14623
 
14817
14624
  - "B" indicates PO Box
14818
14625
  - "H" indicates highway
@@ -14892,7 +14699,7 @@ components:
14892
14699
  state_abbreviation:
14893
14700
  title: State Abbreviation
14894
14701
  type: string
14895
- description: Abbreviated name of the state, province or region. For US addresses this is the 2 character state, territory or armed forces designation ("AA", "AE" or "AP" for APO/FPO/DPO).
14702
+ description: Abbreviated name of the state, province or region. For US addresses this is the 2-character state, territory or armed forces designation ("AA", "AE" or "AP" for APO/FPO/DPO).
14896
14703
  state:
14897
14704
  title: State
14898
14705
  type: string
@@ -14933,7 +14740,7 @@ components:
14933
14740
 
14934
14741
  - B = Branch
14935
14742
  - C = Community post office (CPO)
14936
- - N = Non-postal community name, former USPS facility, or place name
14743
+ - N = Non-postal community name, former USPS facility or place name
14937
14744
  - P = Post Office
14938
14745
  - S = Station
14939
14746
  - U = Urbanization
@@ -15042,6 +14849,267 @@ components:
15042
14849
  finance_number: 353910
15043
14850
  congressional_district_number: 2
15044
14851
  county_number: 103
14852
+ UsaVerifyMatch:
14853
+ title: Address Match
14854
+ type: object
14855
+ required:
14856
+ - query
14857
+ - query_city
14858
+ - query_state
14859
+ - query_zip_code
14860
+ - match
14861
+ - count
14862
+ - fit
14863
+ - confidence
14864
+ - match_information
14865
+ - address_line_one
14866
+ - address_line_two
14867
+ - city
14868
+ - state
14869
+ - zip_code
14870
+ - country_iso_2
14871
+ properties:
14872
+ query:
14873
+ type: string
14874
+ description: Submitted query
14875
+ query_city:
14876
+ type: string
14877
+ description: Submitted city
14878
+ query_state:
14879
+ type: string
14880
+ description: Submitted state
14881
+ query_zip_code:
14882
+ type: string
14883
+ description: Submitted zip_code
14884
+ match:
14885
+ description: |
14886
+ Nearest matching address. A CASS verified address in the United States. Elsewhere, the address in the same format Retrieve Address returns, with the raw dataset record in `native`
14887
+ oneOf:
14888
+ - $ref: '#/components/schemas/UsaCassVerifiedAddress'
14889
+ - $ref: '#/components/schemas/Address'
14890
+ count:
14891
+ type: integer
14892
+ description: |
14893
+ The number of addresses we matched to the input. We return the closest match by default.
14894
+ maximum: 10
14895
+ minimum: 0
14896
+ fit:
14897
+ type: number
14898
+ description: |
14899
+ A score represented as a number between 1 and 0. Fit compares the address elements present in your query against the matching address elements. It does not incorporate elements you have not presented in the score. A partial address (e.g. 123 Main St) will have a fit of 1 even though it is missing city and zip code. Its confidence score will be less than 1 however because it is missing some crucial elements.
14900
+ maximum: 1
14901
+ minimum: 0
14902
+ confidence:
14903
+ type: number
14904
+ maximum: 1
14905
+ minimum: 0
14906
+ description: |
14907
+ A confidence score represented as a number between 1 and 0. 1 indicates a full match. 0 indicates no complete matching elements.
14908
+ match_information:
14909
+ type: string
14910
+ description: |
14911
+ Additional information about the match.
14912
+
14913
+ This information is for human consumption and may not be present in all responses.
14914
+ example: Single Response - The delivery address was found in the National Database and no further information was required.
14915
+ address_line_one:
14916
+ type: string
14917
+ description: |
14918
+ Primary delivery address
14919
+ example: 123 Main St
14920
+ address_line_two:
14921
+ type: string
14922
+ description: |
14923
+ Secondary address information
14924
+ example: ''
14925
+ city:
14926
+ type: string
14927
+ description: |
14928
+ City name
14929
+ example: Springfield
14930
+ state:
14931
+ type: string
14932
+ description: |
14933
+ State name
14934
+ example: CO
14935
+ zip_code:
14936
+ type: string
14937
+ description: |
14938
+ ZIP code
14939
+ example: 81073-1119
14940
+ country_iso_2:
14941
+ type: string
14942
+ description: |
14943
+ 2-letter ISO country code
14944
+ example: US
14945
+ UsaVerifyNoMatch:
14946
+ type: object
14947
+ title: No Address Match
14948
+ required:
14949
+ - query
14950
+ - query_city
14951
+ - query_state
14952
+ - query_zip_code
14953
+ - match
14954
+ - count
14955
+ - fit
14956
+ - confidence
14957
+ - match_information
14958
+ - address_line_one
14959
+ - address_line_two
14960
+ - city
14961
+ - state
14962
+ - zip_code
14963
+ - country_iso_2
14964
+ properties:
14965
+ query:
14966
+ type: string
14967
+ description: Originally submitted query
14968
+ query_city:
14969
+ type: string
14970
+ description: Originally submitted city
14971
+ query_state:
14972
+ type: string
14973
+ description: Originally submitted state
14974
+ query_zip_code:
14975
+ type: string
14976
+ description: Originally submitted zip_code
14977
+ match:
14978
+ description: Nearest matching address
14979
+ type: object
14980
+ nullable: true
14981
+ enum:
14982
+ - null
14983
+ count:
14984
+ type: integer
14985
+ description: ''
14986
+ enum:
14987
+ - 0
14988
+ fit:
14989
+ type: number
14990
+ format: float
14991
+ description: ''
14992
+ enum:
14993
+ - 0
14994
+ confidence:
14995
+ type: number
14996
+ format: float
14997
+ description: ''
14998
+ enum:
14999
+ - 0
15000
+ match_information:
15001
+ type: string
15002
+ description: |
15003
+ Why the address could not be verified, for people to read. For example `Address not found`, `House number not valid for this street`, `Invalid city, state or ZIP code` or `Address could not be parsed`.
15004
+
15005
+ The wording may change, so do not parse it. Test `match` for `null` instead.
15006
+ example: Address not found
15007
+ address_line_one:
15008
+ type: string
15009
+ description: |
15010
+ Empty if no match
15011
+ enum:
15012
+ - ''
15013
+ address_line_two:
15014
+ type: string
15015
+ description: |
15016
+ Empty if no match
15017
+ enum:
15018
+ - ''
15019
+ city:
15020
+ type: string
15021
+ description: |
15022
+ Empty if no match
15023
+ enum:
15024
+ - ''
15025
+ state:
15026
+ type: string
15027
+ description: |
15028
+ Empty if no match
15029
+ enum:
15030
+ - ''
15031
+ zip_code:
15032
+ type: string
15033
+ description: |
15034
+ Empty if no match
15035
+ enum:
15036
+ - ''
15037
+ country_iso_2:
15038
+ type: string
15039
+ description: |
15040
+ Empty if no match
15041
+ enum:
15042
+ - ''
15043
+ VerifyResponse:
15044
+ title: Address Verify Response
15045
+ type: object
15046
+ required:
15047
+ - message
15048
+ - code
15049
+ - result
15050
+ properties:
15051
+ code:
15052
+ type: integer
15053
+ format: int32
15054
+ enum:
15055
+ - 2000
15056
+ message:
15057
+ type: string
15058
+ enum:
15059
+ - Success
15060
+ result:
15061
+ oneOf:
15062
+ - $ref: '#/components/schemas/UsaVerifyMatch'
15063
+ - $ref: '#/components/schemas/UsaVerifyNoMatch'
15064
+ AddressSuggestion:
15065
+ title: Address Suggestion
15066
+ description: Represents an address suggestion for any address in the world
15067
+ type: object
15068
+ required:
15069
+ - id
15070
+ - suggestion
15071
+ - urls
15072
+ example:
15073
+ id: usps_V210079628|10||3797
15074
+ suggestion: 10 Downing St, Montpelier, VT, 05602
15075
+ urls: {}
15076
+ properties:
15077
+ id:
15078
+ $ref: '#/components/schemas/ID'
15079
+ suggestion:
15080
+ type: string
15081
+ description: Address Suggestion to be displayed to the user
15082
+ urls:
15083
+ title: URLs
15084
+ type: object
15085
+ description: Always an empty object (`{}`). Retrieve the full address with `id`
15086
+ additionalProperties: false
15087
+ AutocompleteResponse:
15088
+ title: Address Autocomplete Response
15089
+ type: object
15090
+ required:
15091
+ - message
15092
+ - code
15093
+ - result
15094
+ properties:
15095
+ result:
15096
+ type: object
15097
+ required:
15098
+ - hits
15099
+ properties:
15100
+ hits:
15101
+ type: array
15102
+ items:
15103
+ $ref: '#/components/schemas/AddressSuggestion'
15104
+ code:
15105
+ type: integer
15106
+ format: int32
15107
+ enum:
15108
+ - 2000
15109
+ message:
15110
+ type: string
15111
+ enum:
15112
+ - Success
15045
15113
  UsaResolveAddressResponse:
15046
15114
  title: Address Retrieve Response
15047
15115
  type: object
@@ -15060,8 +15128,7 @@ components:
15060
15128
  enum:
15061
15129
  - Success
15062
15130
  result:
15063
- allOf:
15064
- - $ref: '#/components/schemas/Address'
15131
+ $ref: '#/components/schemas/Address'
15065
15132
  place_id:
15066
15133
  title: ID
15067
15134
  type: string
@@ -15347,7 +15414,7 @@ components:
15347
15414
  id:
15348
15415
  title: Place Identifier
15349
15416
  type: string
15350
- description: Global unique internally generated identifier for a place
15417
+ description: Globally unique internally generated identifier for a place
15351
15418
  dataset:
15352
15419
  title: Dataset
15353
15420
  type: string
@@ -15426,11 +15493,35 @@ components:
15426
15493
  - Success
15427
15494
  result:
15428
15495
  $ref: '#/components/schemas/Place'
15429
- LicenseeEditable:
15496
+ Licensee:
15430
15497
  title: Licensee
15431
- description: Licensee object which can be defined by user
15432
15498
  type: object
15499
+ required:
15500
+ - id
15501
+ - key
15502
+ - createdAt
15503
+ - name
15504
+ - address
15505
+ - postcode
15506
+ - whitelist
15507
+ - daily
15433
15508
  properties:
15509
+ id:
15510
+ type: string
15511
+ example: 56a11209ebe230380bf104c3
15512
+ description: |
15513
+ An immutable ID provided for every licensee. Primarily used for paginated list requests.
15514
+ key:
15515
+ type: string
15516
+ example: sl_ijoiqsxeQgXW2gkiE0X94
15517
+ description: |
15518
+ Uniquely identifies a licensee for a key.
15519
+
15520
+ Required to perform paid lookups for a specific licensee. Typically begins `sl_`.
15521
+ createdAt:
15522
+ type: string
15523
+ example: '2016-01-21T17:14:49.971Z'
15524
+ description: Timestamp for when the licensee was created
15434
15525
  name:
15435
15526
  type: string
15436
15527
  example: Qwerty Widgets Limited
@@ -15457,6 +15548,10 @@ components:
15457
15548
  - `*.example.com` allows the domain and all its subdomains
15458
15549
  daily:
15459
15550
  type: object
15551
+ required:
15552
+ - limit
15553
+ - count
15554
+ - updatedAt
15460
15555
  properties:
15461
15556
  limit:
15462
15557
  example: 10000
@@ -15466,53 +15561,16 @@ components:
15466
15561
  format: int32
15467
15562
  type: number
15468
15563
  description: The maximum number of lookups this licensee can perform in a day. `null` indicates the limit is not active
15469
- Licensee:
15470
- title: Licensee
15471
- allOf:
15472
- - $ref: '#/components/schemas/LicenseeEditable'
15473
- - type: object
15474
- required:
15475
- - id
15476
- - key
15477
- - createdAt
15478
- - name
15479
- - address
15480
- - postcode
15481
- - whitelist
15482
- - daily
15483
- properties:
15484
- id:
15485
- type: string
15486
- example: 56a11209ebe230380bf104c3
15487
- description: |
15488
- An immutable ID provided for every licensee. Primarily used for paginated list requests.
15489
- key:
15490
- type: string
15491
- example: sl_ijoiqsxeQgXW2gkiE0X94
15492
- description: |
15493
- Uniquely identifies a licensee for a key.
15494
-
15495
- Required to perform paid lookups for a specific licensee. Typically begins `sl_`.
15496
- createdAt:
15564
+ count:
15565
+ example: 232
15566
+ minimum: 0
15567
+ type: integer
15568
+ format: int32
15569
+ description: The number of lookups performed by the licensee on the day represented by `licensees.daily.updatedAt`
15570
+ updatedAt:
15497
15571
  type: string
15498
- example: '2016-01-21T17:14:49.971Z'
15499
- description: Timestamp for when the licensee was created
15500
- daily:
15501
- required:
15502
- - count
15503
- - updatedAt
15504
- type: object
15505
- properties:
15506
- count:
15507
- example: 232
15508
- minimum: 0
15509
- type: number
15510
- format: int32
15511
- description: The number of lookups performed by the licensee on the day represented by `licensees.daily.updatedAt`
15512
- updatedAt:
15513
- type: string
15514
- example: '2016-08-05T16:43:28.865Z'
15515
- description: The timestamp when the limit was last used.
15572
+ example: '2016-08-05T16:43:28.865Z'
15573
+ description: The timestamp when the limit was last used.
15516
15574
  LicenseesResponse:
15517
15575
  title: Licensee List Response
15518
15576
  type: object
@@ -15524,6 +15582,9 @@ components:
15524
15582
  result:
15525
15583
  description: List of licensees
15526
15584
  type: object
15585
+ required:
15586
+ - licensees
15587
+ - hasMore
15527
15588
  properties:
15528
15589
  licensees:
15529
15590
  type: array
@@ -15541,6 +15602,46 @@ components:
15541
15602
  format: int32
15542
15603
  enum:
15543
15604
  - 2000
15605
+ LicenseeEditable:
15606
+ title: Licensee
15607
+ description: Licensee object which can be defined by user
15608
+ type: object
15609
+ properties:
15610
+ name:
15611
+ type: string
15612
+ example: Qwerty Widgets Limited
15613
+ description: Licensee individual or organisation name
15614
+ address:
15615
+ example: 12 High Street, Manchester
15616
+ type: string
15617
+ description: Licensee's first, second and third line address as well as post town concatenated by commas
15618
+ postcode:
15619
+ example: BR8 7RE
15620
+ type: string
15621
+ description: Licensee's postcode
15622
+ whitelist:
15623
+ type: array
15624
+ items:
15625
+ type: string
15626
+ example: https://www.example.com
15627
+ description: |-
15628
+ A list of allowed URLs. An empty list disables the check.
15629
+
15630
+ A request is allowed when its `Origin` or `Referer` header matches an entry. Use one of these formats:
15631
+
15632
+ - `https://www.example.com` allows one site. Scheme and host must match
15633
+ - `*.example.com` allows the domain and all its subdomains
15634
+ daily:
15635
+ type: object
15636
+ properties:
15637
+ limit:
15638
+ example: 10000
15639
+ x-nullable: true
15640
+ nullable: true
15641
+ minimum: 0
15642
+ format: int32
15643
+ type: number
15644
+ description: The maximum number of lookups this licensee can perform in a day. `null` indicates the limit is not active
15544
15645
  LicenseeResponse:
15545
15646
  title: Licensee Response
15546
15647
  type: object
@@ -15572,11 +15673,11 @@ components:
15572
15673
  updatedAt:
15573
15674
  type: string
15574
15675
  example: '2016-01-21T17:14:49.971Z'
15575
- description: Timestamp for when the config was created
15676
+ description: Timestamp for when the config was last updated
15576
15677
  createdAt:
15577
15678
  type: string
15578
15679
  example: '2016-01-21T17:14:49.971Z'
15579
- description: Timestamp for when the config was updated
15680
+ description: Timestamp for when the config was created
15580
15681
  name:
15581
15682
  type: string
15582
15683
  example: woocommerce