Skip to main content
Version: 1.0

Autofill API

Download this API's OpenAPI YAML

API for saving and retrieving buyer details, to support autofill of checkout fields.

Subject to a buyer's opt-in consent, any merchant may store that buyer's details using this API. Those details may then be retrieved by that merchant, or any other Two-powered merchant, for the purposes of autofilling checkout information for that buyer. If consent is not provided the API may still be used to store details non-persistently for the duration of the buyer's current browser session, facilitating the transmission of buyer details between Two-hosted and merchant-hosted pages within the same workflow.

Environments​

Testing​

https://api.sandbox.two.inc

Note: Read about our sandbox environment specific behaviour.

Production​

https://api.two.inc

Authentication​

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:

  • env is determined by the environment (prod for production, test for test environments)
  • key is a random, URL-safe, 64-bit encoded text string containing 32 random bytes.

Security Scheme Type:

apiKey

Header parameter name:

X-Api-Key