@addresszen/openapi 4.2.0 → 4.3.1

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.2.0
3
+ version: 4.3.1
4
4
  license:
5
5
  name: Copyright (C) IDDQD Limited - All Rights Reserved
6
6
  url: https://terms.addresszen.com
@@ -47,7 +47,7 @@ info:
47
47
 
48
48
  | Credential | Looks like | Authenticates | Exposure |
49
49
  | --- | --- | --- | --- |
50
- | API Key | `ak_test` | Address, postcode and place lookups. Every billable request | Usable in a browser. Restrict it with allowed URLs |
50
+ | API Key | `ak_test` | Address, postal code and place lookups. Every billable request | Usable in a browser. Restrict it with allowed URLs |
51
51
  | Management Key | `uk_...` | Managing a key under `/keys/{key}`: usage, licensees, configs | Secret. Server side only |
52
52
 
53
53
  Requests that manage a key, under `/keys/{key}`, take your **Management Key** instead: `Authorization: Bearer uk_...`. The API key is already in the path. The management key was previously called the user token.
@@ -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
@@ -316,17 +316,20 @@ paths:
316
316
  - lang: Ruby
317
317
  label: Ruby
318
318
  source: |
319
- require "net/http"
320
- require "json"
319
+ # gem install addresszen
320
+ require "addresszen"
321
321
 
322
- uri = URI("https://api.addresszen.com/v1/keys/ak_test")
323
- result = JSON.parse(Net::HTTP.get(uri))["result"]
322
+ client = AddressZen::Client.new(api_key: "ak_test")
323
+ result = client.key_availability("ak_test").result
324
324
  - lang: PHP
325
325
  label: PHP
326
326
  source: |
327
327
  <?php
328
328
  $response = file_get_contents("https://api.addresszen.com/v1/keys/ak_test");
329
329
  $result = json_decode($response, true)["result"];
330
+ - lang: Go
331
+ label: Go
332
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.KeyAvailability(context.Background(), \"ak_test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
330
333
  /keys/{key}/details:
331
334
  get:
332
335
  tags:
@@ -391,12 +394,11 @@ paths:
391
394
  - lang: Ruby
392
395
  label: Ruby
393
396
  source: |
394
- require "net/http"
395
- require "json"
397
+ # gem install addresszen
398
+ require "addresszen"
396
399
 
397
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/details")
398
- uri.query = URI.encode_www_form(user_token: "uk_secret")
399
- result = JSON.parse(Net::HTTP.get(uri))["result"]
400
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
401
+ result = client.key_details("ak_test").result
400
402
  - lang: PHP
401
403
  label: PHP
402
404
  source: |
@@ -408,6 +410,9 @@ paths:
408
410
  ])
409
411
  );
410
412
  $result = json_decode($response, true)["result"];
413
+ - lang: Go
414
+ label: Go
415
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.KeyDetails(context.Background(), \"ak_test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
411
416
  put:
412
417
  tags:
413
418
  - Keys
@@ -496,21 +501,16 @@ paths:
496
501
  - lang: Ruby
497
502
  label: Ruby
498
503
  source: |
499
- require "net/http"
500
- require "json"
504
+ # gem install addresszen
505
+ require "addresszen"
501
506
 
502
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/details?user_token=uk_secret")
503
- body = {
507
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
508
+ result = client.update_key_details(
509
+ "ak_test",
504
510
  name: "My Updated Key",
505
- daily_limit: {
506
- limit: 1000,
507
- },
508
- notifications: {
509
- enabled: true,
510
- },
511
- }
512
- response = Net::HTTP.put(uri, body.to_json, "Content-Type" => "application/json")
513
- result = JSON.parse(response.body)["result"]
511
+ daily_limit: { limit: 1000 },
512
+ notifications: { enabled: true }
513
+ ).result
514
514
  - lang: PHP
515
515
  label: PHP
516
516
  source: |
@@ -531,6 +531,9 @@ paths:
531
531
  CURLOPT_RETURNTRANSFER => true,
532
532
  ]);
533
533
  $result = json_decode(curl_exec($ch), true)["result"];
534
+ - lang: Go
535
+ label: Go
536
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.UpdateKeyDetails(context.Background(), \"ak_test\", addresszen.UpdateKeyDetailsBody{\n\t\tName: new(\"My Updated Key\"),\n\t\tDailyLimit: map[string]any{\"limit\": 1000},\n\t\tNotifications: map[string]any{\"enabled\": true},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
534
537
  /keys/{key}/usage:
535
538
  get:
536
539
  tags:
@@ -597,12 +600,11 @@ paths:
597
600
  - lang: Ruby
598
601
  label: Ruby
599
602
  source: |
600
- require "net/http"
601
- require "json"
603
+ # gem install addresszen
604
+ require "addresszen"
602
605
 
603
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/usage")
604
- uri.query = URI.encode_www_form(user_token: "uk_secret")
605
- result = JSON.parse(Net::HTTP.get(uri))["result"]
606
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
607
+ result = client.key_usage("ak_test").result
606
608
  - lang: PHP
607
609
  label: PHP
608
610
  source: |
@@ -614,6 +616,9 @@ paths:
614
616
  ])
615
617
  );
616
618
  $result = json_decode($response, true)["result"];
