Download OpenAPI specification:Download
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.
A newly created proposal will have a status of DRAFT
. In this status it is possible to upload supporting evidence.
Once all evidence has been uploaded, the proposal must be submitted for review to begin. Posting to the submission
endpoint causes the proposal status to progress to SUBMITTED.
Once a proposal reaches SUBMITTED status, an initial automated evaluation is undertaken. This may result in immediate
approval or rejection. If, however, manual review is to be undertaken, the proposal's status will update to IN_REVIEW
.
Once all required review stages are complete (or if the initial automated evaluation resulted in immediate approval or
rejection), the proposal status will update to ACCEPTED
or DECLINED
. Alternatively the proposal status will be
updated to WITHDRAWN
if a DELETE operation is performed on it while its status is IN_REVIEW
or SUBMITTED
.
During review, Two may reach out to the business described within the proposal (via the email address and phone number provided within the proposal), or to the merchant who raised the proposal, for more information.
Once a proposal has been accepted, Two will generate a synthetic organization number for the business in question and update the proposal record accordingly. This synthetic organization number may then be used by the merchant on other Two APIs in exactly the same way as for an actual registered business to create trade accounts, place orders, etc on behalf of the business.
Completion of review stages and subsequent creation of an organization number will be communicated back to the initiating merchant via webhooks.
Proposal creation and submission may be undertaken either by calling this API with the merchant's API key, or else via the delegated authority route which allows browser-side scripts to invoke this API on the merchant's behalf. To use this option, first POST to the delegation endpoint and pass the resulting header token back to the browser; then the browser may POST to /proposal with that token in a request header. A replacement token will be returned from the proposal creation operation with authority to track, withdraw and submit the newly created proposal.
Note that proposals may include personal information about people associated with the business. Once a proposal has been either accepted or declined, that personal information is no longer visible through this API.
Also note that the docs below include reference to government departments to illustrate how this API will handle different types of business, and also that the docs below include a country code for enrollment of businesses of any nationality; however implementation is for the time being limited to UK and US sole traders only.
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.
Proposal has been accepted for review.
Proposal is invalid.
{- "proposed_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "proprietor_details": {
- "title": "string",
- "first_name": "string",
- "middle_names": "string",
- "last_name": "string",
- "email": "user@example.com",
- "phone": "string",
- "date_of_birth": "2019-08-24",
- "address_history": [
- {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT",
- "date_from": "2019-08-24",
- "date_until": "2019-08-24"
}
], - "national_identity_numbers": [
- {
- "identity_number_type": "SOCIAL_SECURITY_NUMBER",
- "identity_number": "string"
}
]
}
}
}
{- "id": "string",
- "proposed_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "proprietor_details": {
- "title": "string",
- "first_name": "string",
- "middle_names": "string",
- "last_name": "string",
- "email": "user@example.com",
- "phone": "string",
- "date_of_birth": "2019-08-24",
- "address_history": [
- {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT",
- "date_from": "2019-08-24",
- "date_until": "2019-08-24"
}
], - "national_identity_numbers": [
- {
- "identity_number_type": "SOCIAL_SECURITY_NUMBER",
- "identity_number": "string"
}
]
}
}, - "enrolled_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "id": "string",
- "organization_number": "string"
}, - "status": "DRAFT"
}
Get all matching proposals. At least one search parameter must be provided. 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.
Proposals
{- "items": [
- { }
], - "page": {
- "items": 0,
- "limit": 0,
- "current": 0,
- "pages": 0
}
}
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.
Proposal
Proposal not found
{- "id": "string",
- "proposed_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "proprietor_details": {
- "title": "string",
- "first_name": "string",
- "middle_names": "string",
- "last_name": "string",
- "email": "user@example.com",
- "phone": "string",
- "date_of_birth": "2019-08-24",
- "address_history": [
- {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT",
- "date_from": "2019-08-24",
- "date_until": "2019-08-24"
}
], - "national_identity_numbers": [
- {
- "identity_number_type": "SOCIAL_SECURITY_NUMBER",
- "identity_number": "string"
}
]
}
}, - "enrolled_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "id": "string",
- "organization_number": "string"
}, - "status": "DRAFT"
}
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.
Proposal
Proposal not found
Proposal is not in a suitable state for withdrawals
{- "id": "string",
- "proposed_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "proprietor_details": {
- "title": "string",
- "first_name": "string",
- "middle_names": "string",
- "last_name": "string",
- "email": "user@example.com",
- "phone": "string",
- "date_of_birth": "2019-08-24",
- "address_history": [
- {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT",
- "date_from": "2019-08-24",
- "date_until": "2019-08-24"
}
], - "national_identity_numbers": [
- {
- "identity_number_type": "SOCIAL_SECURITY_NUMBER",
- "identity_number": "string"
}
]
}
}, - "enrolled_business": {
- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "id": "string",
- "organization_number": "string"
}, - "status": "DRAFT"
}
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
.
Proposal
Proposal not found
Proposal is not in a suitable state for submission
{- "initiation_method": "EMAIL"
}
{- "initiation_method": "SKIP",
- "proposal_id": "The id of the proposal for which verification has been initiated."
}
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.
Matching businesses
Parameters are invalid.
{- "items": [
- { }
], - "page": {
- "items": 0,
- "limit": 0,
- "current": 0,
- "pages": 0
}
}
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.
Business
Business not found
{- "business_type": "SOLE_TRADER",
- "country_code": "AT",
- "trading_name": "string",
- "website": "string",
- "email": "string",
- "phone": "string",
- "tax_number": "string",
- "business_address": {
- "apartment": "string",
- "building": "string",
- "street": "string",
- "postal_code": "string",
- "city": "string",
- "region": "string",
- "country_code": "AT"
}, - "id": "string",
- "organization_number": "string"
}
Checks the validity of a browser delegation token, returning the token data if valid.
Delegated authority token data in the response body
Invalid request, for instance if provided Two-Delegated-Authority-Token has expired
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.
Delegated authority token created and returned in response header named Two-Delegated-Authority-Token
Invalid request, for instance no roles specified.
{- "create_proposal": true
}