-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.ts
9378 lines (9374 loc) · 319 KB
/
openapi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/postcodes/{postcode}": {
/**
* Returns the complete list of addresses for a postcode. Postcode searches are space and case insensitive.
*
* The Postcode Lookup API provides a JSON interface to search UK addresses from a postcode. It can be used to power Postcode Lookup driven address searches, like [Postcode Lookup](/postcode-lookup).
*
* ## Postcode Not Found
*
* Lookup balance is unaffected by invalid postcodes. The API returns a `404` response with response body:
*
* ```json
* {
* "code": 4040,
* "message": "Postcode not found",
* "suggestions": ["SW1A 0AA"]
* }
* ```
*
* ### Suggestions
*
* If a postcode cannot be found, the API will provide up to 5 closest matching postcodes. Common errors will be corrected first (e.g. mixing up `O` and `0` or `I` and `1`).
*
* If the suggestion list is small (fewer than 3), there is a high probability the correct postcode is there. You may notify the user or immediately trigger new searches.
*
* The suggestion list will be empty if the postcode has deviated too far from a valid postcode format.
*
* ## Multiple Residence
*
* A small number of postcodes will return more than 100 premises. These may require pagination. Use `page` to paginate the result set.
*/
get: operations["Postcodes"];
};
"/udprn/{udprn}": {
/**
* Returns an address as identified by its Unique Delivery Point Reference Number (UDPRN).
*
* You may find it useful to store UDPRN information as it can be used to retrieve the most recent information for an address. It can also be used to test for a deleted address.
*
* UDPRNs are an eight digit unique numeric code (e.g. `25962203`) for any premise on the Postcode Address File. It's essentially a unique identifier for every address in the UK that Royal Mail has in its database.
*
* ## Testing
*
* To test your implementation of our API we have a range of test UDPRNs that yield both successful and unsuccessful responses to your request.
*
* They are the following:
*
* - `0` Returns a successful UDPRN lookup response
* `2000`
* - `-1` Returns "UDPRN not found", error `4044`
* - `-2` Returns "no lookups remaining", error `4020`
* - `-3` Returns "daily (or individual) lookup limit breached",
* error `4021`
*
* Test request undergo the usual authentication and restriction rules. This is to help surface any issues that occur during implementation and does not cost you a lookup.
*/
get: operations["UDPRN"];
};
"/umprn/{umprn}": {
/**
* Returns a multiple occupancy address identifited via its UMPRN (Multiple Residence Unique ID).
*
* UMPRNs are a unique numeric code for any Multiple Residence household on the optional Multiple Residence dataset.
*
* ## Testing
*
* To test your implementation of our API we have a range of test UMPRNs that yield both successful and unsuccessful responses to your request. They are the following
*
* - `0` Returns a successful UMPRN lookup response `2000`
* - `-1` Returns "UMPRN not found", error `4044`
* - `-2` Returns "no lookups remaining", error `4020`
* - `-3` Returns "daily (or individual) lookup limit breached", error `4021`
*
* Test request undergo the usual authentication and restriction rules. This is to help surface any issues that occur during implementation and does not cost you a lookup.
*
* ### Pricing
*
* Per lookup charges apply. Empty responses are not charged.
*/
get: operations["UMPRN"];
};
"/keys/{key}": {
/**
* Returns public information on your API Key.
*
* This endpoint can be used for the following:
* - Determine if the key is currently useable via the `available` property
* - Determine available contexts for a an API Key
* - Identify the currently likely context of a user given their location
*
* You may pass both API Keys (beginning `ak_`) and Sub-licensed Keys (beginning `sl_`).
*/
get: operations["KeyAvailability"];
};
"/keys/{key}/details": {
/** Returns private data on the key including remaining lookups, available datasets and usage limits. */
get: operations["KeyDetails"];
/** Update API Key Details */
put: operations["UpdateKeyDetails"];
};
"/keys/{key}/usage": {
/**
* Reports the number of lookups consumed on a key for a range of days.
*
* A maximum interval of 90 days can be provided for analysis. If no start or end date is provided, the last 21 days will be used as the default interval.
*
* If no `start` time is provided, the start time will be set to 21 days prior to the current time.
*
* If no `end` time is provided, the current time will be used.
*
* Append `tags` to scope the number of lookups to those with matching tag values. E.g. `tags=foo,bar` will only count transactions that match `foo` and `bar`.
*/
get: operations["KeyUsage"];
};
"/keys/{key}/lookups": {
/**
* Reports lookup information on a key for paid lookups.
*
* This method requires a `user_token`, which can be found on your [accounts page](https://ideal-postcodes.co.uk/account).
*
* A maximum interval of 90 days can be provided for analysis. If no start or end date is provided, the last 21 days will be used as the default interval.
*
* ## Download Usage History (CSV)
*
* `GET /keys/:key/lookups`
*
* Returns a CSV download of lookups performed and associated information.
*
* Note that the Content-Type returned will be CSV (text/csv). For a non 200 response, the `Content-Type` will revert to JSON with the error code and message embedded.
*
* ## Data Redaction
*
* Personally Identifiable Data (PII) caught in this your usage log (including IP, search term and URL data) will be redacted on a weekly basis.
*
* By default, PII will be redacted if it is older than 21 days. This timeframe can be configured from your dashboard.
*
* You may prevent PII collection altogether by setting the interval to `0` days.
*/
get: operations["KeyLogs"];
};
"/cleanse/addresses": {
/**
* The address cleanse API attempts to return the closest matching address for any given address inputs. We also return a number of Match Level indicators that describe the degree to which the suggested address matches the input address. The more impaired the input address, the harder it is to cleanse.
*
* ## Confidence Score
*
* The confidence score is a number ranging between 0 and 1. Where 1 implies a full match and 0 implies no major elements completely match. Each incorrect, missing or misspelled element will subtract from the overall confidence score.
*
* ### Deciding on an Acceptable Confidence Score Threshold
*
* Different address cleanse projects can have radically different inputs. However, within each project, the inputs tend to repeat the same errors. For instance, some input datasets may be exclusively inputted manually and be prone to typos. Others may have a persistently missing datapoint such as organistation name or postcode. For this reason, it is important to understand that there is no absolute Confidence Score threshold. Instead, the acceptable confidence score must be determined on a project by project basis based on systematic errors present in the data and business goals.
*
* When determining an acceptable Confidence Score threshold you should load a subset of the dataset into a spreadsheet application like Excel and sort on the score. Scrolling from top-to-bottom you will be able to observe matches from best to worst. As you start to hit the lower quality searches, you will be able to roughly determine:
* - Which confidence scores indicate ambigious matches (i.e. up to building level only)
* - Which confidence scores indicate a poor or no match (i.e. the nearest matching address is too far from the input address)
*
* Depending on your business goals, you can also use the Match Levels to determine an acceptable match. For instance, do you need to match up to the throroughfare or building name only? Are accurate organisation names an important feature?
*/
post: operations["AddressCleanse"];
};
"/verify/addresses": {
/**
* The address verify API validates, corrects, and standardizes individual addresses based on USPS's Coding Accuracy Support System (CASS).
*
* The address verify API accepts the 3 combination of inputs:
*
* - Free-form address submitted as a single string in `query`
* - Example: "123 Main St, Springfield, CO 81073-1119"
* - Only free-form and zip code address components submitted as separate parameters:
* - `query` for the street address
* - `zip_code` for the ZIP code
* - Example:
* - `query`: "123 Main St, Springfield CO"
* - `zip_code`: "81073-1119"
* - Only free-form, city and state address components submitted as separate parameters:
* - `query` for the street address
* - `city` for the city
* - `state` for the state
* - Example:
* - `query`: "123 Main St"
* - `city`: "Springfield"
* - `state`: "CO"
*/
post: operations["AddressVerify"];
};
"/autocomplete/addresses": {
/**
* The Address Autocomplete API delivers address suggestions in order of relevance based on a provided query. It aids real-time address autofill implementations.
*
* Consider using our Address Autocomplete JavaScript libraries to add address lookup to a form in moments rather than interacting with this API directly.
*
* ## API Usage
*
* Implementing our Address Autocomplete API involves:
*
* 1. Fetch address suggestions with `/autocomplete/addresses`
* 2. Acquire the complete address using the ID from the suggestion
*
* Step 2 will decrement your lookup balance.
*
* Note that step 1 is not a free standalone resource. Integrations that consistently make autocomplete requests without a paid Step 2 request will be rate limited and then suspended.
*
* ## Query Filters
*
* Refine results by appending filters to your querystring, e.g., `postcode=sw1a2aa` for postcode `SW1A 2AA`. Invalid filters return an empty set without affecting your lookup count.
*
* To apply multiple filter terms, use a comma-separated list, e.g., `postcode_outward=e1,e2,e3` combines result sets for E1, E2, and E3. Unless otherwise specified, all filters support multiple terms.
*
* Combine filters by `AND` logic, for instance, `su_organisation_indicator=Y&postcode_area=n`. The maximum allowed filter terms is **10**.
*
* ## Address Bias
*
* Preface bias searches with `bias_` to boost certain address results. Unlike filters, biasing allows unmatched addresses to appear with lower priority.
*
* For example, use `bias_postcode_area=SW,SE` to favor addresses in the `SW` and `SE` postcode areas. Invalid bias terms have no effect.
*
* Multiple bias terms are allowed unless stated otherwise, with a combined maximum of **5**.
*
* ## Suggestion Format
*
* The suggestion format is subject to change. We recommend using the suggestion as-is to prevent potential integration issues.
*
* ## Rate Limiting and Cost
*
* The rate limit for the Autocomplete API is 3000 requests per 5 minutes. HTTP Headers inform about the current rate limit.
*
* Autocomplete API usage does not impact your balance, but resolving a suggestion to a full address requires a paid request. Autocomplete requests without subsequent paid requests may result in rate limitation or suspension.
*/
get: operations["FindAddress"];
};
"/autocomplete/addresses/{address}/gbr": {
/**
* Resolves an address autocompletion by its address ID.
*
* Resolved addresses (including global addresses) are returned in a UK format (up to 3 address lines) using UK nomenclature (like postcode and county).
*/
get: operations["ResolveAddress"];
};
"/autocomplete/addresses/{address}/usa": {
/**
* Resolves an address autocompletion by its address ID.
*
* Resolved addresses (including global addresses) are returned in a US format (up to 2 address lines) using US nomenclature (like zipcode, state and city).
*/
get: operations["RetrieveAddress"];
};
"/addresses": {
/**
* Extract a list of complete addresses that match the query ordered by relevance score. This query accepts an optional limit and page query (defaults to 10 and 0 respectively).
*
* If a valid postcode is passed as the query string, the entire address list for that postcode is passed as a result. Note, in these cases, limit and page parameters are ignored.
*
* This API is designed as a multi-purpose tool for generating address lists, cleansing and wholesale data extraction according to specific parameters.
*
* For address autocomplete, see our address finder API - which is designed for speed and address completion.
*
* ## Reverse Geocoding
*
* Return a list of addresses around a point using the lon= and lat= querystring arguments. Addresses will be sorted in order of distance to the point. The search radius is 100m.
*
* ## Filters
*
* You can strictly narrow your result by adding filters to your query string which correspond with an address attribute.
*
* For instance, you can restrict to postcode `SW1A 2AA` by appending `postcode=sw1a2aa`.
*
* If a filter term is invalid, e.g. `postcode=SW1A2AAA`, then an empty result set is returned and no lookup is incurred.
*
* You can also scope using multiple terms for the same filter with a comma separated list of terms. E.g. Restrict results to E1, E2 and E3 outward codes: `postcode_outward=e1,e2,e3`. Multiple terms are `OR`'ed, i.e. the matching result sets are combined.
*
* All filters can accept multiple terms unless stated otherwise below.
*
* Multiple filters can also be combined. E.g. Restrict results to small user organisations in the N postcode area: `su_organisation_indicator=Y&postcode_area=n`. Multiple filters are `AND`'ed, i.e. each additional filter narrows the result set.
*
* A combined maximum of 5 terms are allowed across all filters.
*
* ## Biases
*
* You can boost certain addresses results that correspond with a certain address attribute. All bias searches are prefixed with `bias_`.
*
* Biased searches, unlike filtered searches, also allow unmatched addresses to appear . These will rank lower.
*
* For instance, you can boost addresses with postcode areas `SW` and `SE` by appending `bias_postcode_area=SW,SE`.
*
* If a bias term is invalid, e.g. `bias_postcode=SW1A2AAA` no bias effect is applied.
*
* You may scope using multiple terms for the same bias with a comma separated list of terms. E.g. Restrict results to `E1`, `E2` and `E3` outward codes: `bias_postcode_outward=e1,e2,e3`.
*
* All biases can accept multiple terms unless stated otherwise below.
*
* A combined maximum of 5 terms are allowed across all biases.
*
* ## Search by Postcode and Building Name or Number
*
* Search by postcode and building attribute with the postcode filter and query argument. E.g. For "SW1A 2AA Prime Minister" `/v1/addresses?postcode=sw1a2aa&q=prime minister`.
*
* The advantage of using filters is a postcode mismatch does not result in a lookup as no results are returned.
*
* #### Search By UPRN
*
* Search by UPRN using the `uprn` filter and excluding the query argument. E.g. `/v1/addresses?uprn=100`.
*
* ## Testing
*
* - **ID1 1QD** Returns a successful query response `2000`
* - **ID1 KFA** Returns an empty query response `2000`
* - **ID1 CLIP** Returns "no lookups remaining" error `4020`
* - **ID1 CHOP** Returns "daily (or individual) lookup limit breached" error `4021`
*
* Test request undergo the usual authentication and restriction rules. This is to help surface any issues that occur during implementation and does not cost you a lookup.
*/
get: operations["Addresses"];
};
"/places": {
/**
* Query for geographical places across countries. Each query will return a list of place suggestions, which consists of a place name, descriptive name and id.
*
* This API returns geographical information such as countries, capitals, administrative areas and more. It is ideal for correctly identifying a place along with any other details like geolocation.
*
* ## Implementing Place Autocomplete
*
* Extracting the full information of a place is a 2 step process:
*
* 1. Retrieve place suggestions via /places
* 2. Retrieve the entire place with the ID provided in the suggestion
*
* ## Suggestion Format
*
* Each place suggestion contains a descriptive name which you can provide to users to uniquely idenfity a place.
*
* ## Rate Limiting and Cost
*
* The rate limit for the Autocomplete API is 3000 requests per 5 minutes. HTTP Headers inform about the current rate limit.
*
* Autocomplete API usage does not impact your balance, but resolving a suggestion to a full address requires a paid request. Autocomplete requests without subsequent paid requests may result in rate limitation or suspension.
*/
get: operations["FindPlace"];
};
"/places/{place}": {
/** Resolves a place autocompletion by its place ID. */
get: operations["ResolvePlace"];
};
"/keys/{key}/licensees": {
/** Returns a list of licensees for a key. */
get: operations["ListLicensees"];
/** Create a licensee for the specified API Key. */
post: operations["CreateLicensee"];
};
"/keys/{key}/licensees/{licensee}": {
/** Returns licensee information as identified by the licensee key. */
get: operations["RetrieveLicensee"];
/** Update Licensee */
put: operations["UpdateLicensee"];
/** Cancels a licensee key. This renders a licensee unusable. This action can be reversed if you get in contact with us. */
delete: operations["DeleteLicensee"];
};
"/keys/{key}/configs": {
/** Lists configurations associated with a key */
get: operations["ListConfigs"];
/** Create a configuration */
post: operations["CreateConfig"];
};
"/keys/{key}/configs/{config}": {
/** Retrieve configuration object by name */
get: operations["RetrieveConfig"];
/** Updates configuration object */
post: operations["UpdateConfig"];
/** Permanently deletes a configuration object. */
delete: operations["DeleteConfig"];
};
"/emails": {
/** Query for and validate email addresses. */
get: operations["EmailValidation"];
};
"/phone_numbers": {
/** Query for and validate phone numbers. */
get: operations["PhoneNumberValidation"];
};
}
export interface components {
schemas: {
ecaf: components["schemas"]["EcafAddress"];
ecad: components["schemas"]["EcadAddress"];
geonames: components["schemas"]["GeonamesPlace"];
here: components["schemas"]["HereAddress"];
/**
* ID
* @description Global unique internally generated identifier for an address
* @example paf_8387729
*/
ID: string;
/**
* Dataset
* @description Indicates the provenance of an address
*/
paf_dataset: string;
/**
* ISO Country Code (3)
* @description 3 letter country code (ISO 3166-1)
*/
paf_country_iso: string;
/**
* ISO Country Code (2)
* @description 2 letter country code (ISO 3166-1)
*/
paf_country_iso_2: string;
/**
* Country
* @description Full country names (ISO 3166)
*
* @example England
*/
paf_country: string;
/**
* Language
* @description Language represented by 2 letter ISO Code (639-1)
*/
paf_language: string;
/**
* Line 1
* @description First Address Line. Often contains premise and thoroughfare information. In the case of a commercial premise, the first line is always the full name of the registered organisation. Never empty.
* @example Prime Minister & First Lord of Treasury
*/
paf_line1: string;
/**
* Line 2
* @description Second Address Line. Often contains thoroughfare and locality information. May be empty
* @example 10 Downing Street
*/
paf_line2: string;
/**
* Line 3
* @description Third address line. May be empty.
* @example
*/
paf_line3: string;
/**
* @description **Filter by Town or City"
* A Post Town is mandatory for delivery of mail to a Delivery Point. This is not necessarily the nearest town geographically, but a routing instruction to the Royal Mail delivery office sorting mail for that Delivery Point. A Post Town will always be present in every address, and for some Localities the Post Town will be the only locality element present.
*
* @example London
*/
paf_post_town: string;
/**
* Postcode
* @description Correctly formatted postcode. Capitalised and spaced.
* @example SW1A 2AA
*/
paf_postcode: string;
/**
* County
* @description Since postal, administrative or traditional counties may not apply to some addresses, the county field is designed to return whatever county data is available. Normally, the postal county is returned. If this is not present, the county field will fall back to the administrative county. If the administrative county is also not present, the county field will fall back to the traditional county. May be empty in cases where no administrative, postal or traditional county present.
* @example London
*/
paf_county: string;
/**
* Unique Property Reference Number
* @description UPRN stands for Unique Property Reference Number and is maintained by the Ordnance Survey (OS). Local governments in the UK have allocated a unique number for each land or property.
*
* Up to 12 digits in length.
*
* Multiple Residence premises currently share the same UPRN as the parent premise.
*
* May not be available for a small number of Great Britain addresses due to longer update cycles for Ordnance Survey's AddressBase datasets. Returns empty string "" in these instances.
*
* Although UPRN takes an integer format, we encode and transmit this data as strings. As a 12 digit number, the UPRN can exceed the maximum safe integer `Number.MAX_SAFE_INTEGER` in most browsers causing this datapoint to be corrupted.
*
* Take special care when storing UPRN. As a 12 digit identifier, you will need 64 bits to encode every possible UPRN value. This means applications like Excel will corrupt cells containing UPRN values.
*/
paf_uprn: string;
/**
* Unique Delivery Point Reference Number (UDPRN)
* Format: int32
* @description UDPRN stands for ‘Unique Delivery Point Reference Number’. Royal Mail assigns a unique UDPRN code for each premise on PAF. Simple, unique reference number for each Delivery Point. Unlikely to be reused when an address expires.
*
* Up to 8-digit numeric code.
*
* A new UDPRN is automatically assigned to each new Delivery Point added to PAF.
* @example 23747771
*/
paf_udprn: number;
/**
* UMPRN
* @description A small minority of individual premises (as identified by a UDPRN) may have multiple occupants behind the same letterbox. These are known as Multiple Residence occupants and can be queried via the Multiple Residence dataset. Simple, unique reference number for each Multiple Residence occupant.
*
* Note: this will be an empty string `""` when not used.
*/
paf_umprn: string | number;
/**
* Postcode Outward
* @description The first part of a postcode is known as the outward code. e.g. The outward code of ID1 1QD is ID1. Enables mail to be sorted to the correct local area for delivery. This part of the code contains the area and the district to which the mail is to be delivered, e.g. ‘PO1’, ‘SW1A’ or ‘B23’.
* @example SW1A
*/
paf_postcode_outward: string;
/**
* Postcode Inward
* @description The second part of a postcode is known as the inward code. e.g. The inward code of ID1 1QD is 1QD.
*
* The number identifies the sector in the postal district. The number is followed by 2 letters. The letters then define one or more properties in that sector.
* @example 2AA
*/
paf_postcode_inward: string;
/**
* Dependant Locality
* @description When the same thoroughfare name reoccurs in a Post town, it may not be possible to make it dependant on a dependant thoroughfare. In this case the thoroughfare is dependant on a locality. For example if we want to find 1 Back Lane in Huddersfield we see that there are three.
* @example
*/
paf_dependant_locality: string;
/**
* Double Dependant Locality
* @description Used to supplement Dependant Locality. A Double Dependant Locality supplied along with a Dependant Locality if the Dependant Locality exists twice in the same locality.
* @example
*/
paf_double_dependant_locality: string;
/**
* Thoroughfare
* @description Also known as the street or road name. In general each Thoroughfare Name will have a separate Postcode. Longer Thoroughfares with high number ranges often have multiple Postcodes covering the entire length of the road, with breaks at suitable points e.g. junctions or natural breaks in the road.
* @example Downing Street
*/
paf_thoroughfare: string;
/**
* Dependant Thoroughfare
* @description Used to supplement thoroughfare. When a thoroughfare name is used twice in the same Post Town, the dependant thoroughfare is added to uniquely indentify a delivery point.
* @example
*/
paf_dependant_thoroughfare: string;
/**
* Building Number
* @description Number to identify premise on a thoroughfare or dependant thoroughfare.
* @example 10
*/
paf_building_number: string;
/**
* Building Name
* @description Name of residential or commercial premise.
*
* Examples:
* - The Manor
* - 1-2
* - A
* - 12A
* - K
* - Victoria House
* @example
*/
paf_building_name: string;
/**
* Sub-Building Name
* @description When a premise is split into individual units such as flats, apartments or business units. Cannot be present without either building_name or building_number. E.g. Flat 1, A, 10B
* @example Flat 1
*/
paf_sub_building_name: string;
/**
* PO Box
* @description When the PO Box Number field is populated it will contain PO BOX nnnnnn where n represents the PO Box number. Note that the PO Box details can occasionally consist of a combination of numbers and letters. PO Box Numbers are only allocated to Large Users.
* @example 100
*/
paf_pobox: string;
/**
* Department Name
* @description Used to supplment Organisation Name to identify a deparment within the organisation.
* @example
*/
paf_department_name: string;
/**
* Organisation Name
* @description Used to supplment Organisation Name to identify a deparment within the organisation
* @example Prime Minister & First Lord Of The Treasury
*/
paf_organisation_name: string;
/**
* Postcode Type
* @description This indicates the type of user. It can only take the values 'S' or 'L' indicating small or large respectively. Large User Postcodes. These are assigned to one single address either due to the large volume of mail received at that address, or because a PO Box or Selectapost service has been set up. Small User Postcodes. These identify a group of Delivery Points.
*
* On average there are 19 Delivery Points per Postcode. However this can vary between 1 and, in some cases, 100. There will never be more than 100 Delivery Points on a Postcode.
* @enum {undefined}
*/
paf_postcode_type: "S" | "L" | "";
/**
* Small User Organisation Indicator
* @description Small User Organisation Indicator can have the values 'Y' or space. A value of 'Y' indicates that a Small User Organisation is present at this address.
* @example Y
*/
paf_su_organisation_indicator: string;
/**
* Delivery Point Suffix
* @description A unique Royal Mail 2-character code (the first numeric & the second alphabetical), which, when added to the Postcode, enables each live Delivery Point to be uniquely identified. Once the Delivery Point is deleted from PAF the DPS may be reused (although they aren’t reused until all remaining Delivery Points in the range have been allocated). The DPS for a Large User is always '1A' as each Large User has its own Postcode.
* @example 1A
*/
paf_delivery_point_suffix: string;
/**
* Premise
* @description A pre-computed string which sensibly combines building_number, building_name and sub_building_name. building_number, building_name and sub_building_name represent raw data from Royal Mail's and can be difficult to parse if you are unaware of how the Postcode Address File premise fields work together. For this reason, we also provide a pre-computed premise field which intelligently gathers these points into a single, simple premise string. This field is ideal if you want to pull premise information and thoroughfare information separately instead of using our address lines data.
* @example 10
*/
paf_premise: string;
/**
* Administrative County
* @description The current administrative county to which the postcode has been assigned.
*
* A Unitary Authority name, where one is present. If there is no Unitary Authority, the County name is used. This information is not static, because County boundaries may change due to administrative changes. Data
*
* source: ONS
* @example
*/
paf_administrative_county: string;
/**
* Postal County
* @description Postal counties were used for the distribution of mail before the Postcode system was introduced in the 1970s. The Former Postal County was the Administrative County at the time. This data rarely changes. May be empty.
* @example London
*/
paf_postal_county: string;
/**
* Traditional County
* @description Traditional counties are provided by the Association of British Counties. It is historical data, and can date from the 1800s. May be empty.
* @example Greater London
*/
paf_traditional_county: string;
/**
* District
* @description The current district/unitary authority to which the postcode has been assigned.
* @example Westminster
*/
paf_district: string;
/**
* Ward
* @description The current administrative/electoral area to which the postcode has been assigned. May be empty for a small number of addresses.
* @example St. James'
*/
paf_ward: string;
/**
* Longitude
* @description The longitude of the postcode (WGS84/ETRS89).
*
* Can be a positive or negative decimal. E.g. -0.1283983
*
* Returns an empty string if no location data is available.
*/
Longitude: string | number;
/**
* Longitude
* @description The latitude of the postcode (WGS84/ETRS89).
*
* Can be a positive or negative decimal. E.g. `51.5083983`.
*
* Returns an empty string if no location data is available.
*/
Latitude: string | number;
/**
* Eastings
* @description Eastings reference using the [Ordnance Survey National Grid reference system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid).
*
* Northern Ireland Eastings uses the [Irish Grid Reference System](https://en.wikipedia.org/wiki/Irish_grid_reference_system).
*
* Metres from origin. E.g. `550458`
*
* Returns an empty string if no location data is available. Otherwise a number is returned.
*/
Eastings: string | number;
/**
* Northings
* @description Northings reference using the [Ordnance Survey National Grid reference system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid)
*
* Northern Ireland Northings uses the [Irish Grid Reference System](https://en.wikipedia.org/wiki/Irish_grid_reference_system)
*
* Metres from origin. E.g. `180458`
*
* Returns an empty string if no location data is available. Otherwise a number is returned
*/
Northings: string | number;
PafBase: {
id: components["schemas"]["ID"];
dataset: components["schemas"]["paf_dataset"];
country_iso: components["schemas"]["paf_country_iso"];
country_iso_2: components["schemas"]["paf_country_iso_2"];
country: components["schemas"]["paf_country"];
language: components["schemas"]["paf_language"];
line_1: components["schemas"]["paf_line1"];
line_2: components["schemas"]["paf_line2"];
line_3: components["schemas"]["paf_line3"];
post_town: components["schemas"]["paf_post_town"];
postcode: components["schemas"]["paf_postcode"];
county: components["schemas"]["paf_county"];
/**
* County Code
* @description Short code representing the county or province. May be empty (`""`)
* @example
*/
county_code: string;
uprn: components["schemas"]["paf_uprn"];
udprn: components["schemas"]["paf_udprn"];
umprn: components["schemas"]["paf_umprn"];
postcode_outward: components["schemas"]["paf_postcode_outward"];
postcode_inward: components["schemas"]["paf_postcode_inward"];
dependant_locality: components["schemas"]["paf_dependant_locality"];
double_dependant_locality: components["schemas"]["paf_double_dependant_locality"];
thoroughfare: components["schemas"]["paf_thoroughfare"];
dependant_thoroughfare: components["schemas"]["paf_dependant_thoroughfare"];
building_number: components["schemas"]["paf_building_number"];
building_name: components["schemas"]["paf_building_name"];
sub_building_name: components["schemas"]["paf_sub_building_name"];
po_box: components["schemas"]["paf_pobox"];
department_name: components["schemas"]["paf_department_name"];
organisation_name: components["schemas"]["paf_organisation_name"];
postcode_type: components["schemas"]["paf_postcode_type"];
su_organisation_indicator: components["schemas"]["paf_su_organisation_indicator"];
delivery_point_suffix: components["schemas"]["paf_delivery_point_suffix"];
premise: components["schemas"]["paf_premise"];
administrative_county: components["schemas"]["paf_administrative_county"];
postal_county: components["schemas"]["paf_postal_county"];
traditional_county: components["schemas"]["paf_traditional_county"];
district: components["schemas"]["paf_district"];
ward: components["schemas"]["paf_ward"];
longitude: components["schemas"]["Longitude"];
latitude: components["schemas"]["Latitude"];
eastings: components["schemas"]["Eastings"];
northings: components["schemas"]["Northings"];
};
/**
* Postcode Address File Address
* @description Standard UK Address. Also known as a Postcode Address File (PAF) address is defined by Royal Mail and updated on a daily cadence.
*
* A PAF Address represents a deliverable endpoint.
*/
PafAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {string} */
dataset?: "paf";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?:
| "England"
| "Scotland"
| "Wales"
| "Northern Ireland"
| "Jersey"
| "Guernsey"
| "Isle of Man";
};
/**
* Multiple Residence Address
* @description Subdivision of a Postcode Address File address. Also known as a Multiple Residence or Multiple Occupancy address.
*
* A Multiple Residence address does not have its own deliverable endpoint. Instead it relies on the deliverable endpoint of a parent address, where the parent address can be found on the main Postcode Address File.
*/
MrAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "mr";
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?:
| "England"
| "Scotland"
| "Wales"
| "Northern Ireland"
| "Jersey"
| "Guernsey"
| "Isle of Man";
};
/**
* Not Yet Built Address
* @description A UK premise under construction and currently not occupied.
*
* This dataset is updated by Royal Mail on a monthly cadence.
*/
NybAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "nyb";
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?:
| "England"
| "Scotland"
| "Wales"
| "Northern Ireland"
| "Jersey"
| "Guernsey"
| "Isle of Man";
};
/**
* PAF Alias Address
* @description PAF Aliases addresses are alternate ways to present an address already found on PAF.
*
* Alias data is information the public chooses to use when addressing mail, but which isn’t actually required for delivery purposes. The Alias data contains records of alternative address details that are included in the address but not necessarily needed for delivery purposes.
*/
PafAliasAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "pafa";
/** @enum {undefined} */
country_iso?: "GBR" | "IMN" | "JEY" | "GGY";
/** @enum {undefined} */
country_iso_2?: "GB" | "IM" | "JE" | "GG";
/** @enum {undefined} */
language?: "en";
/** @enum {undefined} */
country?:
| "England"
| "Scotland"
| "Wales"
| "Northern Ireland"
| "Jersey"
| "Guernsey"
| "Isle of Man";
};
/**
* Welsh PAF Address
* @description Welsh language alternative for a PAF Address
*/
WelshPafAddress: components["schemas"]["PafBase"] & {
/** @enum {undefined} */
dataset?: "pafw";
/** @enum {undefined} */
country_iso?: "GBR";
/** @enum {undefined} */
country_iso_2?: "GB";
/** @enum {undefined} */
language?: "cy";
/** @enum {undefined} */
country?: "Wales";
};
/**
* Language
* @description Language represented by 2 letter ISO Code (639-1)
*
* @enum {string}
*/
Language:
| "en"
| "ar"
| "as"
| "az"
| "be"
| "bg"
| "bn"
| "bs"
| "ca"
| "cs"
| "cy"
| "da"
| "de"
| "el"
| "es"
| "et"
| "eu"
| "fi"
| "fo"
| "fr"
| "ga"
| "gl"
| "gn"
| "he"
| "hi"
| "hr"
| "hu"
| "hy"
| "id"
| "is"
| "it"
| "ka"
| "kk"
| "km"
| "kn"
| "lt"
| "lv"
| "mk"
| "mn"
| "ms"
| "mt"
| "my"
| "nl"
| "no"
| "pl"
| "pt"
| "ro"
| "ru"
| "sk"
| "sl"
| "sq"
| "sr"
| "sv"
| "ta"
| "th"
| "tr"
| "uk"
| "uz"
| "vi"
| "wa"
| "zh";
/**
* AddressBase Core
* @description Represents a GB address in Ordnance Survey's AddressBase Core dataset
*/
AddressBaseCore: {
id: components["schemas"]["ID"];
/**
* Dataset
* @description Indicates the provenance of an address
* @enum {string}
*/
dataset: "ab";
language: components["schemas"]["Language"];
line_1: components["schemas"]["paf_line1"];
line_2: components["schemas"]["paf_line2"];
line_3: components["schemas"]["paf_line3"];
premise: components["schemas"]["paf_premise"];
/**
* UPRN
* @description Unique Property Reference Number (UPRN) assigned by the LLPG Custodian or Ordnance Survey.
*/
uprn: string;
/**
* UDPRN
* @description Royal Mail's Unique Delivery Point Reference Number (UDPRN).
*/
udprn: number;
/**
* PARENT_UPRN
* @description UPRN of the parent Record if a parent-child relationship exists.
*/
parent_uprn: string;
/**
* USRN
* @description Unique Street Reference Number assigned by the Street Name and Numbering Custodian OR
*
* Ordnance Survey depending on the address record.
*/
usrn: number;
/**
* TOID
* @description The Topographic Identifier taken from OS MasterMap Topography Layer. This TOID is assigned to the UPRN by performing a spatial intersection between the two identifiers. It consists of the letters 'osgb' and is followed by up to sixteen digits.
*/
toid: string;
/**
* Classification Code
* @description A code that describes the classification of the address record to a maximum of a secondary level.
*/
classification_code: string;
/**
* Easting
* @description A value in metres defining the x location in accordance with the British National Grid.
*/
eastings: number;
/**
* Northing
* @description A value in metres defining the y location in accordance with the British National Grid.
*/
northings: number;
/**
* Latitude
* @description A value in metres defining the y location in accordance with the British National Grid.
*/
latitude: number;
/**
* Longitude
* @description A value defining the Longitude location in accordance with the ETRS89 coordinate reference system.
*/
longitude: number;
/**
* Single Line Address
* @description A single attribute containing text concatenation of the address elements separated by a comma.
*/
single_address_line: string;
/**
* Single Line Address
* @description Street / Road name for the address record.
*/
street_name: string;
/**
* Locality
* @description A locality defines an area or geographical identifier within a town, village or hamlet. Locality represents the lower level geographical area. The locality field should be used in conjunction with the town name and street description fields to uniquely identify geographic area where there may be more than one within an administrative area.
*/
locality: string;
/**
* Town Name
* @description Geographical town name assigned by the Local Authority. Please note this can be different from the Post Town value assigned by Royal Mail.
*/
town_name: string;
/**
* Delivery Point Suffix
* @description A two-character code uniquely identifying an individual delivery point within a postcode, assigned by Royal Mail.