619
+ - lang: Go
620
+ label: Go
621
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.KeyUsage(context.Background(), \"ak_test\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
617
622
  /keys/{key}/lookups:
618
623
  get:
619
624
  tags:
@@ -645,7 +650,7 @@ paths:
645
650
 
646
651
  ## Data redaction
647
652
 
648
- We redact personally identifiable data (PII) in your usage log weekly, covering the IP, source IP, search term and URL columns.
653
+ We redact personally identifiable information (PII) in your usage log weekly, covering the IP, source IP, search term and URL columns.
649
654
 
650
655
  The default retention is 28 days. Change the period from your dashboard. Set it to `0` days to stop collecting PII altogether.
651
656
  security:
@@ -707,12 +712,11 @@ paths:
707
712
  - lang: Ruby
708
713
  label: Ruby
709
714
  source: |
710
- require "net/http"
711
- require "json"
715
+ # gem install addresszen
716
+ require "addresszen"
712
717
 
713
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/lookups")
714
- uri.query = URI.encode_www_form(user_token: "uk_secret")
715
- result = JSON.parse(Net::HTTP.get(uri))["result"]
718
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
719
+ csv = client.key_logs("ak_test")
716
720
  - lang: PHP
717
721
  label: PHP
718
722
  source: |
@@ -724,6 +728,9 @@ paths:
724
728
  ])
725
729
  );
726
730
  $result = json_decode($response, true)["result"];
731
+ - lang: Go
732
+ label: Go
733
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tcsv, err := client.KeyLogs(context.Background(), \"ak_test\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Print(csv)\n}\n"
727
734
  /verify/addresses:
728
735
  post:
729
736
  tags:
@@ -753,6 +760,7 @@ paths:
753
760
  parameters:
754
761
  - $ref: '#/components/parameters/ApiKeyParam'
755
762
  - $ref: '#/components/parameters/TagsParam'
763
+ - $ref: '#/components/parameters/RemoveFirmParam'
756
764
  - name: context
757
765
  in: query
758
766
  schema:
@@ -844,15 +852,11 @@ paths:
844
852
  - lang: Ruby
845
853
  label: Ruby
846
854
  source: |
847
- require "net/http"
848
- require "json"
855
+ # gem install addresszen
856
+ require "addresszen"
849
857
 
850
- uri = URI("https://api.addresszen.com/v1/verify/addresses")
851
- body = {
852
- query: "123 Main St, Springfield, IL 62701",
853
- }
854
- response = Net::HTTP.post(uri, body.to_json, "Authorization" => 'api_key="ak_test"', "Content-Type" => "application/json")
855
- result = JSON.parse(response.body)["result"]
858
+ client = AddressZen::Client.new(api_key: "ak_test")
859
+ result = client.address_verify(query: "123 Main St, Springfield, IL 62701").result
856
860
  - lang: PHP
857
861
  label: PHP
858
862
  source: |
@@ -867,6 +871,9 @@ paths:
867
871
  CURLOPT_RETURNTRANSFER => true,
868
872
  ]);
869
873
  $result = json_decode(curl_exec($ch), true)["result"];
874
+ - lang: Go
875
+ label: Go
876
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.AddressVerify(context.Background(), addresszen.AddressVerifyBody{\n\t\tQuery: \"123 Main St, Springfield, IL 62701\",\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result.Variant())\n}\n"
870
877
  /autocomplete/addresses:
871
878
  get:
872
879
  tags:
@@ -883,7 +890,7 @@ paths:
883
890
 
884
891
  ## Coverage
885
892
 
886
- 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.
893
+ 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
894
 
888
895
  ## Filters
889
896
 
@@ -893,7 +900,7 @@ paths:
893
900
 
894
901
  ## Address bias
895
902
 
896
- 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.
903
+ 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.
897
904
 
898
905
  ## Suggestion format
899
906
 
@@ -1057,12 +1064,11 @@ paths:
1057
1064
  - lang: Ruby
1058
1065
  label: Ruby
1059
1066
  source: |
1060
- require "net/http"
1061
- require "json"
1067
+ # gem install addresszen
1068
+ require "addresszen"
1062
1069
 
1063
- uri = URI("https://api.addresszen.com/v1/autocomplete/addresses")
1064
- uri.query = URI.encode_www_form(api_key: "ak_test", query: "1600 Pennsylvania")
1065
- result = JSON.parse(Net::HTTP.get(uri))["result"]
1070
+ client = AddressZen::Client.new(api_key: "ak_test")
1071
+ result = client.find_address(query: "1600 Pennsylvania").result
1066
1072
  - lang: PHP
1067
1073
  label: PHP
1068
1074
  source: |
@@ -1075,6 +1081,9 @@ paths:
1075
1081
  ])
1076
1082
  );
1077
1083
  $result = json_decode($response, true)["result"];
1084
+ - lang: Go
1085
+ label: Go
1086
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.FindAddress(context.Background(), &addresszen.FindAddressParams{\n\t\tQuery: \"1600 Pennsylvania\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1078
1087
  /autocomplete/addresses/{address}/usa:
1079
1088
  get:
1080
1089
  tags:
@@ -1106,6 +1115,7 @@ paths:
1106
1115
  - $ref: '#/components/parameters/LicenseeParam'
1107
1116
  - $ref: '#/components/parameters/FilterParam'
1108
1117
  - $ref: '#/components/parameters/TagsParam'
1118
+ - $ref: '#/components/parameters/RemoveFirmParam'
1109
1119
  responses:
1110
1120
  '200':
1111
1121
  description: Success
@@ -1173,12 +1183,11 @@ paths:
1173
1183
  - lang: Ruby
1174
1184
  label: Ruby
1175
1185
  source: |
1176
- require "net/http"
1177
- require "json"
1186
+ # gem install addresszen
1187
+ require "addresszen"
1178
1188
 
1179
- uri = URI("https://api.addresszen.com/v1/autocomplete/addresses/usps_V118834572%7C310%7C%7C3191/usa")
1180
- uri.query = URI.encode_www_form(api_key: "ak_test")
1181
- result = JSON.parse(Net::HTTP.get(uri))["result"]
1189
+ client = AddressZen::Client.new(api_key: "ak_test")
1190
+ result = client.retrieve_address("usps_V118834572|310||3191").result
1182
1191
  - lang: PHP
1183
1192
  label: PHP
1184
1193
  source: |
@@ -1190,6 +1199,9 @@ paths:
1190
1199
  ])
