API explorer
Every endpoint of the Partner API, generated from the OpenAPI specification, with Try it out against the sandbox.
Using the explorer
- Get a sandbox credential. Its
client_idstartspart_test_; ask us atinfo@batteryhealthcheck.co.uk(see Getting sandbox access). This page works with sandbox credentials only. It will not send any otherclient_id, and the API answers a production credential or token used from this page with403and the error codesandbox_only, before it does anything else. Call the API with a production credential from your own servers, where you will never see that code. - Press Authorize, enter your sandbox
client_idandclient_secret, leave the scopes unticked to receive all of yours, and press Authorize. The page exchanges them for a one-hour token atPOST /v1/oauth/token. The secret stays in this tab and is not stored. - Open an endpoint, press Try it out, then Execute. Every answer comes from the sandbox’s fixture cars and carries
BHC-Environment: sandbox. The parameters and request bodies start filled in with fixture values that work: test990000001, VINBHCTESTVIN0000001, and dealer990001in the stock check’s body. Fixture test ids start at990000001and fixture dealer ids at990001; the fixture table says what each one shows.POST /oauth/tokenis the one exception: its form starts with the placeholderspart_test_REPLACE_MEandREPLACE_ME, so type your sandboxclient_idandclient_secretover them, and leavescopeempty to receive all of your scopes. You do not need it to try the other operations: Authorize gets their token for you.
A sandbox credential behaves as a platform credential, so a few operations answer it with an error here, as they would answer a platform:
- the Dealers operations need a dealer-group credential:
403 insufficient_scope; - the Beta valuation operations answer
404 not_foundunless their scope has been added to your credential, which we do on request; POST /mcprefuses any request sent from a web page, because it carries anOriginheader (403); call it from your own servers;POST /sandbox/simulateneeds one of your webhooks subscribed to the event first, otherwise422 validation.
Webhooks you register here are real registrations on your sandbox credential. Before you press Execute on POST /webhooks, put your own receiver’s URL in place of the example’s https://example.com/bhc/webhooks: sent as it stands, the example takes one of your five endpoints and its deliveries go to example.com. DELETE /webhooks/{webhook_id} frees the place again. Then simulate an event to receive one. Prefer a desktop client? Import the Postman collection. For the reasoning behind each endpoint, read the API reference; for each field, the data dictionary.