Trade Account API V2 (deprecated)
Download this API's OpenAPI YAML
Deprecated: please use Trade Account API V3 instead.
This API allows you to onboard your business customers to your own product and to the Two "Buy Now Pay Later" product.
Specifically:
- Enable 1-click checkout with Two
- Approve additional users to place orders on behalf of your business customers
- Access insights and enriched data on your business customers
- Receive validation that Two believes it is an accurate and valid representative of the business
Note: Merchant ID is denoted as mid. This can be obtained alongside the API key from the merchant portal.
Step 1: Create a B2B business customer
- Create a new business customer using the
POST /v2/merchant/<mid>/customerendpoint.
Step 2: Create users for your business customers.
- 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_urlfor them to verify their account. Verification of the customer user will allow one-click purchases for the customer user. - Remember to keep contact info up-to-date, like email and phone number, through
PUT /v2/merchant/<mid>/customer/<cid>/user/<uid>
Note: Two reserves the right to add extra verification steps for certain orders.
Environments
Testing
Note: Read about our sandbox environment specific behaviour.
Production
Authentication
- API Key: X-Api-Key
For instructions on how to obtain API keys, visit this page. You will obtain two different keys, an initial one for testing in our sandbox environment and once ready, for production. Your API keys enables others to act on your behalf if they are able to obtain them, so make sure to keep them safe. Your API key is not to be shared with anyone, including in your version control system, client-side code, in public chatrooms and so on. The API key is applied in the request header. For example:
GET /something
X-Api-Key: secret_test_aabbccddeeff0123456789
API Keys have the following structure: secret_<env>_<key> where:
envis determined by the environment (prodfor production,testfor test environments)keyis a random, URL-safe, 64-bit encoded text string containing 32 random bytes.
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | X-Api-Key |