1191
1200
  );
1192
1201
  $result = json_decode($response, true)["result"];
1202
+ - lang: Go
1203
+ label: Go
1204
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.RetrieveAddress(context.Background(), \"usps_V118834572|310||3191\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1193
1205
  /places:
1194
1206
  get:
1195
1207
  tags:
@@ -1311,12 +1323,11 @@ paths:
1311
1323
  - lang: Ruby
1312
1324
  label: Ruby
1313
1325
  source: |
1314
- require "net/http"
1315
- require "json"
1326
+ # gem install addresszen
1327
+ require "addresszen"
1316
1328
 
1317
- uri = URI("https://api.addresszen.com/v1/places")
1318
- uri.query = URI.encode_www_form(api_key: "ak_test", query: "london")
1319
- result = JSON.parse(Net::HTTP.get(uri))["result"]
1329
+ client = AddressZen::Client.new(api_key: "ak_test")
1330
+ result = client.find_place(query: "london").result
1320
1331
  - lang: PHP
1321
1332
  label: PHP
1322
1333
  source: |
@@ -1329,6 +1340,9 @@ paths:
1329
1340
  ])
1330
1341
  );
1331
1342
  $result = json_decode($response, true)["result"];
1343
+ - lang: Go
1344
+ label: Go
1345
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.FindPlace(context.Background(), &addresszen.FindPlaceParams{\n\t\tQuery: \"london\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfor _, hit := range res.Result.Hits {\n\t\tfmt.Printf(\"%+v\\n\", hit.Variant())\n\t}\n}\n"
1332
1346
  /places/{place}:
1333
1347
  get:
1334
1348
  tags:
@@ -1529,11 +1543,11 @@ paths:
1529
1543
  - lang: http
1530
1544
  label: URL
1531
1545
  source: |
1532
- https://api.addresszen.com/v1/places/geonames_5353?api_key=ak_test
1546
+ https://api.addresszen.com/v1/places/geonames_2643743?api_key=ak_test
1533
1547
  - lang: cURL
1534
1548
  label: curl
1535
1549
  source: |
1536
- curl -G 'https://api.addresszen.com/v1/places/geonames_5353' \
1550
+ curl -G 'https://api.addresszen.com/v1/places/geonames_2643743' \
1537
1551
  -d 'api_key=ak_test'
1538
1552
  - lang: JavaScript
1539
1553
  label: JavaScript
@@ -1544,7 +1558,7 @@ paths:
1544
1558
 
1545
1559
  const { data } = await resolvePlace({
1546
1560
  client,
1547
- path: { place: 'geonames_5353' },
1561
+ path: { place: 'geonames_2643743' },
1548
1562
  });
1549
1563
  - lang: Python
1550
1564
  label: Python
@@ -1553,33 +1567,35 @@ paths:
1553
1567
  from addresszen import AddressZen
1554
1568
 
1555
1569
  with AddressZen("ak_test") as client:
1556
- result = client.resolve_place("geonames_5353")
1570
+ result = client.resolve_place("geonames_2643743")
1557
1571
  - lang: Ruby
1558
1572
  label: Ruby
1559
1573
  source: |
1560
- require "net/http"
1561
- require "json"
1574
+ # gem install addresszen
1575
+ require "addresszen"
1562
1576
 
1563
- uri = URI("https://api.addresszen.com/v1/places/geonames_5353")
1564
- uri.query = URI.encode_www_form(api_key: "ak_test")
1565
- result = JSON.parse(Net::HTTP.get(uri))["result"]
1577
+ client = AddressZen::Client.new(api_key: "ak_test")
1578
+ result = client.resolve_place("geonames_2643743").result
1566
1579
  - lang: PHP
1567
1580
  label: PHP
1568
1581
  source: |
1569
1582
  <?php
1570
1583
  $response = file_get_contents(
1571
- "https://api.addresszen.com/v1/places/geonames_5353?" .
1584
+ "https://api.addresszen.com/v1/places/geonames_2643743?" .
1572
1585
  http_build_query([
1573
1586
  "api_key" => "ak_test",
1574
1587
  ])
1575
1588
  );
1576
1589
  $result = json_decode($response, true)["result"];
1590
+ - lang: Go
1591
+ label: Go
1592
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.ResolvePlace(context.Background(), \"geonames_2643743\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1577
1593
  /keys/{key}/licensees:
1578
1594
  get:
1579
1595
  tags:
1580
1596
  - Licensees
1581
1597
  summary: List
1582
- description: Returns a key's licensees, oldest first, up to 100 per request. The list omits canceled licensees. The key must be enabled for sub-licensing.
1598
+ description: Returns a key's licensees, oldest first, up to 100 per request. The list omits canceled licensees. The key must be enabled for sublicensing.
1583
1599
  operationId: ListLicensees
1584
1600
  security:
1585
1601
  - ManagementKey: []
@@ -1587,12 +1603,11 @@ paths:
1587
1603
  - $ref: '#/components/parameters/ApiKeyPathParam'
1588
1604
  - name: starting_after
1589
1605
  in: query
1590
- description: ID of the licensee after which to list results
1606
+ description: ID of the licensee after which to list results. Pass the `id` of the last licensee on the previous page.
1591
1607
  style: form
1592
1608
  explode: false
1593
1609
  schema:
1594
- type: integer
1595
- format: int32
1610
+ type: string
1596
1611
  - $ref: '#/components/parameters/UserTokenParam'
1597
1612
  - $ref: '#/components/parameters/LimitParam'
1598
1613
  - name: query
@@ -1647,12 +1662,11 @@ paths:
1647
1662
  - lang: Ruby
1648
1663
  label: Ruby
1649
1664
  source: |
1650
- require "net/http"
1651
- require "json"
1665
+ # gem install addresszen
1666
+ require "addresszen"
1652
1667
 
1653
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees")
1654
- uri.query = URI.encode_www_form(user_token: "uk_secret")
1655
- result = JSON.parse(Net::HTTP.get(uri))["result"]
1668
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
1669
+ result = client.list_licensees("ak_test").result
1656
1670
  - lang: PHP
1657
1671
  label: PHP
1658
1672
  source: |
@@ -1664,11 +1678,14 @@ paths:
1664
1678
  ])
1665
1679
  );
