-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbusiness-registration-api.yaml
More file actions
1871 lines (1805 loc) · 72.3 KB
/
Copy pathbusiness-registration-api.yaml
File metadata and controls
1871 lines (1805 loc) · 72.3 KB
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
openapi: 3.1.0
info:
title: Business Registration API
version: '1.0'
description: |-
API for enrolling businesses that do not appear in national registries, e.g. sole traders and
government departments.
To create trade accounts or orders for such businesses, a proposal must first be created and then submitted via this API
for Two to enrol the business.
---
## Integration Options
### Option 1: Interactive popup (recommended)
This approach uses Two's hosted popup to handle both returning buyers and new registrations.
**Step 1: Check for existing buyer data**
From your server, obtain an Autofill API delegation token (`POST /autofill/v1/delegation`) with `read_current_buyer: true`.
Pass this token to the buyer's browser and call `GET /autofill/v1/buyer/current` with the token in the
`Two-Delegated-Authority-Token` header. If the buyer has previously saved their details on this device, their
business information is returned - use it directly without further steps.
**Step 2: If no autofill data, obtain delegation tokens for the popup**
From your server, request delegation tokens from both APIs:
1. **Business Registration API** (`POST /registry/v1/delegation`):
- `verify_returning_buyer: true` - allows email verification of returning buyers
- `create_proposal: true` - allows new buyer registration
2. **Autofill API** (`POST /autofill/v1/delegation`):
- `write_current_buyer: true` - allows the popup to save buyer details on completion
- `read_current_buyer: true` - allows retrieval after completion
**Step 3: Open the signup popup**
Pass both tokens to the buyer's browser and open a popup to `https://checkout.two.inc/soletrader/signup` with:
| Parameter | Required | Description |
|-----------|----------|-------------|
| `authToken` | Yes | Delegation token from Business Registration API |
| `autofillToken` | Yes | Delegation token from Autofill API |
| `autofillData` | No | URL-encoded JSON of buyer details to pre-populate the form |
The popup handles email verification for returning buyers, or guides new buyers through registration.
**Step 4: Retrieve buyer details**
When the popup closes, call `GET /autofill/v1/buyer/current` with your Autofill delegation token to retrieve
the buyer's business details (company name, country code, organization number, addresses).
---
### Option 2: Direct API integration
For full control over the user experience, integrate directly with the API endpoints.
**Returning buyer flow:**
Before creating a new proposal, check if the buyer already has a registered business:
1. Call `POST /proposal/returning-buyer/verification` with the buyer's email address
- **201**: Verification code sent - a business exists for this email
- **404**: No existing business - proceed with new registration
2. If 404, the buyer is not already registered. Skip to "New buyer registration flow".
3. If 201, prompt the buyer for the verification code and call `PATCH /proposal/returning-buyer/verification`
4. On success, the response contains the buyer's business details - use them directly
**New buyer registration flow:**
If no existing business is found:
1. Collect buyer information and `POST /registry/v1/proposal`
2. The proposal is created with status `DRAFT`
3. Optionally upload supporting evidence while in `DRAFT` status
4. Submit the proposal for review via the submission endpoint
**Proposal lifecycle:**
| Status | Description |
|--------|-------------|
| `DRAFT` | Initial state. Evidence can be uploaded. |
| `SUBMITTED` | Automated evaluation in progress. |
| `IN_REVIEW` | Manual review required. |
| `ACCEPTED` | Approved. Synthetic organization number generated. |
| `DECLINED` | Rejected. |
| `WITHDRAWN` | Cancelled via DELETE while `SUBMITTED` or `IN_REVIEW`. |
**Retrieving the organization number:**
Once the proposal is accepted, Two generates a synthetic organization number. There are two ways to retrieve it:
1. **Webhook (recommended)**: Configure a webhook to receive `enrollment.approved` events. The webhook
payload includes the `organization_number` directly, eliminating the need to poll.
2. **Polling**: Call `GET /registry/v1/proposal/<built-in function id>` periodically. When `status` becomes `ACCEPTED`,
the `enrolled_business` field will be populated with the business details including `organization_number`.
Use the organization number on other Two APIs (trade accounts, orders, etc.) exactly like a
registered business number.
---
## Notes
- During review, Two may contact the business or merchant for additional information.
- Personal information in proposals is redacted after reaching `ACCEPTED` or `DECLINED` status.
- Currently limited to **UK and US sole traders only**.
---
## Example: Testing the Interactive Popup Flow
The following shell commands demonstrate the complete popup integration flow. Run each step individually
(not as a script) to allow time for browser interactions.
**Prerequisites:** Set your API key as an environment variable:
```bash
AUTH_HEADERS="X-API-Key: <your sandbox api key>"
API_BASE="https://api.sandbox.two.inc"
CHECKOUT_BASE="https://checkout.sandbox.two.inc"
```
**Step 1: Check for existing buyer data**
```bash
# Back-end: Get a read token for the Autofill API
AUTOFILL_READ_TOKEN=$(curl -s "$API_BASE/autofill/v1/delegation" \
-H "$AUTH_HEADERS" \
-H "Content-Type: application/json" \
-d '{"read_current_buyer": true}' \
-D - -o /dev/null | grep -i "two-delegated-authority-token:" | cut -d' ' -f2 | tr -d '\r')
# Front-end: Check if buyer has saved details available
open "$API_BASE/autofill/v1/buyer/current?Two-Delegated-Authority-Token=$AUTOFILL_READ_TOKEN"
```
If a 404 is returned, the buyer has no saved data. Proceed to Step 2.
**Step 2: Open the signup popup**
```bash
# Back-end: Get tokens for registration and autofill write access
AUTH_TOKEN=$(curl -s "$API_BASE/registry/v1/delegation" \
-H "$AUTH_HEADERS" \
-H "Content-Type: application/json" \
-d '{"verify_returning_buyer": true, "create_proposal": true}' \
-D - -o /dev/null | grep -i "two-delegated-authority-token:" | cut -d' ' -f2 | tr -d '\r')
AUTOFILL_WRITE_TOKEN=$(curl -s "$API_BASE/autofill/v1/delegation" \
-H "$AUTH_HEADERS" \
-H "Content-Type: application/json" \
-d '{"write_current_buyer": true}' \
-D - -o /dev/null | grep -i "two-delegated-authority-token:" | cut -d' ' -f2 | tr -d '\r')
# Front-end: Open the signup popup (complete the flow in the browser)
open "$CHECKOUT_BASE/soletrader/signup?authToken=$AUTH_TOKEN&autofillToken=$AUTOFILL_WRITE_TOKEN"
```
The popup will:
1. Ask for the buyer's email and send a verification code
2. If a registered business is found, save details to Autofill and close
3. Otherwise, guide the buyer through registration, then save and close
**Step 3: Retrieve the buyer's details**
```bash
# Front-end: After the popup closes, call autofill again (reusing the existing read token)
open "$API_BASE/autofill/v1/buyer/current?Two-Delegated-Authority-Token=$AUTOFILL_READ_TOKEN"
```
**Interpreting the result:**
- **200 with data**: Business details retrieved successfully. Use `organization_number`, `country_code` and `company_name` to place orders.
- **404**: The buyer either cancelled, was rejected, or registration is still pending review.
## Environments
### Testing
[https://api.sandbox.two.inc](https://api.sandbox.two.inc/v1/health)
Note: Read about our [sandbox environment specific behaviour](/docs/guides/sandbox-behaviour-page/).
### Production
[https://api.two.inc](https://api.two.inc/v1/health)
tags:
- name: Business Registration
paths:
/registry/v1/proposal:
post:
summary: Create proposal
operationId: create_proposal.post
description: 'Create a new proposal for a business to be enrolled with
Two, or for an existing enrollment to be updated. If this operation
is authorized by a delegated authority token (generated via `POST
.../delegation` with a body of `{"create_proposal": true}` and passed
as a request header called `Two-Delegated-Authority-Token`) rather
than by the merchant''s API key, the response will include a new delegated
authority token as a response header called `Two-Delegated-Authority-Token`
which may be used to track (`GET .../proposal/<id>`), withdraw (`DELETE
.../proposal/<id>`) or submit (`POST .../proposal/<id>/submission`)
the newly created proposal.'
tags:
- Business Registration
parameters:
- name: Idempotency-Key
in: header
schema:
anyOf:
- maxLength: 100
type: string
- type: 'null'
default: null
title: Idempotency-Key
required: false
description: ''
responses:
'202':
description: Proposal has been accepted for review.
content:
application/json:
schema:
$ref: '#/components/schemas/ProposalSchema'
'400':
description: Proposal is invalid.
security:
- X-Api-Key: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProposalSchema'
get:
summary: Get proposals
operationId: get_all_proposals.get
description: Get matching proposals. Search parameters are optional. If
`status` is omitted, only proposals currently requiring action are
returned (`DRAFT` proposals). The `status` filter accepts a single
value only; to retrieve multiple statuses, issue separate requests.
Supported `status` values are `DRAFT`, `UNVERIFIED`, `SUBMITTED`,
`REVIEWING`, `ACCEPTED`, `DECLINED`, and `WITHDRAWN`. Note that each
merchant may only access proposals lodged by the same merchant. Also
note that supplementary information is only included for proposals
that have not yet been accepted, declined or withdrawn.
tags:
- Business Registration
parameters:
- name: page
in: query
schema:
anyOf:
- minimum: 0
type: integer
- type: 'null'
default: null
description: The requested page number, 1-based.
title: Page
required: false
description: The requested page number, 1-based.
- name: limit
in: query
schema:
anyOf:
- minimum: 0
type: integer
- type: 'null'
default: null
description: The maximum number of items on a single page, ie
the page size.
title: Limit
required: false
description: The maximum number of items on a single page, ie the
page size.
- name: business_type
in: query
schema:
anyOf:
- $ref: '#/components/schemas/BusinessTypeEnum'
- type: 'null'
default: null
required: false
description: ''
- name: country_code
in: query
schema:
anyOf:
- $ref: '#/components/schemas/CountryCodeEnum'
- type: 'null'
default: null
required: false
description: ''
- name: trading_name
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Case-insensitive partial match.
title: Trading Name
required: false
description: Case-insensitive partial match.
- name: email
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Exact match only.
title: Email
required: false
description: Exact match only.
- name: phone
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Exact match only.
title: Phone
required: false
description: Exact match only.
- name: status
in: query
schema:
anyOf:
- $ref: '#/components/schemas/ProposalStatusEnum'
- type: 'null'
default: null
description: 'Optional single-value status filter. Merchant API
supports: `DRAFT`, `UNVERIFIED`, `SUBMITTED`, `REVIEWING`,
`ACCEPTED`, `DECLINED`, `WITHDRAWN`. Multiple statuses in
one request are not supported. If omitted, merchant API returns
proposals that currently require action (`DRAFT` proposals
for the authenticated merchant).'
required: false
description: 'Optional single-value status filter. Merchant API supports:
`DRAFT`, `UNVERIFIED`, `SUBMITTED`, `REVIEWING`, `ACCEPTED`, `DECLINED`,
`WITHDRAWN`. Multiple statuses in one request are not supported.
If omitted, merchant API returns proposals that currently require
action (`DRAFT` proposals for the authenticated merchant).'
- name: order_by
in: query
schema:
$ref: '#/components/schemas/ProposalSearchOrderByEnum'
default: date_created
description: How to order the search results
required: false
description: How to order the search results
- name: order_desc
in: query
schema:
default: false
description: If true, reverse the results order.
title: Order Desc
type: boolean
required: false
description: If true, reverse the results order.
responses:
'200':
description: Proposals
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedProposalsSchema'
security:
- X-Api-Key: []
/registry/v1/proposal/{proposal_id}:
get:
summary: Get proposal
operationId: get_proposal.get
description: Get an existing proposal by id. Note that each merchant may
only access proposals lodged by the same merchant. Also note that
supplementary information is only included for proposals that have
not yet been accepted, declined or withdrawn.
tags:
- Business Registration
parameters:
- name: proposal_id
in: path
required: true
schema:
type: string
description: The id of an existing proposal.
responses:
'200':
description: Proposal
content:
application/json:
schema:
$ref: '#/components/schemas/ProposalSchema'
'404':
description: Proposal not found
delete:
summary: Withdraw proposal
operationId: withdraw_proposal.delete
description: Withdraw an existing proposal by id. Withdrawals will only
be accepted for proposals with a status of `IN_REVIEW`. Withdrawal
will not delete the proposal record but will instead update its status
to `WITHDRAWN` after which no further updates will be possible. Withdrawal
attempts will result in a `409` response if the proposal has already
been approved or declined. Subsequent attempts to withdraw the same
proposal will not prompt any action, and will result in a `200` status.
Note that each merchant may only withdraw proposals lodged by that
same merchant.
tags:
- Business Registration
parameters:
- name: proposal_id
in: path
required: true
schema:
type: string
description: The id of an existing proposal.
responses:
'200':
description: Proposal
content:
application/json:
schema:
$ref: '#/components/schemas/ProposalSchema'
'404':
description: Proposal not found
'409':
description: Proposal is not in a suitable state for withdrawals
/registry/v1/proposal/{proposal_id}/submission:
post:
summary: Submit proposal
operationId: submit_proposal.post
description: Submit an existing proposal for review, by id. Submissions
will only be accepted for proposals with a status of `DRAFT`. Submission
attempts will result in a `200` response but take no action if the
proposal has already progressed beyond `DRAFT`.
tags:
- Business Registration
parameters:
- name: proposal_id
in: path
required: true
schema:
type: string
description: The id of an existing proposal.
responses:
'200':
description: Proposal
content:
application/json:
schema:
$ref: '#/components/schemas/VerificationInitiationResponseSchema'
'404':
description: Proposal not found
'409':
description: Proposal is not in a suitable state for submission
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/VerificationConfigurationSchema'
required: false
/registry/v1/business:
get:
summary: Get businesses
operationId: get_all_businesses.get
description: Get all matching businesses that have previously been enrolled
with Two via completed proposals. At least one search parameter must
be provided. Note that each merchant may only access businesses referred
to by accepted proposals lodged by the same merchant.
tags:
- Business Registration
parameters:
- name: page
in: query
schema:
anyOf:
- minimum: 0
type: integer
- type: 'null'
default: null
description: The requested page number, 1-based.
title: Page
required: false
description: The requested page number, 1-based.
- name: limit
in: query
schema:
anyOf:
- minimum: 0
type: integer
- type: 'null'
default: null
description: The maximum number of items on a single page, ie
the page size.
title: Limit
required: false
description: The maximum number of items on a single page, ie the
page size.
- name: business_type
in: query
schema:
anyOf:
- $ref: '#/components/schemas/BusinessTypeEnum'
- type: 'null'
default: null
required: false
description: ''
- name: country_code
in: query
schema:
anyOf:
- $ref: '#/components/schemas/CountryCodeEnum'
- type: 'null'
default: null
required: false
description: ''
- name: trading_name
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Case-insensitive partial match.
title: Trading Name
required: false
description: Case-insensitive partial match.
- name: email
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Exact match only.
title: Email
required: false
description: Exact match only.
- name: phone
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Exact match only.
title: Phone
required: false
description: Exact match only.
- name: organization_number
in: query
schema:
anyOf:
- type: string
- type: 'null'
default: null
description: Exact match only.
title: Organization Number
required: false
description: Exact match only.
- name: order_by
in: query
schema:
$ref: '#/components/schemas/BusinessSearchOrderByEnum'
default: date_created
description: How to order the search results
required: false
description: How to order the search results
- name: order_desc
in: query
schema:
default: false
description: If true, reverse the results order.
title: Order Desc
type: boolean
required: false
description: If true, reverse the results order.
responses:
'200':
description: Matching businesses
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedBusinessesSchema'
'400':
description: Parameters are invalid.
security:
- X-Api-Key: []
/registry/v1/business/{business_id}:
get:
summary: Get business
operationId: get_business.get
description: Get a business that has previously been enrolled with Two
via a completed proposal. Note that each merchant may only access
businesses referred to by accepted proposals lodged by the same merchant.
tags:
- Business Registration
parameters:
- name: business_id
in: path
required: true
schema:
type: string
description: The id of a business that was enrolled as the result
of an accepted proposal.
responses:
'200':
description: Business
content:
application/json:
schema:
$ref: '#/components/schemas/BusinessSchema'
'404':
description: Business not found
security:
- X-Api-Key: []
/registry/v1/delegation:
get:
summary: Check validity of a browser delegation token
operationId: get_delegation.get
description: Checks the validity of a browser delegation token, returning
the token data if valid.
tags:
- Business Registration
parameters: []
responses:
'200':
description: Delegated authority token data in the response body
'401':
description: Invalid request, for instance if provided Two-Delegated-Authority-Token
has expired
post:
summary: Create a browser delegation token
operationId: create_delegation.post
description: Create a token for use within a buyer's browser. The token
is returned as a response header called `Two-Delegated-Authority-Token`.
To use the token, browser-side code should simply add the header to
the relevant requests. The token will grant access for 1 hour, for
the user's browser to impersonate the merchant for the operations
associated with each role specified in the body of this request. No
other operations will be possible.
tags:
- Business Registration
parameters: []
responses:
'200':
description: Delegated authority token created and returned in
response header named Two-Delegated-Authority-Token
'400':
description: Invalid request, for instance no roles specified.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DelegatedAuthorityRequestSchema'
/registry/v1/proposal/returning-buyer/verification:
post:
summary: Start returning buyer verification
operationId: returning_buyer_start_verification_handler.post
description: Check if a business is already registered with the provided
email address. If found, initiate email verification by sending a
verification code to that address. Use this endpoint to identify returning
buyers before creating a new proposal. If a 404 is returned, no existing
registration was found and you should proceed with proposal creation
for a new buyer. Requires a delegation token with `verify_returning_buyer`
permission.
tags:
- Business Registration
parameters: []
responses:
'201':
description: Verification initiated. A verification code has been
sent to the email address.
'400':
description: Invalid request.
'404':
description: No existing business found for this email. Proceed
with new registration.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EmailVerificationStartRequestSchema'
patch:
summary: Complete returning buyer verification
operationId: returning_buyer_complete_verification_handler.patch
description: Validate the verification code sent to the buyer's email.
If successful and a matching business is found, returns the buyer's
business details (company name, organization number, addresses, etc.).
Use the returned details to identify the buyer without requiring them
to re-register. Requires a delegation token with `verify_returning_buyer`
permission.
tags:
- Business Registration
parameters: []
responses:
'200':
description: Verification successful. Returns the buyer's business
details if a match was found, or an empty object if verification
succeeded but no business details are available.
'400':
description: Invalid verification code or request.
'429':
description: Too many verification attempts. Please try again
later.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EmailVerificationCompleteRequestSchema'
components:
schemas:
CreateProposalSchema:
properties:
proposed_business:
description: Details of the business that is being proposed for
enrollment or update
discriminator:
mapping:
GOVERNMENT_DEPARTMENT: '#/components/schemas/ProposedGovernmentDepartmentRequestSchema'
SOLE_TRADER: '#/components/schemas/ProposedSoleTraderRequestSchema'
propertyName: business_type
oneOf:
- $ref: '#/components/schemas/ProposedSoleTraderRequestSchema'
- $ref: '#/components/schemas/ProposedGovernmentDepartmentRequestSchema'
title: Proposed Business
required:
- proposed_business
title: CreateProposalSchema
type: object
AddressHistorySchema:
description: |-
The address history of a significant person associated with a business. Note that a separate building name/number
and street address are both required and neither may be empty.
properties:
apartment:
anyOf:
- type: string
- type: 'null'
default: null
description: Apartment, suite or room number
title: Apartment
building:
description: Building name or number
title: Building
type: string
street:
description: Street name
title: Street
type: string
postal_code:
title: Postal Code
type: string
city:
title: City
type: string
region:
anyOf:
- type: string
- type: 'null'
default: null
title: Region
country_code:
$ref: '#/components/schemas/CountryCodeEnum'
date_from:
format: date
title: Date From
type: string
date_until:
anyOf:
- format: date
type: string
- type: 'null'
default: null
title: Date Until
required:
- building
- street
- postal_code
- city
- country_code
- date_from
title: AddressHistorySchema
type: object
BusinessAddressSchema:
description: |-
A trading address associated with a business. Note that a separate building name/number
and street address are both required and neither may be empty.
properties:
apartment:
anyOf:
- type: string
- type: 'null'
default: null
description: Apartment, suite or room number
title: Apartment
building:
description: Building name or number
title: Building
type: string
street:
description: Street name
title: Street
type: string
postal_code:
title: Postal Code
type: string
city:
title: City
type: string
region:
anyOf:
- type: string
- type: 'null'
default: null
title: Region
country_code:
$ref: '#/components/schemas/CountryCodeEnum'
required:
- building
- street
- postal_code
- city
- country_code
title: BusinessAddressSchema
type: object
ContactDetailsSchema:
description: Contact details for a person associated with a business.
properties:
title:
anyOf:
- type: string
- type: 'null'
default: null
title: Title
first_name:
title: First Name
type: string
middle_names:
anyOf:
- type: string
- type: 'null'
default: null
title: Middle Names
last_name:
title: Last Name
type: string
email:
anyOf:
- format: email
type: string
- type: 'null'
default: null
title: Email
phone:
anyOf:
- type: string
- type: 'null'
default: null
title: Phone
required:
- first_name
- last_name
title: ContactDetailsSchema
type: object
CountryCodeEnum:
enum:
- AD
- AE
- AL
- AM
- AO
- AR
- AT
- AU
- AZ
- BA
- BB
- BD
- BE
- BF
- BG
- BH
- BI
- BJ
- BN
- BO
- BR
- BS
- BW
- CA
- CG
- CH
- CL
- CM
- CO
- CR
- CY
- CZ
- DE
- DJ
- DK
- DO
- DZ
- EC
- EE
- EG
- ES
- ET
- FI
- FJ
- FR
- GA
- GB
- GE
- GH
- GN
- GQ
- GR
- GT
- GY
- HN
- HR
- HT
- HU
- ID
- IE
- IL
- IN
- IQ
- IS
- IT
- JM
- JO
- JP
- KE
- KG
- KH
- KR
- KW
- KZ
- LA
- LB
- LI
- LK
- LT
- LU
- LV
- LR
- MA
- MC
- MD
- ME
- MG
- MK
- MN
- MR
- MT
- MU
- MV
- MW
- MX
- MY
- MZ
- NA
- NE
- NG
- NL
- 'NO'
- NP
- NZ
- OM
- PA
- PE
- PG
- PH
- PK
- PL
- PT
- PY
- QA
- RO
- RS
- RW
- SA
- SE
- SG
- SI