{
  "info": {
    "_postman_id": "bhc-partner-api-v1",
    "name": "Battery Health Check Partner API v1",
    "description": "One request for every endpoint in the Battery Health Check API reference (https://developers.batteryhealthcheck.co.uk/index.html), generated from the OpenAPI specification. Set `client_id` and `client_secret` in the collection variables: a pre-request script fetches the token and reads it from `data.access_token`. A sandbox credential (client_id `part_test_...`) answers every request from fixtures; the starting values of `test_id` and `dealer_id` are fixture ids. Requests your kind of credential cannot call answer 403 or 404: see the reference.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{access_token}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Fetch a token when the cached one is missing or within a minute of",
          "// expiry. The token is inside the response envelope: data.access_token.",
          "if (pm.request.url.getPath().endsWith('/oauth/token')) { return; }",
          "var now = Math.floor(Date.now() / 1000);",
          "var exp = parseInt(pm.collectionVariables.get('access_token_expires_at') || '0', 10);",
          "if (pm.collectionVariables.get('access_token') && exp > now + 60) { return; }",
          "pm.sendRequest({",
          "  url: pm.collectionVariables.get('base_url') + '/oauth/token',",
          "  method: 'POST',",
          "  header: { 'Content-Type': 'application/x-www-form-urlencoded' },",
          "  body: {",
          "    mode: 'urlencoded',",
          "    urlencoded: [",
          "      { key: 'grant_type', value: 'client_credentials' },",
          "      { key: 'client_id', value: pm.collectionVariables.get('client_id') },",
          "      { key: 'client_secret', value: pm.collectionVariables.get('client_secret') }",
          "    ]",
          "  }",
          "}, function (err, resp) {",
          "  if (err) { console.log('token request failed', err); return; }",
          "  var body = resp.json();",
          "  if (!body || !body.data) { console.log('token request refused', body); return; }",
          "  pm.collectionVariables.set('access_token', body.data.access_token);",
          "  pm.collectionVariables.set('access_token_expires_at',",
          "    String(Math.floor(Date.now() / 1000) + body.data.expires_in));",
          "});"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.batteryhealthcheck.co.uk/v1",
      "type": "string"
    },
    {
      "key": "client_id",
      "value": "part_REPLACE_ME",
      "type": "string"
    },
    {
      "key": "client_secret",
      "value": "REPLACE_ME",
      "type": "string"
    },
    {
      "key": "access_token",
      "value": "",
      "type": "string"
    },
    {
      "key": "access_token_expires_at",
      "value": "0",
      "type": "string"
    },
    {
      "key": "test_id",
      "value": "990000001",
      "type": "string"
    },
    {
      "key": "dealer_id",
      "value": "990001",
      "type": "string"
    },
    {
      "key": "webhook_id",
      "value": "1",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Exchange credentials for a token",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/oauth/token",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "oauth",
                "token"
              ]
            },
            "description": "OAuth 2.0 client-credentials grant, form-encoded. Returns a JWT valid for one hour. **Cache it** — this endpoint is limited to 10 requests a minute.\n\nThe token is in the standard `{\"data\": …}` envelope (`data.access_token`), and the same four values are repeated at the top level of the body, as OAuth 2.0 has them, so a stock OAuth client library works unchanged. The response carries `Cache-Control: no-store`.\n\nSend `client_id` and `client_secret` in the form body, or as HTTP Basic authentication (`Authorization: Basic base64(client_id:client_secret)`). Use one or the other: when the form body carries `client_secret`, the body is used and the header is ignored.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "client_credentials"
                },
                {
                  "key": "client_id",
                  "value": "{{client_id}}"
                },
                {
                  "key": "client_secret",
                  "value": "{{client_secret}}"
                },
                {
                  "key": "scope",
                  "value": "",
                  "disabled": true,
                  "description": "Optional: a space-separated subset of your scopes."
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the token this request returned. It is inside data.",
                  "var body = pm.response.json();",
                  "if (body && body.data && body.data.access_token) {",
                  "  pm.collectionVariables.set('access_token', body.data.access_token);",
                  "  pm.collectionVariables.set('access_token_expires_at',",
                  "    String(Math.floor(Date.now() / 1000) + body.data.expires_in));",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Tests",
      "item": [
        {
          "name": "Find tests",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "per_page",
                  "value": "25",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "vin",
                  "value": "BHCTESTVIN0000001",
                  "description": "Full 17-character VIN for an exact match, or 3+ characters for a prefix match.",
                  "disabled": true
                },
                {
                  "key": "registration",
                  "value": "ZZ19 PLT",
                  "description": "Number plate. Exact match, case and space insensitive.",
                  "disabled": true
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealer_id}}",
                  "description": "Only the tests run at this one site, within your reach: not its branches, unlike `dealer_id` on the batch lookup, stock check and battery readings. To list a group or a platform connection, leave it out or call once per site (`sites[].dealer_id`).",
                  "disabled": true
                },
                {
                  "key": "since",
                  "value": "2026-10-01T00:00:00Z",
                  "description": "ISO 8601. Tests from this instant onwards.",
                  "disabled": true
                },
                {
                  "key": "until",
                  "value": "2026-10-31T23:59:59Z",
                  "description": "ISO 8601. Tests up to this instant.",
                  "disabled": true
                },
                {
                  "key": "updated_since",
                  "value": "2026-10-01T00:00:00Z",
                  "description": "ISO 8601. Tests created or changed from this instant onwards (`updated_at >= updated_since`). A time without an offset is read as UTC.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "",
                  "description": "Comma-separated. Only tests in one of these lifecycle states: `pending`, `in_progress`, `completed`, `failed`, `cancelled`. Case is ignored.",
                  "disabled": true
                },
                {
                  "key": "warranty_state",
                  "value": "",
                  "description": "Comma-separated, at most 10 values. Only tests whose `warranty_state` is one of these, for example `ACTIVE,INELIGIBLE`. Case is ignored. A test with no warranty state never matches.",
                  "disabled": true
                },
                {
                  "key": "completed_since",
                  "value": "",
                  "description": "ISO 8601. Tests completed from this instant onwards (`results_received_at >= completed_since`). A time without an offset is read as UTC. A test with no completion time never matches.",
                  "disabled": true
                },
                {
                  "key": "completed_until",
                  "value": "",
                  "description": "ISO 8601. Tests completed up to this instant (`results_received_at <= completed_until`). A time without an offset is read as UTC.",
                  "disabled": true
                },
                {
                  "key": "unit_id",
                  "value": "",
                  "description": "Only tests run on this unit (`unit_id` on the test).",
                  "disabled": true
                },
                {
                  "key": "powertrain",
                  "value": "",
                  "description": "Comma-separated, at most 10 values. Only tests whose `vehicle.powertrain` is one of these, for example `BEV,PHEV`. Case is ignored. A test with no powertrain never matches.",
                  "disabled": true
                },
                {
                  "key": "model_group_id",
                  "value": "",
                  "description": "Only tests whose `vehicle.model_group_id` is exactly this, the id of the model group the car was tested as. Case is ignored. A test with no model group id never matches. Up to 64 letters, digits, hyphens, underscores and dots.",
                  "disabled": true
                },
                {
                  "key": "current",
                  "value": "",
                  "description": "`true`: only each car's current test, the one its publish decision names as `current_test_id`: its most recent completed test with a battery-health figure or, when no completed test has one, its most recent test. Only tests of the same VIN that this credential can read are compared, and a platform's only within the dealer that owns the test, so a car tested at two unrelated connected dealers has one current test at each. The other filters choose which current tests are returned; they never narrow the comparison. So with `registration`, a car's current test is returned only when it carries that registration: a car whose current test was recorded without the plate, or under an earlier one, returns nothing for it. Search by `vin` to be sure of the current test. `false` (the default) applies no filter.",
                  "disabled": true
                }
              ]
            },
            "description": "Search by VIN or by registration. **Join on `vin`** — plates transfer between vehicles and a test recorded without a plate can only be found by VIN.\n\nMarketplace credentials must supply `vin` or `registration`: on those, a request with neither returns `400 invalid_request`, and `dealer_id`, `since`/`until` or `updated_since` alone is not a substitute. Dealer-group credentials may list without a filter.\n\nTo keep a copy of the results in step, poll with `updated_since` rather than `since`: `since` filters on `tested_at`, which does not move when a test lands late, gains a registration or changes warranty state. Results stay ordered newest-first by `tested_at`.\n\nEvery filter narrows the others (they are AND-combined); a list parameter matches any of its values. To show one result per car, pass `current=true`: only each car's current test is returned, the test its publish decision names as `current_test_id` (its newest completed test with a battery-health figure, else its newest test), so a failed or inconclusive retest never hides an earlier result. `status=completed` alone does not do that.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get a test",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}"
              ]
            },
            "description": "Interpret `battery.soh_percent` together with `result_status` before displaying it publicly. `vehicle_supported` describes the model and is a separate consideration.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get the certificate (PDF)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}/certificate",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}",
                "certificate"
              ],
              "query": [
                {
                  "key": "variant",
                  "value": "",
                  "description": "Which version. `full` shows the VIN and is never for a public page; it is the default on a dealer credential. A platform, marketplace or sandbox credential receives the anonymised version only: its default is `anonymised`, and `full` is `403 variant_not_permitted`. `anonymised` (`anonymized` is accepted) hides the VIN and may be shown on a public page such as an advert. Case is ignored. Platforms: each copy with `public_display` true is one that clause 5 of the Platform Terms names for public pages. The preview image and the anonymised certificate carry the test's result, so they go on a public page only when the test's publish decision has `image.publishable` true, whatever `public_display` says.",
                  "disabled": true
                }
              ]
            },
            "description": "The certificate PDF, in two versions. On a dealer credential, without `variant` this returns the complete certificate, including the VIN, with exactly the keys it always has: it is for the dealer record rather than public display. `?variant=anonymised` returns the same certificate with the VIN hidden, which may be shown on a public page. The full version carries identifiers reserved for the dealer's own record, so a platform, marketplace or sandbox credential receives the anonymised version only: without `variant` it gets that version, and `?variant=full` is `403 variant_not_permitted`. Platforms: each copy with `public_display` true is one that clause 5 of the Platform Terms names for public pages. The preview image and the anonymised certificate carry the test's result, so they go on a public page only when the test's publish decision has `image.publishable` true, whatever `public_display` says. This endpoint does not check the decision. A request that names a `variant`, and every response to a platform, marketplace or sandbox credential, also receives `variant` and `public_display`. For an image on a listing, the preview endpoint is the usual choice.\n\nScope: `read:certificates`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get the publishable preview (JPEG)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}/preview",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}",
                "preview"
              ]
            },
            "description": "Public-facing certificate image. The VIN is not shown and AVILOO's certificate number printed on it is masked. Includes a QR code linking to AVILOO's hosted validation page. It goes on a public page only when the test's publish decision has `image.publishable` true: this endpoint serves the image of any test whose image is ready, including one the decision rules out.\n\nScope: `read:certificates`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get the AVILOO battery warranty (PDF or image)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}/warranty",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}",
                "warranty"
              ],
              "query": [
                {
                  "key": "variant",
                  "value": "",
                  "description": "Which document. `full` shows the VIN and is never for a public page; it is the default on a dealer credential. A platform or sandbox credential receives the anonymised document only: its default is `anonymised`, and `full` is `403 variant_not_permitted`. `anonymised` (`anonymized` is accepted) hides the VIN and may be shown on a public page such as an advert. Case is ignored. With `format=image` it must be `anonymised`.",
                  "disabled": true
                },
                {
                  "key": "format",
                  "value": "",
                  "description": "`pdf` (the default) or `image`, the anonymised warranty's preview JPEG, which needs `variant=anonymised` on a dealer credential: the full image, which shows the VIN, is not served. On a platform or sandbox credential, whose default is the anonymised version, `format=image` alone returns the anonymised image. `jpeg` and `jpg` mean `image`. Case is ignored.",
                  "disabled": true
                }
              ]
            },
            "description": "AVILOO's own battery warranty document, relayed unaltered, for vehicles whose test qualified. Issuance is automatic at AVILOO's end — nobody applies for it. Check `warranty_available` on the test before calling: most tests do not carry one. Term, limits and cover are stated on the document and are AVILOO's to change.\n\nEvery warranty has two documents: the full one, which shows the VIN, and the anonymised one, which hides it. On a dealer credential, without `variant` this returns the full one, with exactly the keys it always has; a request that names a `variant` also receives `variant` and `public_display`. The full document carries identifiers reserved for the dealer's own record, so a platform or sandbox credential receives the anonymised document and image only: without `variant` it gets the anonymised version, in either format, every response carries `variant` and `public_display`, and `?variant=full` is `403 variant_not_permitted`. The test's `warranty.documents` lists both with their paths (the full item withheld from such a credential). Never publish the full document; a public page uses the anonymised one.\n\nThe anonymised document also comes as a preview image: `?format=image&variant=anonymised` returns the JPEG instead of the PDF (`content_type` `image/jpeg`), and the test's `warranty.images` gives its path. Platforms: each copy with `public_display` true is one that clause 5 of the Platform Terms names for public pages. The preview image and the anonymised certificate carry the test's result, so they go on a public page only when the test's publish decision has `image.publishable` true, whatever `public_display` says. The full image, which shows the VIN, is not served: on a dealer credential `format=image` without `variant=anonymised` is `400 invalid_field`. A request that names a `format` also receives `variant` and `public_display`.\n\nScope: `read:warranties`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Look up several vehicles",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tests/lookup",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "lookup"
              ]
            },
            "description": "Look up several vehicles in one request, each by its full 17-character VIN or by its registration. Each result carries the newest test of that vehicle within your reach (the `GET /tests/{id}` object) and that test's publish decision (the `GET /tests/{id}/publish` object), in the order you sent the vehicles. `current_test` is the test that speaks for the vehicle (the one the decision names as `current_test_id`): show it rather than `latest_test`, which can be a failed or inconclusive retest, and decide from `current_publish`, its own publish decision.\n\nA problem with one vehicle never fails the batch: that item carries an `error` and is not looked up. When both `vin` and `registration` are sent, the VIN is used. A registration can match tests of more than one vehicle once a plate has been transferred: `ambiguous` is then true, and neither publish decision is publishable (reason `AMBIGUOUS_REGISTRATION`) until you send the VIN. Store and join on `vehicle.vin`, never the plate.\n\nUp to 100 vehicles. On a platform credential, pass `dealer_id` to answer for one connected dealer and its branches; without it the vehicles are matched across all your connections, as `GET /tests?vin=` is, and an item whose vehicle has tests at more than one connected dealer carries the warning `MULTIPLE_DEALERS` (never one with `ambiguous` true). Each publish decision is always made within the dealer that owns the test.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"vehicles\": [\n    {\n      \"ref\": \"stock-1\",\n      \"vin\": \"BHCTESTVIN0000001\",\n      \"mileage_miles\": 13500\n    },\n    {\n      \"ref\": \"stock-2\",\n      \"registration\": \"ZZ20 KNR\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get the publish decision for a test",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}/publish",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}",
                "publish"
              ],
              "query": [
                {
                  "key": "advert_mileage_miles",
                  "value": "",
                  "description": "Optional. The mileage on the advert this result will sit beside, in miles: a whole number from 0 to 1,000,000. When it is more than 1,000 miles past the reading at the test, or more than 500 below it, the result is not publishable for that advert.",
                  "disabled": true
                },
                {
                  "key": "include",
                  "value": "",
                  "description": "Optional. Comma-separated opt-in blocks: `dated_result` (the figure of a final result whose only bar is its age, to show with its date) and `warranty_status` (the one line you may show when the AVILOO Battery Warranty is active). Each block you name is always present, null when it does not apply; without `include` the response is unchanged. Anything else returns `400 invalid_field`.",
                  "disabled": true
                }
              ]
            },
            "description": "Battery Health Check's decision on whether this test's result may be published beside the car, with the reasons when it may not, whether the preview image may be shown, ready-made advert copy, plain sentences to repeat as given, and what never to say. Read `publishable` rather than deciding from the test fields yourself. Contains no VIN.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get a test passport",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}/passport",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}",
                "passport"
              ]
            },
            "description": "Everything Battery Health Check holds about one test, for **your own systems**: the test exactly as `GET /tests/{test_id}` returns it, AVILOO's start and completion times, model group and execution protocol, the outcome, the odometer in kilometres and miles, the other tests of the same vehicle that you can read, the registered vehicle details held for the VIN, the car's DVSA MOT history (DVSA's own, synced nightly for every car Battery Health Check tests, or the copy held with the vehicle record where none is held), the checks that were actually made, and the publish decision.\n\n**It contains the VIN: never publish it as it stands.** Only `publish` is written for public display. `vehicle_record` and `mot` carry `public_display: false`, and that data must not appear on a public page. Both are read from what Battery Health Check already holds; this call never looks a vehicle up. Read their `status` first: `found`, `not_found` or `not_offered`.\n\nFor a platform credential, `history` covers only the dealer that connected you for this test (with its branches), never another dealer that tested the same vehicle.\n\nNot available to marketplace credentials (`404 not_found`).\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        }
      ]
    },
    {
      "name": "Stock",
      "item": [
        {
          "name": "Check stock for untested cars",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/stock/check",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "stock",
                "check"
              ]
            },
            "description": "Send the cars a dealer has in stock, up to 100, and get one `next_step` and one `reason` for each, plus a summary. `meta.summary.recommended` counts the cars a battery test is recommended for.\n\n**Platform credentials must pass `dealer_id`**: the check answers for that dealer and its branches, from that dealer's own tests only. A dealer credential may pass it to narrow to one site.\n\nEach car is matched by full VIN, else by registration. Its standing comes from its tests at that dealer; a certified car is judged by the publish decision of its newest certified test, so `retest`, `retest_once` and `contact_us` say why the result cannot be shown. An untested car is checked against the published supported-vehicle list, using the `make`, `model`, `year` and `fuel` you send: `covered` gives `test_this_car`, anything else `confirm_support`.\n\nMarketplace credentials receive `404 not_found`.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dealer_id\": 990001,\n  \"vehicles\": [\n    {\n      \"ref\": \"stock-1\",\n      \"vin\": \"BHCTESTVIN0000001\",\n      \"mileage_miles\": 13500\n    },\n    {\n      \"ref\": \"stock-2\",\n      \"registration\": \"ZZ70 NOT\",\n      \"make\": \"MG\",\n      \"model\": \"MG4 SE Long Range\",\n      \"year\": 2023,\n      \"fuel\": \"ELECTRICITY\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Vehicles and providers",
      "item": [
        {
          "name": "List providers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/providers",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "providers"
              ],
              "query": [
                {
                  "key": "category",
                  "value": "",
                  "description": "Optional. List one category only. Any other value returns `400 invalid_field`.",
                  "disabled": true
                }
              ]
            },
            "description": "The battery-health provider (AVILOO) and the provenance providers this API can present, and the entries of Battery Health Check's own valuation (Beta), each with its `stage`: `live` (answers in production today), `beta` (a Battery Health Check feature you can call now; its shape may change) or `planned` (its shape is published and the sandbox answers it with invented data; nothing from it is served in production yet). `status` and `note` keep their earlier values: `live`, `preview` (stage `beta`) and `subject_to_agreement` (stage `planned`).\n\nThe list describes the API, not anyone's data, so it is the same for every credential and needs no scope beyond a valid token. Each provider's `key` is what `?provider=` takes on `GET /vehicles/battery-readings` and `GET /vehicles/history`; a key is unique within its `category`. Limited to 60 requests a minute, 120 for a platform credential.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get battery readings for a vehicle",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/vehicles/battery-readings",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "vehicles",
                "battery-readings"
              ],
              "query": [
                {
                  "key": "vin",
                  "value": "BHCTESTVIN0000001",
                  "description": "The full 17-character VIN. Exactly one of `vin` and `registration`.",
                  "disabled": true
                },
                {
                  "key": "registration",
                  "value": "ZZ19 PLT",
                  "description": "The registration. Exact match; spaces, hyphens and case are ignored. A plate can match tests of more than one vehicle (`ambiguous`); join on `vehicle.vin`.",
                  "disabled": true
                },
                {
                  "key": "provider",
                  "value": "",
                  "description": "Optional. The key of the battery provider, as `GET /providers?category=battery` lists it: `aviloo`.",
                  "disabled": true
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealer_id}}",
                  "description": "Optional. Answer from this dealer and its branches only. Must be within your reach.",
                  "disabled": true
                }
              ]
            },
            "description": "Every AVILOO battery reading for one vehicle, each in AVILOO's own method, scale and wording. Pass exactly one of `vin` and `registration`.\n\nOne reading for each completed AVILOO test of the vehicle within your reach, newest first, built from the test `GET /tests/{test_id}` returns; the sandbox builds them from its fixture tests in the same way. `providers` lists AVILOO with its status and how many readings it returned.\n\nAn AVILOO reading carries the test's battery warranty in `warranty_product` (the warranty block of the test object) and lists the warranty PDF in `documents` (`warranty_pdf`, scope `read:warranties`) where one is held.\n\nEach reading carries a `comparability_key` (`provider:method`). **Only readings with equal keys are on one scale**: never average, band, rank or compare readings whose keys differ. Before an AVILOO figure goes on an advert, read the test's publish decision (`GET /tests/{test_id}/publish`).\n\nReads only: this call contacts no provider and stores nothing. Limited to 120 requests a minute, 600 for a platform credential. Marketplace credentials receive `404 not_found`.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get the provenance checks for a vehicle",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/vehicles/provenance",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "vehicles",
                "provenance"
              ],
              "query": [
                {
                  "key": "vin",
                  "value": "BHCTESTVIN0000001",
                  "description": "The full 17-character VIN. Exactly one of `vin` and `registration`.",
                  "disabled": true
                },
                {
                  "key": "registration",
                  "value": "ZZ19 PLT",
                  "description": "The registration. Exact match; spaces, hyphens and case are ignored. The answer is for the newest matched test's car; `ambiguous` says the plate matched more than one VIN.",
                  "disabled": true
                },
                {
                  "key": "provider",
                  "value": "",
                  "description": "Optional. The key of one history provider, as `GET /providers?category=history` lists it: `checks` and `providers` then cover that provider only.",
                  "disabled": true
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealer_id}}",
                  "description": "Optional. Answer only when the car has a test at this dealer or its branches. Must be within your reach.",
                  "disabled": true
                }
              ]
            },
            "description": "One vehicle's provenance checks: one check per provider, each with the same twelve sections. Pass exactly one of `vin` and `registration`. `GET /vehicles/provenance` and `GET /vehicles/history` are the same route: the same answer, scope and limits, and one rate-limit allowance shared between the two paths.\n\nAnswered only for a vehicle with a test within your reach; otherwise `found` is false and no provider is consulted.\n\n**In production two providers answer**, from data Battery Health Check already holds for the car. DVSA: the full official MOT history, part of the Battery Health Check vehicle history, synced nightly from DVSA's own data and matched on the registration of the newest test in your reach; its check carries `mot_tests`, every other section `not_checked`, and its `attribution_text` is the Open Government Licence v3.0 statement to show with it. A car with no DVSA history held is listed with `reason: no_record`. The vehicle record provider (`vdg`): the vehicle record the test passport carries, with the copy of the MOT history held alongside it: `identity` and `mot_tests`, and `status` (the DVLA import, export and scrapped markers) where the record carries them; every other section `not_checked`. Each check stands alone. This call never looks a vehicle up and never contacts a provider. While a provider's data is not being supplied, it returns no check and its `reason` is `not_offered`. Every other provenance provider is Planned (`status: subject_to_agreement`) and returns no check in production. The sandbox adds invented checks from them, marked `sandbox_illustrative`.\n\n`previous_use` (taxi, private hire, police and other earlier uses, with their dates) comes from Planned providers only. `status` records carry `status_type` (`scrapped`, `exported` or `imported`), `date`, `country` (ISO 3166 alpha-2, null when not known) and `source`.\n\nEach MOT record carries the full test: `mot_test_number`, `completed_at` (UTC, with its time; null when only the date is held), the odometer with its `result_type` and its unit (null when the record gives none; never assumed), every defect with its `type` and `dangerous` flag, `data_source`, `provider` and `retrieved_at`.\n\nEach section's `status` is one of eight states, and **only `none_found` may be shown as \"none recorded\"**. A mileage anomaly is the provider's own flag, never Battery Health Check's judgement. Never merge two providers' checks into one verdict.\n\nLimited to 120 requests a minute, 600 for a platform credential. Marketplace credentials receive `404 not_found`.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get the history checks for a vehicle (alias)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/vehicles/history",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "vehicles",
                "history"
              ],
              "query": [
                {
                  "key": "vin",
                  "value": "BHCTESTVIN0000001",
                  "description": "The full 17-character VIN. Exactly one of `vin` and `registration`.",
                  "disabled": true
                },
                {
                  "key": "registration",
                  "value": "ZZ19 PLT",
                  "description": "The registration. Exact match; spaces, hyphens and case are ignored. The answer is for the newest matched test's car; `ambiguous` says the plate matched more than one VIN.",
                  "disabled": true
                },
                {
                  "key": "provider",
                  "value": "",
                  "description": "Optional. The key of one history provider, as `GET /providers?category=history` lists it: `checks` and `providers` then cover that provider only.",
                  "disabled": true
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealer_id}}",
                  "description": "Optional. Answer only when the car has a test at this dealer or its branches. Must be within your reach.",
                  "disabled": true
                }
              ]
            },
            "description": "The same route as `GET /vehicles/provenance`, under its earlier name: the same answer, and one rate-limit allowance shared with it.\n\nOne vehicle's provenance checks: one check per provider, each with the same twelve sections. Pass exactly one of `vin` and `registration`. `GET /vehicles/provenance` and `GET /vehicles/history` are the same route: the same answer, scope and limits, and one rate-limit allowance shared between the two paths.\n\nAnswered only for a vehicle with a test within your reach; otherwise `found` is false and no provider is consulted.\n\n**In production two providers answer**, from data Battery Health Check already holds for the car. DVSA: the full official MOT history, part of the Battery Health Check vehicle history, synced nightly from DVSA's own data and matched on the registration of the newest test in your reach; its check carries `mot_tests`, every other section `not_checked`, and its `attribution_text` is the Open Government Licence v3.0 statement to show with it. A car with no DVSA history held is listed with `reason: no_record`. The vehicle record provider (`vdg`): the vehicle record the test passport carries, with the copy of the MOT history held alongside it: `identity` and `mot_tests`, and `status` (the DVLA import, export and scrapped markers) where the record carries them; every other section `not_checked`. Each check stands alone. This call never looks a vehicle up and never contacts a provider. While a provider's data is not being supplied, it returns no check and its `reason` is `not_offered`. Every other provenance provider is Planned (`status: subject_to_agreement`) and returns no check in production. The sandbox adds invented checks from them, marked `sandbox_illustrative`.\n\n`previous_use` (taxi, private hire, police and other earlier uses, with their dates) comes from Planned providers only. `status` records carry `status_type` (`scrapped`, `exported` or `imported`), `date`, `country` (ISO 3166 alpha-2, null when not known) and `source`.\n\nEach MOT record carries the full test: `mot_test_number`, `completed_at` (UTC, with its time; null when only the date is held), the odometer with its `result_type` and its unit (null when the record gives none; never assumed), every defect with its `type` and `dangerous` flag, `data_source`, `provider` and `retrieved_at`.\n\nEach section's `status` is one of eight states, and **only `none_found` may be shown as \"none recorded\"**. A mileage anomaly is the provider's own flag, never Battery Health Check's judgement. Never merge two providers' checks into one verdict.\n\nLimited to 120 requests a minute, 600 for a platform credential. Marketplace credentials receive `404 not_found`.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        }
      ]
    },
    {
      "name": "Valuations (Beta)",
      "item": [
        {
          "name": "(Beta) Value a car by VIN or registration",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/valuations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "valuations"
              ],
              "query": [
                {
                  "key": "vin",
                  "value": "BHCTESTVIN0000001",
                  "description": "The full 17-character VIN.",
                  "disabled": true
                },
                {
                  "key": "registration",
                  "value": "ZZ19 PLT",
                  "description": "The registration. Exact match; spaces, hyphens and case are ignored.",
                  "disabled": true
                },
                {
                  "key": "dealer_id",
                  "value": "{{dealer_id}}",
                  "description": "Required on a platform or sandbox credential: the dealer whose car this is. Optional on a dealer credential. Must be within your access.",
                  "disabled": true
                },
                {
                  "key": "mileage_miles",
                  "value": "",
                  "description": "Optional. The car's current mileage. Defaults to the odometer at the test.",
                  "disabled": true
                },
                {
                  "key": "adjustment_mode",
                  "value": "",
                  "description": "Optional. `percent` (the default) or `absolute`. Sending it (or `currency`) adds `adjustment` and `value_grid` to the answer; a `valuation=bhc_valuation` request carries both whether or not you send either.",
                  "disabled": true
                },
                {
                  "key": "currency",
                  "value": "",
                  "description": "Optional. `GBP` (the default) or `EUR`: the currency of an absolute adjustment and of the value grid. With it, `base_currency` must be the same currency.",
                  "disabled": true
                },
                {
                  "key": "valuation",
                  "value": "",
                  "description": "Optional. `battery_adjustment` (the default) or `bhc_valuation`, Battery Health Check's own value for the car in `values`, which always returns its grid (`adjustment` and `value_grid`, in percent mode and GBP unless `adjustment_mode` or `currency` says otherwise); send no `base_*` with it.",
                  "disabled": true
                },
                {
                  "key": "base_provider",
                  "value": "",
                  "description": "Optional. `platform`: your own figure, the only base. Not with `valuation=bhc_valuation`.",
                  "disabled": true
                },
                {
                  "key": "base_type",
                  "value": "",
                  "description": "Optional, with `base_amount` and `base_currency`: the type of your own value for the car. The three go together, or not at all.",
                  "disabled": true
                },
                {
                  "key": "base_amount",
                  "value": "",
                  "description": "Your own value, in whole units of `base_currency`.",
                  "disabled": true
                },
                {
                  "key": "base_currency",
                  "value": "",
                  "description": "`GBP`; or the currency you sent in `currency`.",
                  "disabled": true
                },
                {
                  "key": "base_source",
                  "value": "",
                  "description": "Optional label for where your value came from: at most 40 letters, digits, spaces, dots, hyphens or underscores.",
                  "disabled": true
                }
              ]
            },
            "description": "Supply exactly one of `vin` and `registration`. The car's current test within your access is used, the one its publish decision calls current; a registration that matches tests of more than one VIN refers with `REGISTRATION_MATCHES_SEVERAL_VEHICLES`, so ask again by VIN. A car with no test within your access is answered too: `battery` is null and every block says `not_tested`.\n\nSend `adjustment_mode` (`percent`, the default, or `absolute`) or `currency` (`GBP`, the default, or `EUR`) to receive the valuation adjuster (`adjustment`) and the Battery Health Check value grid (`value_grid`). The adjuster compares the measured state of health with the one expected for the car's age and mileage, and gives the difference as a percentage of value, or in absolute mode as an amount in `currency`, taken from your own `base_amount` when you send one and otherwise from Battery Health Check's own value. `adjustment.apply` says how to apply it to your own valuation; it never adds value and never takes off more than 15 percent. A battery that may not be published, or is below 70 percent, refers: no figure. A car with no test within your access is `not_tested`.\n\n**Beta**: a Battery Health Check feature you can call now; its shape may change. Figures in the sandbox now; production figures follow. Production answers today carry no figure: `adjustment` and `value_grid` say `refer` or `not_tested` where that applies and otherwise `not_available` with `VALUATIONS_NOT_LIVE`. Sandbox answers are invented and carry `illustrative: true` and `SANDBOX_DATA`. Never for public display.\n\nNeeds the `read:valuations` scope, which Battery Health Check adds to a dealer, platform or sandbox credential on request. Without it the route answers `404 not_found`, as an unknown path does. Limited to 60 requests a minute, 120 for a platform credential.\n\nScope: `read:valuations`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "(Beta) Value the car of one test",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tests/{{test_id}}/valuation",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tests",
                "{{test_id}}",
                "valuation"
              ],
              "query": [
                {
                  "key": "mileage_miles",
                  "value": "",
                  "description": "Optional. The car's current mileage. Defaults to the odometer at the test.",
                  "disabled": true
                },
                {
                  "key": "adjustment_mode",
                  "value": "",
                  "description": "Optional. `percent` (the default) or `absolute`. Sending it (or `currency`) adds `adjustment` and `value_grid` to the answer; a `valuation=bhc_valuation` request carries both whether or not you send either.",
                  "disabled": true
                },
                {
                  "key": "currency",
                  "value": "",
                  "description": "Optional. `GBP` (the default) or `EUR`: the currency of an absolute adjustment and of the value grid. With it, `base_currency` must be the same currency.",
                  "disabled": true
                },
                {
                  "key": "valuation",
                  "value": "",
                  "description": "Optional. `battery_adjustment` (the default) or `bhc_valuation`, Battery Health Check's own value for the car in `values`, which always returns its grid (`adjustment` and `value_grid`, in percent mode and GBP unless `adjustment_mode` or `currency` says otherwise); send no `base_*` with it.",
                  "disabled": true
                },
                {
                  "key": "base_provider",
                  "value": "",
                  "description": "Optional. `platform`: your own figure, the only base. Not with `valuation=bhc_valuation`.",
                  "disabled": true
                },
                {
                  "key": "base_type",
                  "value": "",
                  "description": "Optional, with `base_amount` and `base_currency`: the type of your own value for the car. The three go together, or not at all.",
                  "disabled": true
                },
                {
                  "key": "base_amount",
                  "value": "",
                  "description": "Your own value, in whole units of `base_currency`.",
                  "disabled": true
                },
                {
                  "key": "base_currency",
                  "value": "",
                  "description": "`GBP`; or the currency you sent in `currency`.",
                  "disabled": true
                },
                {
                  "key": "base_source",
                  "value": "",
                  "description": "Optional label for where your value came from: at most 40 letters, digits, spaces, dots, hyphens or underscores.",
                  "disabled": true
                }
              ]
            },
            "description": "The valuation from one test. A superseded test refers with `SUPERSEDED` and names the newer test in `superseded_by`.\n\nSend `adjustment_mode` (`percent`, the default, or `absolute`) or `currency` (`GBP`, the default, or `EUR`) to receive the valuation adjuster (`adjustment`) and the Battery Health Check value grid (`value_grid`). The adjuster compares the measured state of health with the one expected for the car's age and mileage, and gives the difference as a percentage of value, or in absolute mode as an amount in `currency`, taken from your own `base_amount` when you send one and otherwise from Battery Health Check's own value. `adjustment.apply` says how to apply it to your own valuation; it never adds value and never takes off more than 15 percent. A battery that may not be published, or is below 70 percent, refers: no figure. A car with no test within your access is `not_tested`.\n\n**Beta**: a Battery Health Check feature you can call now; its shape may change. Figures in the sandbox now; production figures follow. Production answers today carry no figure: `adjustment` and `value_grid` say `refer` or `not_tested` where that applies and otherwise `not_available` with `VALUATIONS_NOT_LIVE`. Sandbox answers are invented and carry `illustrative: true` and `SANDBOX_DATA`. Never for public display.\n\nNeeds the `read:valuations` scope, which Battery Health Check adds to a dealer, platform or sandbox credential on request. Without it the route answers `404 not_found`, as an unknown path does. Limited to 60 requests a minute, 120 for a platform credential.\n\nScope: `read:valuations`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        }
      ]
    },
    {
      "name": "Platforms",
      "item": [
        {
          "name": "List the dealers connected to you",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/connections",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "connections"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "per_page",
                  "value": "25",
                  "description": "",
                  "disabled": true
                }
              ]
            },
            "description": "**Platform credentials only.** Every dealer that has connected your platform, with every site the connection covers: the dealer itself, then its branches. Your reach is exactly these sites, so `GET /tests` and webhooks cover them and nothing else. A dealer that disconnects is absent from the next response. `platform_reference` echoes the `ref` your Connect link carried, so you can match each connection to your own dealer record.\n\nAny other kind of credential receives `404 not_found`.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Get your Connect settings",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/connect-settings",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "connect-settings"
              ]
            },
            "description": "**Platform credentials only.** Your Connect link, so you never need to ask for it again, and your registered return URLs. A sandbox credential may call it too (`connect_url` is null). Any other kind of credential receives `404 not_found`.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Replace your return URLs",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/connect-settings",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "connect-settings"
              ]
            },
            "description": "**Platform credentials only.** `return_urls` replaces the whole list; `[]` clears it. Other keys are ignored, so the `GET` body can be sent back. Up to five, each an absolute `https` URL of at most 500 characters, printable ASCII with no spaces or backslash, without a fragment, credentials or wildcard, on a public host that is not one of ours, with no dot segments or encoded slashes in the path, and no duplicates. An unchanged list writes nothing and keeps `updated_at`.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"return_urls\": [\n    \"https://app.your-platform.example/bhc/return\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Dealers (dealer-group credentials)",
      "item": [
        {
          "name": "List your dealers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/dealers",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dealers"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "per_page",
                  "value": "25",
                  "description": "",
                  "disabled": true
                }
              ]
            },
            "description": "Scope: `read:dealers`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Create a dealer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Required. ASCII alphanumeric, hyphen, underscore and dot; max 80 characters. Retries with the same key return the original resource."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dealers",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dealers"
              ]
            },
            "description": "Provisions a new dealer or branch. Partner-created dealers are created **active**, and a `bhc.dealer.activated` webhook fires.\n\nScope: `write:dealers`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Example Motors Leeds\",\n  \"primary_contact_name\": \"A. Manager\",\n  \"primary_contact_email\": \"aftersales@example-motors.test\",\n  \"primary_contact_phone\": \"+44 113 496 0000\",\n  \"internal_reference\": \"your-site-code-0042\",\n  \"num_boxes\": 1,\n  \"shipping_address\": {\n    \"line1\": \"1 Example Way\",\n    \"city\": \"Leeds\",\n    \"postcode\": \"LS11 1AA\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a dealer",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/dealers/{{dealer_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dealers",
                "{{dealer_id}}"
              ]
            },
            "description": "Re-fetch this to inspect unit lifecycle — there is no box-activation event in v1.\n\nScope: `read:dealers`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Update a dealer",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dealers/{{dealer_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dealers",
                "{{dealer_id}}"
              ]
            },
            "description": "Scope: `write:dealers`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"primary_contact_phone\": \"+44 113 496 0001\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Order more AVILOO units",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Required. ASCII alphanumeric, hyphen, underscore and dot; max 80 characters. Retries with the same key return the original resource."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dealers/{{dealer_id}}/units",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dealers",
                "{{dealer_id}}",
                "units"
              ]
            },
            "description": "Scope: `write:dealers`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quantity\": 1,\n  \"shipping_address\": {\n    \"label\": \"Service bay 2\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List your webhook endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks"
              ]
            },
            "description": "Scope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Register a webhook endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks"
              ]
            },
            "description": "Answers **201**. At most five enabled endpoints per credential. Which events a credential may subscribe to depends on its kind; anything else is refused with `422 validation`, listing `allowed`.\n\n- Dealer group: `bhc.dealer.activated`, `bhc.test.completed`, `bhc.test.failed`, `bhc.test.warranty_changed`.\n- Platform and sandbox: `bhc.test.completed`, `bhc.test.failed`, `bhc.test.warranty_changed`, `bhc.connection.created`, `bhc.connection.updated`, `bhc.connection.revoked`.\n- Marketplace: `bhc.test.completed`, `bhc.test.failed`, `bhc.test.warranty_changed`.\n\nThe example body's URL, `https://example.com/bhc/webhooks`, only shows the shape: put your own receiver's URL in its place before you send it. Sent as it stands, it registers a real endpoint, which takes one of your five, and its deliveries go to example.com. `DELETE /webhooks/{webhook_id}` frees the place again.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://example.com/bhc/webhooks\",\n  \"events\": [\n    \"bhc.test.completed\",\n    \"bhc.test.failed\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a webhook endpoint",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/webhooks/{{webhook_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "Scope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Delete a webhook endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/webhooks/{{webhook_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "Deletes the endpoint outright; its queued deliveries are not sent. To use the URL again, register it again (a new id and a new secret). A disabled endpoint cannot be re-enabled: delete it and register again.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Send a test ping",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/webhooks/{{webhook_id}}/test",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "{{webhook_id}}",
                "test"
              ]
            },
            "description": "Delivers a `bhc.webhook.test` event. Test events are notifications rather than complete result payloads and carry no vehicle or battery fields. Consumers should branch on the event type before reading `data`. Limited to 10 requests a minute.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html"
          }
        },
        {
          "name": "Re-send failed deliveries",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/{{webhook_id}}/replay",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "{{webhook_id}}",
                "replay"
              ]
            },
            "description": "Re-sends this endpoint's deliveries that have not succeeded, from `since` onwards, each with a fresh set of retries. Deliveries that succeeded are never re-sent. At most 5,000 per call: when there were more, the body adds `truncated` and `total_matching`, so call again with a later `since`. Deliveries to a disabled endpoint are queued but not sent. Limited to 5 requests a minute.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"since\": \"2026-10-01T00:00:00Z\",\n  \"event_types\": [\n    \"bhc.test.completed\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "AI assistants (MCP)",
      "item": [
        {
          "name": "Call the MCP endpoint (AI assistants)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/mcp",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "mcp"
              ]
            },
            "description": "Battery test facts for your own AI agent, over the Model Context Protocol (MCP Streamable HTTP, stateless). Each POST carries one JSON-RPC 2.0 message and the reply is `application/json`; there is no session and no event stream, so `GET` and `DELETE` return 405, and a batch (a JSON array) is refused.\n\nFor platform credentials, called from your own servers with the same bearer token as every other route, refreshed hourly. It is not a ChatGPT or Claude connector. Clause 7 of the Platform Terms governs what your assistant may say. A request carrying an `Origin` header is refused with 403.\n\nProtocol versions `2025-11-25` and `2025-06-18`. Methods: `initialize`, `notifications/initialized`, `ping`, `tools/list`, `tools/call`. Tools: `lookup_battery_test` (`vin` or `registration`, exactly one), `get_publish_statements` (`test_id`; the `GET /tests/{test_id}/publish` object) and `check_stock` (`dealer_id` and up to 25 `vehicles`). `tools/list` gives each tool's input and output schema. No result contains a VIN, and a tool that cannot answer returns a result with `isError: true` whose text block holds `{\"error\": {\"code\", \"message\"}}`.\n\nScope: `read:tests`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"tools/list\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Sandbox",
      "item": [
        {
          "name": "Simulate a webhook event (sandbox only)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/sandbox/simulate",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "sandbox",
                "simulate"
              ]
            },
            "description": "Sandbox credentials only; any other credential receives `404 not_found`. Queues one signed delivery of the event, carrying a fixture test or a fixture connection, to your own webhooks. The payload has exactly the production shape: for a test event, the test object and a `{id, name}` dealer; for a connection event, the fixture connection as the sandbox's `GET /connections` lists it, carrying your `platform_reference` if you send one. Deliveries carry the `BHC-Environment: sandbox` header, and a test event's dealer name and VIN identify the fixture. Delivery, signing, retries and replay work as in production. Limited to 10 requests a minute.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event\": \"bhc.test.completed\",\n  \"fixture_id\": 990000001\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Simulate a connection event with your platform reference (sandbox only)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/sandbox/simulate",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "sandbox",
                "simulate"
              ]
            },
            "description": "Sandbox credentials only; any other credential receives `404 not_found`. Queues one signed delivery of the event, carrying a fixture test or a fixture connection, to your own webhooks. The payload has exactly the production shape: for a test event, the test object and a `{id, name}` dealer; for a connection event, the fixture connection as the sandbox's `GET /connections` lists it, carrying your `platform_reference` if you send one. Deliveries carry the `BHC-Environment: sandbox` header, and a test event's dealer name and VIN identify the fixture. Delivery, signing, retries and replay work as in production. Limited to 10 requests a minute.\n\nScope: `manage:webhooks`.\n\nReference: https://developers.batteryhealthcheck.co.uk/index.html",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event\": \"bhc.connection.created\",\n  \"fixture_id\": 990001,\n  \"platform_reference\": \"c0n-7Hq2xK9vLm4pR8sT\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    }
  ]
}