1666
1680
  $result = json_decode($response, true)["result"];
1681
+ - lang: Go
1682
+ label: Go
1683
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.ListLicensees(context.Background(), \"ak_test\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1667
1684
  post:
1668
1685
  tags:
1669
1686
  - Licensees
1670
1687
  summary: Create
1671
- description: Creates a licensee on a key and returns it with its generated `sl_` key. The key must be enabled for sub-licensing.
1688
+ description: Creates a licensee on a key and returns it with its generated `sl_` key. The key must be enabled for sublicensing.
1672
1689
  operationId: CreateLicensee
1673
1690
  security:
1674
1691
  - ManagementKey: []
@@ -1701,9 +1718,9 @@ paths:
1701
1718
  curl -X POST 'https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret' \
1702
1719
  -H 'Content-Type: application/json' \
1703
1720
  -d '{
1704
- "name": "Qwerty Widgets Limited",
1705
- "address": "12 High Street, Manchester",
1706
- "postcode": "BR8 7RE",
1721
+ "name": "Acme Inc",
1722
+ "address": "1010 Cauthen Ln, Alamogordo, NM",
1723
+ "postcode": "88310",
1707
1724
  "whitelist": [],
1708
1725
  "daily": {
1709
1726
  "limit": 10000
@@ -1720,9 +1737,9 @@ paths:
1720
1737
  client,
1721
1738
  path: { key: 'ak_test' },
1722
1739
  body: {
1723
- name: 'Qwerty Widgets Limited',
1724
- address: '12 High Street, Manchester',
1725
- postcode: 'BR8 7RE',
1740
+ name: 'Acme Inc',
1741
+ address: '1010 Cauthen Ln, Alamogordo, NM',
1742
+ postcode: '88310',
1726
1743
  whitelist: [],
1727
1744
  daily: {
1728
1745
  limit: 10000,
@@ -1739,30 +1756,27 @@ paths:
1739
1756
  result = client.create_licensee(
1740
1757
  "ak_test",
1741
1758
  user_token="uk_secret",
1742
- name="Qwerty Widgets Limited",
1743
- address="12 High Street, Manchester",
1744
- postcode="BR8 7RE",
1759
+ name="Acme Inc",
1760
+ address="1010 Cauthen Ln, Alamogordo, NM",
1761
+ postcode="88310",
1745
1762
  whitelist=[],
1746
1763
  daily={"limit": 10000},
1747
1764
  )
1748
1765
  - lang: Ruby
1749
1766
  label: Ruby
1750
1767
  source: |
1751
- require "net/http"
1752
- require "json"
1768
+ # gem install addresszen
1769
+ require "addresszen"
1753
1770
 
1754
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret")
1755
- body = {
1756
- name: "Qwerty Widgets Limited",
1757
- address: "12 High Street, Manchester",
1758
- postcode: "BR8 7RE",
1771
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
1772
+ result = client.create_licensee(
1773
+ "ak_test",
1774
+ name: "Acme Inc",
1775
+ address: "1010 Cauthen Ln, Alamogordo, NM",
1776
+ postcode: "88310",
1759
1777
  whitelist: [],
1760
- daily: {
1761
- limit: 10000,
1762
- },
1763
- }
1764
- response = Net::HTTP.post(uri, body.to_json, "Content-Type" => "application/json")
1765
- result = JSON.parse(response.body)["result"]
1778
+ daily: { limit: 10000 }
1779
+ ).result
1766
1780
  - lang: PHP
1767
1781
  label: PHP
1768
1782
  source: |
@@ -1772,9 +1786,9 @@ paths:
1772
1786
  CURLOPT_POST => true,
1773
1787
  CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
1774
1788
  CURLOPT_POSTFIELDS => json_encode([
1775
- "name" => "Qwerty Widgets Limited",
1776
- "address" => "12 High Street, Manchester",
1777
- "postcode" => "BR8 7RE",
1789
+ "name" => "Acme Inc",
1790
+ "address" => "1010 Cauthen Ln, Alamogordo, NM",
1791
+ "postcode" => "88310",
1778
1792
  "whitelist" => [],
1779
1793
  "daily" => [
1780
1794
  "limit" => 10000,
@@ -1783,6 +1797,9 @@ paths:
1783
1797
  CURLOPT_RETURNTRANSFER => true,
1784
1798
  ]);
1785
1799
  $result = json_decode(curl_exec($ch), true)["result"];
1800
+ - lang: Go
1801
+ label: Go
1802
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.CreateLicensee(context.Background(), \"ak_test\", addresszen.CreateLicenseeBody{\n\t\tName: new(\"Acme Inc\"),\n\t\tAddress: new(\"1010 Cauthen Ln, Alamogordo, NM\"),\n\t\tPostcode: new(\"88310\"),\n\t\tWhitelist: new([]string{}),\n\t\tDaily: map[string]any{\"limit\": 10000},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1786
1803
  /keys/{key}/licensees/{licensee}:
1787
1804
  get:
1788
1805
  tags:
@@ -1842,12 +1859,11 @@ paths:
1842
1859
  - lang: Ruby
1843
1860
  label: Ruby
1844
1861
  source: |
1845
- require "net/http"
1846
- require "json"
1862
+ # gem install addresszen
1863
+ require "addresszen"
1847
1864
 
1848
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94")
1849
- uri.query = URI.encode_www_form(user_token: "uk_secret")
1850
- result = JSON.parse(Net::HTTP.get(uri))["result"]
1865
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
1866
+ result = client.retrieve_licensee("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94").result
1851
1867
  - lang: PHP
1852
1868
  label: PHP
1853
1869
  source: |
@@ -1859,6 +1875,9 @@ paths:
1859
1875
  ])
1860
1876
  );
1861
1877
  $result = json_decode($response, true)["result"];
1878
+ - lang: Go
1879
+ label: Go
1880
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.RetrieveLicensee(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1862
1881
  delete:
1863
1882
  tags:
1864
1883
  - Licensees
@@ -1890,7 +1909,7 @@ paths:
1890
1909
  - deleted
1891
1910
  properties:
1892
1911
  deleted:
1893
- type: number
1912
+ type: integer
1894
1913
  format: int32
1895
1914
  example: 1
1896
1915
  minimum: 0
@@ -1936,12 +1955,11 @@ paths:
1936
1955
  - lang: Ruby
1937
1956
  label: Ruby
1938
1957
  source: |
1939
- require "net/http"
1958
+ # gem install addresszen
1959
+ require "addresszen"
1940
1960
 
1941
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret")
1942
- Net::HTTP.start(uri.host, use_ssl: true) do |http|
1943
- http.delete(uri.request_uri)
1944
- end
1961
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
1962
+ result = client.delete_licensee("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94").result
1945
1963
  - lang: PHP
1946
1964
  label: PHP
1947
1965
  source: |
@@ -1952,6 +1970,9 @@ paths:
1952
1970
  CURLOPT_RETURNTRANSFER => true,
1953
1971
  ]);
1954
1972
  curl_exec($ch);
1973
+ - lang: Go
1974
+ label: Go
1975
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.DeleteLicensee(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1955
1976
  post:
1956
1977
  tags:
1957
1978
  - Licensees
@@ -2026,17 +2047,11 @@ paths:
2026
2047
  - lang: Ruby
2027
2048
  label: Ruby
2028
2049
  source: |
2029
- require "net/http"
2030
- require "json"
2050
+ # gem install addresszen
2051
+ require "addresszen"
2031
2052
 
2032
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret")
2033
- body = {
2034
- daily: {
2035
- limit: 20000,
2036
- },
2037
- }
2038
- response = Net::HTTP.post(uri, body.to_json, "Content-Type" => "application/json")
2039
- result = JSON.parse(response.body)["result"]
2053
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
2054
+ result = client.update_licensee("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94", daily: { limit: 20000 }).result
2040
2055
  - lang: PHP
2041
2056
  label: PHP
2042
2057
  source: |
@@ -2053,6 +2068,9 @@ paths:
2053
2068
  CURLOPT_RETURNTRANSFER => true,
2054
2069
  ]);
2055
2070
  $result = json_decode(curl_exec($ch), true)["result"];
2071
+ - lang: Go
2072
+ label: Go
2073
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.UpdateLicensee(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\", addresszen.UpdateLicenseeBody{\n\t\tDaily: map[string]any{\"limit\": 20000},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2056
2074
  /keys/{key}/licensees/{licensee}/regenerate-key:
2057
2075
  post:
2058
2076
  tags:
@@ -2106,12 +2124,11 @@ paths:
2106
2124
  - lang: Ruby
2107
2125
  label: Ruby
2108
2126
  source: |
2109
- require "net/http"
2110
- require "json"
2127
+ # gem install addresszen
2128
+ require "addresszen"
2111
2129
 
2112
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94/regenerate-key?user_token=uk_secret")
2113
- response = Net::HTTP.post(uri, "")
2114
- result = JSON.parse(response.body)["result"]
2130
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
2131
+ result = client.regenerate_licensee_key("ak_test", "sl_ijoiqsxeQgXW2gkiE0X94").result
2115
2132
  - lang: PHP
2116
2133
  label: PHP
2117
2134
  source: |
@@ -2122,6 +2139,9 @@ paths:
2122
2139
  CURLOPT_RETURNTRANSFER => true,
2123
2140
  ]);
