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": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "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": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "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": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "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": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "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": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "website": "example.com"
}
Additional Identifiers (object) or Additional Identifiers (null) (Additional Identifiers) Default: null Optionally provide us with any other relevant identifiers related to this company. | |
Billing Email Address (string) or Billing Email Address (null) (Billing Email Address) Default: null This email address is designated to receive the invoices attached to this trade account. In case the order is placed using a billing account ID, emails will be directed to the address specified for that billing account instead. | |
CountryCodeEnum (string) or null Default: null Country code in ISO 3166-1 alpha-2 format | |
Email Domain (string) or Email Domain (null) (Email Domain) Deprecated Default: null Unique name that appears after the @ sign in email addresses | |
Id (string) or Id (null) (Id) Default: null | |
Insights Webhook (string) or Insights Webhook (null) (Insights Webhook) Default: null Subscribe to updates for company insights. A json object will be POST-ed to this url whenever the insights for this company get updated. The schema for this json-object it the same as for the response body of GET /merchant/{mid}/customer/{cid}/insights. | |
Legal Name (string) or Legal Name (null) (Legal Name) Default: null The legal name of the buyer company | |
Merchant Customer Id (string) or Merchant Customer Id (null) (Merchant Customer Id) Default: null The customer id registered in the merchant's solution | |
MerchantRedirectUrlsSchema (object) or null Default: null | |
CreateAddressRequestSchema (object) or null Default: null Address fields connected to the business customer | |
Organization Id (string) or Organization Id (null) (Organization Id) Default: null National id of the buyer company | |
Array of Shipping Addresses (objects) or Shipping Addresses (null) (Shipping Addresses) Default: null Array of address fields connected to the business customer | |
Trade Name (string) or Trade Name (null) (Trade Name) Default: null If the company is using a different brand/trade name, this can included here. | |
HookSchema (object) or null Default: null | |
Website (string) or Website (null) (Website) Default: null The website of the business customer |
OK
Error response
{- "id": null,
- "merchant_customer_id": null,
- "official_address": null,
- "shipping_addresses": null,
- "merchant_redirect_urls": null,
- "country_prefix": "GB",
- "email_domain": null,
- "insights_webhook": null,
- "legal_name": null,
- "organization_id": null,
- "trade_name": null,
- "website": null,
- "webhooks": null,
- "billing_email_address": null,
- "additional_identifiers": null
}
{- "billing_email_address": "example@gmail.com",
- "country_prefix": "GB",
- "legal_name": "TWO B2B LTD",
- "merchant_customer_id": "merchant-cid-123",
- "merchant_redirect_urls": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "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": {
}, - "official_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "organization_id": "13078389",
- "shipping_address": {
- "city": "London",
- "country": "GB",
- "id": "12345",
- "organization_name": "TWO B2B LTD",
- "postal_code": "EC2A 4BT",
- "region": "GB",
- "street_address": "4 Crown Pl"
}, - "website": "example.com"
}
Redirect to the GET customer endpoint (/v2/merchant/
Error response
{- "error_code": null,
- "error_details": null,
- "error_message": null,
- "error_json": null,
- "error_trace_id": null
}
Created
Error response
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": null,
- "user_verification_url": null,
- "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": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": null,
- "user_verification_url": null,
- "verified": true
}
]
Email (string) or Email (null) (Email) Default: null This is the user email address | |
First Name (string) or First Name (null) (First Name) Default: null This is the user first name | |
Id (string) or Id (null) (Id) Default: null | |
Last Name (string) or Last Name (null) (Last Name) Default: null This is the user last name | |
Merchant User Id (string) or Merchant User Id (null) (Merchant User Id) Default: null Your internal ID of this user (the employee of your business customer). | |
Phone (string) or Phone (null) (Phone) Default: null This is the user phone number | |
Verification Success Redirect Url (string) or Verification Success Redirect Url (null) (Verification Success Redirect Url) Default: null Redirect url after user successfully completes verification | |
Array of Verified Fields (strings) or Verified Fields (null) (Verified Fields) Default: null List of verified user credentials set by the merchant |
OK
Error response
{- "email": null,
- "first_name": null,
- "last_name": null,
- "merchant_user_id": null,
- "phone": null,
- "verification_success_redirect_url": null,
- "verified_fields": null,
- "id": null
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": null,
- "user_verification_url": null,
- "verified": true
}
OK
Error response
{- "email": null,
- "first_name": null,
- "last_name": null,
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": null,
- "verified_fields": null,
- "id": null
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": null,
- "user_verification_url": null,
- "verified": true
}
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": null,
- "user_verification_url": null,
- "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": null,
- "error_details": null,
- "error_message": null,
- "error_json": null,
- "error_trace_id": null
}
OK
Error response
{- "email": "user@example.com",
- "first_name": "string",
- "last_name": "string",
- "merchant_user_id": "string",
- "phone": null,
- "verification_success_redirect_url": "string",
- "verified_fields": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
- "is_legal_rep": null,
- "user_verification_url": null,
- "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": null,
- "credit_limit_balance": null,
- "max_single_order_value": null,
- "buyer_is_in_arrears": null,
- "currency": null,
- "last_repayment_time_this_buyer": null,
- "last_repayment_time_any_buyer": null,
- "credit_approved": null,
- "decline_reason": null,
- "country": null,
- "additional_data_required": null
}
]
}
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": null,
- "credit_limit_balance": null,
- "max_single_order_value": null,
- "buyer_is_in_arrears": null,
- "currency": null,
- "last_repayment_time_this_buyer": null,
- "last_repayment_time_any_buyer": null,
- "credit_approved": null,
- "decline_reason": null,
- "country": null,
- "additional_data_required": null
}
]
}