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.POST /v2/merchant/<mid>/customer/<cid>/user
.user_verification_url
for them to verify their account. Verification of the customer user will allow one-click purchases for the customer user.PUT /v2/merchant/<mid>/customer/<cid>/user/<uid>
Note: Two reserves the right to add extra verification steps for certain orders.
This is only available for merchants that have been approved for credit lines.
OK
Error response
{- "requested_amount": "50000.00",
- "currency": "CHF"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "requested_amount": "50000.00",
- "approved_amount": "40000.00",
- "available_balance": "25000.00",
- "currency": "EUR",
- "status": "PENDING",
}
No Content
Error response
{- "ubo_information": [
- {
- "first_name": "Alice",
- "last_name": "Cooper",
- "nin_or_dob": "1970-01-01",
- "ownership_percentage": "string",
- "country_code": "AD"
}
]
}
{- "error_code": null,
- "error_details": null,
- "error_message": null,
- "error_json": null,
- "error_trace_id": null
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "requested_amount": "50000.00",
- "approved_amount": "40000.00",
- "available_balance": "25000.00",
- "currency": "EUR",
- "status": "PENDING",
}
OK
Error response
{- "currency": "CHF",
- "transactions": [
- {
- "amount": "-5000.00",
- "date": "2024-01-02",
- "description": "Puchase of goods",
- "id": "4f9d0783-5282-43e2-8751-c860e2529c7b",
- "reference": "Invoice #1001",
- "type": "WITHDRAWAL"
}, - {
- "amount": "-10000.00",
- "date": "2024-01-02",
- "description": "Puchase of goods",
- "id": "4f9d0783-5282-43e2-8751-c860e2529c7b",
- "reference": "Invoice #1002",
- "type": "RESERVATION"
}, - {
- "amount": "5000.00",
- "date": "2024-01-02",
- "description": "Payment received for invoice #1001",
- "id": "4f9d0783-5282-43e2-8751-c860e2529c7b",
- "reference": "#10222",
- "type": "PAYMENT"
}
]
}
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": null,
- "invoice_email_addresses": null,
- "email_domain": null,
- "legal_name": null,
- "merchant_customer_id": "string",
- "merchant_redirect_urls": null,
- "official_address": null,
- "website": null,
- "insights_webhook": null,
- "shipping_addresses": null,
- "trade_name": null,
- "webhooks": null,
- "additional_identifiers": null,
- "estimated_monthly_spend": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "approved_for_credit": true,
- "review_status": "PENDING_MANUAL_REVIEW",
- "buyer_is_in_arrears": null,
- "decline_reason": null,
- "country_prefix": "GB",
- "organization_id": null,
- "approved_for_credit_with_conditions": {
- "description": "During verification the customer user will be asked to consent to credit check, consent will trigger a credit check",
- "value": "CREDIT_CHECK_CONSENT"
}, - "max_single_order_value": null,
- "credit_limit": null,
- "credit_limit_balance": null,
- "credit_limit_currency": "GBP"
}
Fetch a list of customers. Use ?limit or ?page_cursor parameter for cursor-based pagination.
Customer list - returns CustomerResponseListSchemaV2 by default, or CustomerResponseListPaginatedSchemaV2 when limit parameter is provided
Error response
[ ]
OK
Error response
{- "billing_email_address": null,
- "invoice_email_addresses": null,
- "email_domain": null,
- "legal_name": null,
- "merchant_customer_id": "string",
- "merchant_redirect_urls": null,
- "official_address": {
- "organization_name": "string",
- "street_address": "string",
- "country": "AD",
- "postal_code": "string",
- "city": "string",
- "region": ""
}, - "website": null,
- "insights_webhook": null,
- "shipping_addresses": null,
- "trade_name": null,
- "webhooks": null,
- "additional_identifiers": null,
- "estimated_monthly_spend": null
}
{- "billing_email_address": null,
- "invoice_email_addresses": null,
- "email_domain": null,
- "legal_name": null,
- "merchant_customer_id": "string",
- "merchant_redirect_urls": null,
- "official_address": null,
- "website": null,
- "insights_webhook": null,
- "shipping_addresses": null,
- "trade_name": null,
- "webhooks": null,
- "additional_identifiers": null,
- "estimated_monthly_spend": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "approved_for_credit": true,
- "review_status": "PENDING_MANUAL_REVIEW",
- "buyer_is_in_arrears": null,
- "decline_reason": null,
- "country_prefix": "GB",
- "organization_id": null,
- "approved_for_credit_with_conditions": {
- "description": "During verification the customer user will be asked to consent to credit check, consent will trigger a credit check",
- "value": "CREDIT_CHECK_CONSENT"
}, - "max_single_order_value": null,
- "credit_limit": null,
- "credit_limit_balance": null,
- "credit_limit_currency": "GBP"
}
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) Deprecated Default: null Deprecated, please use invoice_email_addresses. | |
Email Domain (string) or Email Domain (null) (Email Domain) Deprecated Default: null Unique name that appears after the @ sign in email addresses | |
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. | |
Array of Invoice Email Addresses (strings) or Invoice Email Addresses (null) (Invoice Email Addresses) Default: null These email addresses is designated to receive the invoices attached to this trade account in addition to the user email used to create orders. In case the order is placed using a billing account ID, emails will be directed to the address specified for that billing account instead. | |
Legal Name (string) or Legal Name (null) (Legal Name) Deprecated Default: null The legal name of the buyer company, deprecated as Two company search will set the customer legal name | |
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 | |
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
{- "merchant_customer_id": null,
- "official_address": null,
- "shipping_addresses": null,
- "merchant_redirect_urls": null,
- "email_domain": null,
- "insights_webhook": null,
- "legal_name": null,
- "trade_name": null,
- "website": null,
- "webhooks": null,
- "billing_email_address": null,
- "invoice_email_addresses": null,
- "additional_identifiers": null,
- "organization_id": null
}
{- "billing_email_address": null,
- "invoice_email_addresses": null,
- "email_domain": null,
- "legal_name": null,
- "merchant_customer_id": "string",
- "merchant_redirect_urls": null,
- "official_address": null,
- "website": null,
- "insights_webhook": null,
- "shipping_addresses": null,
- "trade_name": null,
- "webhooks": null,
- "additional_identifiers": null,
- "estimated_monthly_spend": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "approved_for_credit": true,
- "review_status": "PENDING_MANUAL_REVIEW",
- "buyer_is_in_arrears": null,
- "decline_reason": null,
- "country_prefix": "GB",
- "organization_id": null,
- "approved_for_credit_with_conditions": {
- "description": "During verification the customer user will be asked to consent to credit check, consent will trigger a credit check",
- "value": "CREDIT_CHECK_CONSENT"
}, - "max_single_order_value": null,
- "credit_limit": null,
- "credit_limit_balance": null,
- "credit_limit_currency": "GBP"
}
{- "billing_email_address": null,
- "invoice_email_addresses": null,
- "email_domain": null,
- "legal_name": null,
- "merchant_customer_id": "string",
- "merchant_redirect_urls": null,
- "official_address": null,
- "website": null,
- "insights_webhook": null,
- "shipping_addresses": null,
- "trade_name": null,
- "webhooks": null,
- "additional_identifiers": null,
- "estimated_monthly_spend": null,
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",
- "approved_for_credit": true,
- "review_status": "PENDING_MANUAL_REVIEW",
- "buyer_is_in_arrears": null,
- "decline_reason": null,
- "country_prefix": "GB",
- "organization_id": null,
- "approved_for_credit_with_conditions": {
- "description": "During verification the customer user will be asked to consent to credit check, consent will trigger a credit check",
- "value": "CREDIT_CHECK_CONSENT"
}, - "max_single_order_value": null,
- "credit_limit": null,
- "credit_limit_balance": null,
- "credit_limit_currency": "GBP"
}
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,
- "credit_builder_url": null
}
Fetch a list of users attached to the business customer account. Use ?limit or ?page_cursor parameter for cursor-based pagination.
Limit (integer) or Limit (null) (Limit) Default: null The maximum number of items on a single page, ie the page size. | |
Page Cursor (string) or Page Cursor (null) (Page Cursor) Default: null The requested page, base64str encoded. |
Customer user list - returns CustomerUserResponseListSchemaV2 by default, or CustomerUserResponseListPaginatedSchemaV2 when limit parameter is provided
Error response
[ ]
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 | |
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
}
{- "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,
- "credit_builder_url": null
}
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
}
{- "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,
- "credit_builder_url": null
}
{- "error_code": null,
- "error_details": null,
- "error_message": null,
- "error_json": null,
- "error_trace_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,
- "credit_builder_url": null
}
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,
- "credit_builder_url": null
}