2124
2141
  $result = json_decode(curl_exec($ch), true)["result"];
2142
+ - lang: Go
2143
+ label: Go
2144
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.RegenerateLicenseeKey(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2125
2145
  /keys/{key}/configs:
2126
2146
  get:
2127
2147
  tags:
@@ -2179,12 +2199,11 @@ paths:
2179
2199
  - lang: Ruby
2180
2200
  label: Ruby
2181
2201
  source: |
2182
- require "net/http"
2183
- require "json"
2202
+ # gem install addresszen
2203
+ require "addresszen"
2184
2204
 
2185
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/configs")
2186
- uri.query = URI.encode_www_form(user_token: "uk_secret")
2187
- result = JSON.parse(Net::HTTP.get(uri))["result"]
2205
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
2206
+ result = client.list_configs("ak_test").result
2188
2207
  - lang: PHP
2189
2208
  label: PHP
2190
2209
  source: |
@@ -2196,6 +2215,9 @@ paths:
2196
2215
  ])
2197
2216
  );
2198
2217
  $result = json_decode($response, true)["result"];
2218
+ - lang: Go
2219
+ label: Go
2220
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.ListConfigs(context.Background(), \"ak_test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2199
2221
  post:
2200
2222
  tags:
2201
2223
  - Configs
@@ -2269,16 +2291,15 @@ paths:
2269
2291
  - lang: Ruby
2270
2292
  label: Ruby
2271
2293
  source: |
2272
- require "net/http"
2273
- require "json"
2294
+ # gem install addresszen
2295
+ require "addresszen"
2274
2296
 
2275
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/configs?user_token=uk_secret")
2276
- body = {
2297
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
2298
+ result = client.create_config(
2299
+ "ak_test",
2277
2300
  name: "woocommerce",
2278
- payload: '{"removeOrganisation": false}',
2279
- }
2280
- response = Net::HTTP.post(uri, body.to_json, "Content-Type" => "application/json")
2281
- result = JSON.parse(response.body)["result"]
2301
+ payload: '{"removeOrganisation": false}'
2302
+ ).result
2282
2303
  - lang: PHP
2283
2304
  label: PHP
2284
2305
  source: |
@@ -2294,6 +2315,9 @@ paths:
2294
2315
  CURLOPT_RETURNTRANSFER => true,
2295
2316
  ]);
