Download OpenAPI specification:Download
This API allows you to onboard your business customers to your own product and to the Two "Buy Now Pay Later" product.
Specifically:
Note: Merchant ID is denoted as mid
. This can be obtained alongside the API key from the merchant portal.
POST /v2/merchant/<mid>/customer
endpoint.The employees who place orders on behalf of your business customer (their employer), can be set up for purchasing through POST /v2/merchant/<mid>/customer/<cid>/user
.
Upon successfully creating a customer user, onboarding is completed. You may optionally redirect the user to the user_verification_url
for them to verify their account. Verification of the customer user will allow one-click purchases for the customer user.
Note: Two reserves the right to add extra verification steps for certain orders.
Created
Error response
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
[- {
- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
]
OK
Error response
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
OK
Error response
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_customer_id": "string",
- "official_address": {
- "organization_name": "string",
- "street_address": "string",
- "country": "AT",
- "postal_code": "string",
- "city": "string",
- "region": ""
}, - "shipping_addresses": [
- {
- "organization_name": "string",
- "street_address": "string",
- "country": "AT",
- "postal_code": "string",
- "city": "string",
- "region": ""
}
], - "merchant_redirect_urls": {
- "onboarding_completed_url": "string",
- "onboarding_failed_url": "string"
}, - "country_prefix": "GB",
- "email_domain": "string",
- "insights_webhook": "string",
- "legal_name": "string",
- "organization_id": "string",
- "trade_name": "string",
- "website": "string",
- "webhooks": {
- "on_updates_url": "string",
- "on_errors_url": "string"
}, - "billing_email_address": "user@example.com",
- "additional_identifiers": {
- "property1": "string",
- "property2": "string"
}
}
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "organization_id": "13078389",
- "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "region": "GB",
- "street_address": "4 Crown Pl",
- "postal_code": "EC2A 4BT"
}, - "website": "example.com"
}
Redirect to the GET customer endpoint (/v2/merchant/
Error response
{- "error_code": "string",
- "error_details": "string",
- "error_message": "string",
- "error_json": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
], - "error_trace_id": "string"
}
Created
Error response
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
]
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": true,
- "user_verification_url": "string",
- "verified": true
}
Fetch a list of users attached to the business customer account
OK
Error response
[- {
- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": true,
- "user_verification_url": "string",
- "verified": true
}
]
OK
Error response
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": true,
- "user_verification_url": "string",
- "verified": true
}
OK
Error response
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": true,
- "user_verification_url": "string",
- "verified": true
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": true,
- "user_verification_url": "string",
- "verified": true
}
Send a notification to customer user with a URL to complete onboarding via specified notification channel.
OK
Error response
{- "channel": "sms"
}
{- "error_code": "string",
- "error_details": "string",
- "error_message": "string",
- "error_json": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
], - "error_trace_id": "string"
}
OK
Error response
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": "string",
- "verification_success_redirect_url": "string",
- "verified_fields": [
- "string"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": true,
- "user_verification_url": "string",
- "verified": true
}
OK
Error response
{- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_credit_limits": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "buyer_company_name": "string",
- "buyer_organization_number": "string",
- "credit_limit": 0,
- "credit_limit_balance": 0,
- "max_single_order_value": 0,
- "buyer_is_in_arrears": true,
- "currency": "string",
- "last_repayment_time_this_buyer": "2019-08-24T14:15:22Z",
- "last_repayment_time_any_buyer": "2019-08-24T14:15:22Z",
- "credit_approved": true,
- "decline_reason": "string",
- "country": "AT",
- "additional_data_required": "string"
}
]
}
OK
Error response
{- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_credit_limits": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "buyer_company_name": "string",
- "buyer_organization_number": "string",
- "credit_limit": 0,
- "credit_limit_balance": 0,
- "max_single_order_value": 0,
- "buyer_is_in_arrears": true,
- "currency": "string",
- "last_repayment_time_this_buyer": "2019-08-24T14:15:22Z",
- "last_repayment_time_any_buyer": "2019-08-24T14:15:22Z",
- "credit_approved": true,
- "decline_reason": "string",
- "country": "AT",
- "additional_data_required": "string"
}
]
}