2296
2317
  $result = json_decode(curl_exec($ch), true)["result"];
2318
+ - lang: Go
2319
+ label: Go
2320
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.CreateConfig(context.Background(), \"ak_test\", addresszen.CreateConfigBody{\n\t\tName: \"woocommerce\",\n\t\tPayload: `{\"removeOrganisation\": false}`,\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2297
2321
  /keys/{key}/configs/{config}:
2298
2322
  get:
2299
2323
  tags:
@@ -2356,12 +2380,11 @@ paths:
2356
2380
  - lang: Ruby
2357
2381
  label: Ruby
2358
2382
  source: |
2359
- require "net/http"
2360
- require "json"
2383
+ # gem install addresszen
2384
+ require "addresszen"
2361
2385
 
2362
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce")
2363
- uri.query = URI.encode_www_form(user_token: "uk_secret")
2364
- result = JSON.parse(Net::HTTP.get(uri))["result"]
2386
+ client = AddressZen::Client.new(api_key: "ak_test")
2387
+ result = client.retrieve_config("ak_test", "woocommerce").result
2365
2388
  - lang: PHP
2366
2389
  label: PHP
2367
2390
  source: |
@@ -2373,6 +2396,9 @@ paths:
2373
2396
  ])
2374
2397
  );
2375
2398
  $result = json_decode($response, true)["result"];
2399
+ - lang: Go
2400
+ label: Go
2401
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.RetrieveConfig(context.Background(), \"ak_test\", \"woocommerce\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2376
2402
  delete:
2377
2403
  tags:
2378
2404
  - Configs
@@ -2404,7 +2430,7 @@ paths:
2404
2430
  - deleted
2405
2431
  properties:
2406
2432
  deleted:
2407
- type: number
2433
+ type: integer
2408
2434
  format: int32
2409
2435
  example: 1
2410
2436
  minimum: 0
@@ -2456,12 +2482,11 @@ paths:
2456
2482
  - lang: Ruby
2457
2483
  label: Ruby
2458
2484
  source: |
2459
- require "net/http"
2485
+ # gem install addresszen
2486
+ require "addresszen"
2460
2487
 
2461
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret")
2462
- Net::HTTP.start(uri.host, use_ssl: true) do |http|
2463
- http.delete(uri.request_uri)
2464
- end
2488
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
2489
+ result = client.delete_config("ak_test", "woocommerce").result
2465
2490
  - lang: PHP
2466
2491
  label: PHP
2467
2492
  source: |
@@ -2472,6 +2497,9 @@ paths:
2472
2497
  CURLOPT_RETURNTRANSFER => true,
2473
2498
  ]);
2474
2499
  curl_exec($ch);
2500
+ - lang: Go
2501
+ label: Go
2502
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.DeleteConfig(context.Background(), \"ak_test\", \"woocommerce\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2475
2503
  post:
2476
2504
  tags:
2477
2505
  - Configs
@@ -2550,15 +2578,11 @@ paths:
2550
2578
  - lang: Ruby
2551
2579
  label: Ruby
2552
2580
  source: |
2553
- require "net/http"
2554
- require "json"
2581
+ # gem install addresszen
2582
+ require "addresszen"
2555
2583
 
2556
- uri = URI("https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret")
2557
- body = {
2558
- payload: '{"removeOrganisation": true}',
2559
- }
2560
- response = Net::HTTP.post(uri, body.to_json, "Content-Type" => "application/json")
2561
- result = JSON.parse(response.body)["result"]
2584
+ client = AddressZen::Client.new(api_key: "ak_test", management_key: "uk_secret")
2585
+ result = client.update_config("ak_test", "woocommerce", payload: '{"removeOrganisation": true}').result
2562
2586
  - lang: PHP
2563
2587
  label: PHP
2564
2588
  source: |
@@ -2573,6 +2597,9 @@ paths:
2573
2597
  CURLOPT_RETURNTRANSFER => true,
2574
2598
  ]);
2575
2599
  $result = json_decode(curl_exec($ch), true)["result"];
2600
+ - lang: Go
2601
+ label: Go
2602
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.UpdateConfig(context.Background(), \"ak_test\", \"woocommerce\", addresszen.UpdateConfigBody{\n\t\tPayload: new(`{\"removeOrganisation\": true}`),\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2576
2603
  /emails:
2577
2604
  get:
2578
2605
  tags:
@@ -2658,12 +2685,11 @@ paths:
2658
2685
  - lang: Ruby
2659
2686
  label: Ruby
2660
2687
  source: |
2661
- require "net/http"
2662
- require "json"
2688
+ # gem install addresszen
2689
+ require "addresszen"
2663
2690
 
2664
- uri = URI("https://api.addresszen.com/v1/emails")
2665
- uri.query = URI.encode_www_form(api_key: "ak_test", query: "foo@domain.com")
2666
- result = JSON.parse(Net::HTTP.get(uri))["result"]
2691
+ client = AddressZen::Client.new(api_key: "ak_test")
2692
+ result = client.email_validation(query: "foo@domain.com").result
2667
2693
  - lang: PHP
2668
2694
  label: PHP
2669
2695
  source: |
@@ -2676,6 +2702,9 @@ paths:
2676
2702
  ])
2677
2703
  );
2678
2704
  $result = json_decode($response, true)["result"];
2705
+ - lang: Go
2706
+ label: Go
2707
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.EmailValidation(context.Background(), \"foo@domain.com\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result.Variant())\n}\n"
2679
2708
  /phone_numbers:
2680
2709
  get:
2681
2710
  tags:
@@ -2783,12 +2812,11 @@ paths:
2783
2812
  - lang: Ruby
2784
2813
  label: Ruby
2785
2814
  source: |
2786
- require "net/http"
2787
- require "json"
2815
+ # gem install addresszen
2816
+ require "addresszen"
2788
2817
 
2789
- uri = URI("https://api.addresszen.com/v1/phone_numbers")
2790
- uri.query = URI.encode_www_form(api_key: "ak_test", query: "02071128019")
2791
- result = JSON.parse(Net::HTTP.get(uri))["result"]
2818
+ client = AddressZen::Client.new(api_key: "ak_test")
2819
+ result = client.phone_number_validation(query: "02071128019").result
2792
2820
  - lang: PHP
2793
2821
  label: PHP
2794
2822
  source: |
@@ -2801,6 +2829,9 @@ paths:
2801
2829
  ])
2802
2830
  );
2803
2831
  $result = json_decode($response, true)["result"];
2832
+ - lang: Go
2833
+ label: Go
2834
+ source: "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.PhoneNumberValidation(context.Background(), \"02071128019\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result.Variant())\n}\n"
2804
2835
  /sign_up:
2805
2836
  post:
2806
2837
  tags:
@@ -2982,6 +3013,9 @@ paths:
2982
3013
  CURLOPT_RETURNTRANSFER => true,
2983
3014
  ]);
2984
3015
  $result = json_decode(curl_exec($ch), true)["result"];
3016
+ - lang: Go
3017
+ label: Go
3018
+ source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tbody, err := json.Marshal(map[string]string{\n\t\t\"email\": \"user@example.com\",\n\t\t\"name\": \"Jane Smith\",\n\t\t\"org_name\": \"Example Corp\",\n\t\t\"org_address_line_one\": \"10 Example Street\",\n\t\t\"org_post_town\": \"London\",\n\t\t\"org_postcode\": \"SW1A 1AA\",\n\t\t\"org_country_code\": \"GB\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tresp, err := http.Post(\"https://api.addresszen.com/v1/sign_up\", \"application/json\", bytes.NewReader(body))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer resp.Body.Close()\n\tvar data map[string]any\n\tif err := json.NewDecoder(resp.Body).Decode(&data); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", data[\"result\"])\n}\n"
2985
3019
  /sign_up/{cli_token}:
2986
3020
  get:
2987
3021
  tags:
@@ -3119,6 +3153,9 @@ paths:
3119
3153
  <?php
3120
3154
  $response = file_get_contents("https://api.addresszen.com/v1/sign_up/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...");
3121
3155
  $result = json_decode($response, true)["result"];
3156
+ - lang: Go
3157
+ label: Go
3158
+ source: "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tresp, err := http.Get(\"https://api.addresszen.com/v1/sign_up/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer resp.Body.Close()\n\tvar data map[string]any\n\tif err := json.NewDecoder(resp.Body).Decode(&data); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", data[\"result\"])\n}\n"
3122
3159
  components:
3123
3160
  securitySchemes:
3124
3161
  ApiKey:
@@ -3165,7 +3202,7 @@ components:
3165
3202
 
3166
3203
  A secret key used to manage your account and API Keys. It was previously called the user token.
3167
3204
 
3168
- Your management key can be retrieved and managed from your [accounts page](https://addresszen.com/account).
3205
+ Your management key can be retrieved and managed from your [accounts page](https://account.addresszen.com/tokens).
3169
3206
 
3170
3207
  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.
3171
3208
  example: uk_B59ScW1p1HHouf1VqclEPZUx
@@ -3238,6 +3275,24 @@ components:
3238
3275
  schema:
3239
3276
  type: string
3240
3277
  style: form
3278
+ RemoveFirmParam:
3279
+ name: remove_firm
3280
+ in: query
3281
+ style: form
3282
+ explode: false
3283
+ required: false
3284
+ description: |
3285
+ **Remove Firm**
3286
+
3287
+ 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.
3288
+
3289
+ Set `remove_firm=true` to enable.
3290
+
3291
+ 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.
3292
+ schema:
3293
+ type: string
3294
+ enum:
3295
+ - 'true'
3241
3296
  DatasetParam:
3242
3297
  name: dataset
3243
3298
  in: query
@@ -3253,7 +3308,8 @@ components:
3253
3308
  Comma-separated list of datasets to search within.
3254
3309
 
3255
3310
  Filters results to only include addresses from the specified datasets. Useful for keys with multiple overlapping datasets enabled (e.g. `paf` and `abp`).
3256
- example: usps
3311
+ example:
3312
+ - usps
3257
3313
  ContextParam:
3258
3314
  name: context
3259
3315
  in: query
@@ -3283,7 +3339,7 @@ components:
3283
3339
 
3284
3340
  Specifies the maximum number of records to retrieve.
3285
3341
 
3286
- By default the limit is 10. Requesting a larger result set adds latency.
3342
+ By default the limit is 10. Requesting a larger result set adds latency. A value above 100 is reduced to 100 without an error.
3287
3343
  BiasLonLatParam:
3288
3344
  name: bias_lonlat
3289
3345
  in: query
@@ -3448,7 +3504,7 @@ components:
3448
3504
  description: |
3449
3505
  **Bias by city**
3450
3506
 
3451
- Boost addresses in the named city, town or locality. Case, spaces and accents are ignored. For UK addresses use `bias_posttown`.
3507
+ Boost addresses in the named city, town or locality. Case, spaces and accents are ignored.
3452
3508
  example: San Francisco
3453
3509
  BiasStateParam:
3454
3510
  name: bias_state
@@ -4559,7 +4615,7 @@ components:
4559
4615
  - 'U1' Unique 5-digit ZIP code.
4560
4616
  dpv_no_stat:
4561
4617
  type: string
4562
- 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"
4618
+ 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"
4563
4619
  enum:
4564
4620
  - 'Y'
4565
4621
  - 'N'
@@ -4604,7 +4660,7 @@ components:
4604
4660
  geo_coded:
4605
4661
  type: boolean
4606
4662
  description: |
4607
- Indicates whether the address was geo-coded
4663
+ Indicates whether the address was geocoded
4608
4664
  lacs_indicator:
4609
4665
  type: string
4610
4666
  description: |
@@ -6612,8 +6668,11 @@ components:
6612
6668
  maxLength: 6
6613
6669
  nullable: true
6614
6670
  description: |
6615
- Current AddressBase classification code (e.g. `RD` residential,
6616
- `CR` commercial retail). Top-level categories: `R` Residential,
6671
+ Current AddressBase classification code, passed through verbatim at
6672
+ whatever level the custodian recorded. Usually tertiary (e.g. `RD03`
6673
+ semi-detached, `RD04` terraced, `RD06` self-contained flat, `CR01`
6674
+ retail), but can be quaternary (`LP03PA`), secondary (`RD`) or primary
6675
+ (`C`). Match on prefix rather than equality. Top-level categories: `R` Residential,
6617
6676
  `C` Commercial, `L` Land, `M` Military, `O` Other, `P` Parent shell,
6618
6677
  `U` Unclassified, `X` Dual use, `Z` Object of interest. NULL when no
6619
6678
  current classification row exists for the UPRN.
@@ -14717,7 +14776,7 @@ components:
14717
14776
 
14718
14777
  - B = Branch
14719
14778
  - C = Community post office (CPO)
14720
- - N = Non-postal community name, former USPS facility, or place name
14779
+ - N = Non-postal community name, former USPS facility or place name
14721
14780
  - P = Post Office
14722
14781
  - S = Station
14723
14782
  - U = Urbanization
@@ -14865,7 +14924,7 @@ components:
14865
14924
  - $ref: '#/components/schemas/UsaCassVerifiedAddress'
14866
14925
  - $ref: '#/components/schemas/Address'
14867
14926
  count:
14868
- type: number
14927
+ type: integer
14869
14928
  description: |
14870
14929
  The number of addresses we matched to the input. We return the closest match by default.
14871
14930
  maximum: 10
@@ -14873,7 +14932,7 @@ components:
14873
14932
  fit:
14874
14933
  type: number
14875
14934
  description: |
14876
- 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.
14935
+ 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.
14877
14936
  maximum: 1
14878
14937
  minimum: 0
14879
14938
  confidence:
@@ -14881,7 +14940,7 @@ components:
14881
14940
  maximum: 1
14882
14941
  minimum: 0
14883
14942
  description: |
14884
- A confidence score represented as number between 1 and 0. 1 indicates a full match. 0 indicates no complete matching elements.
14943
+ A confidence score represented as a number between 1 and 0. 1 indicates a full match. 0 indicates no complete matching elements.
14885
14944
  match_information:
14886
14945
  type: string
14887
14946
  description: |
@@ -14958,7 +15017,7 @@ components:
14958
15017
  enum:
14959
15018
  - null
14960
15019
  count:
14961
- type: number
15020
+ type: integer
14962
15021
  description: ''
14963
15022
  enum:
14964
15023
  - 0
@@ -15105,8 +15164,7 @@ components:
15105
15164
  enum:
15106
15165
  - Success
15107
15166
  result:
15108
- allOf:
15109
- - $ref: '#/components/schemas/Address'
15167
+ $ref: '#/components/schemas/Address'
15110
15168
  place_id:
15111
15169
  title: ID
15112
15170
  type: string
@@ -15502,14 +15560,14 @@ components:
15502
15560
  description: Timestamp for when the licensee was created
15503
15561
  name:
15504
15562
  type: string
15505
- example: Qwerty Widgets Limited
15563
+ example: Acme Inc
15506
15564
  description: Licensee individual or organisation name
15507
15565
  address:
15508
- example: 12 High Street, Manchester
15566
+ example: 1010 Cauthen Ln, Alamogordo, NM
15509
15567
  type: string
15510
15568
  description: Licensee's first, second and third line address as well as post town concatenated by commas
15511
15569
  postcode:
15512
- example: BR8 7RE
15570
+ example: '88310'
15513
15571
  type: string
15514
15572
  description: Licensee's postcode
15515
15573
  whitelist:
@@ -15542,7 +15600,7 @@ components:
15542
15600
  count:
15543
15601
  example: 232
15544
15602
  minimum: 0
15545
- type: number
15603
+ type: integer
15546
15604
  format: int32
15547
15605
  description: The number of lookups performed by the licensee on the day represented by `licensees.daily.updatedAt`
15548
15606
  updatedAt:
@@ -15587,14 +15645,14 @@ components:
15587
15645
  properties:
15588
15646
  name:
15589
15647
  type: string
15590
- example: Qwerty Widgets Limited
15648
+ example: Acme Inc
15591
15649
  description: Licensee individual or organisation name
15592
15650
  address:
15593
- example: 12 High Street, Manchester
15651
+ example: 1010 Cauthen Ln, Alamogordo, NM
15594
15652
  type: string
15595
15653
  description: Licensee's first, second and third line address as well as post town concatenated by commas
15596
15654
  postcode:
15597
- example: BR8 7RE
15655
+ example: '88310'
15598
15656
  type: string
15599
15657
  description: Licensee's postcode
15600
15658
  whitelist: