This guide provides a step-by-step tutorial on how to use the SIM validation feature to confirm a SIM's availability before placing a product order. By performing this check, you can avoid order rejections due to SIMs that are already associated with a subscription or are otherwise unavailable for use.
Step 1: Get an access token
Before making calls, you must authenticate.
- Send a POST request to the /oauth/accesstoken endpoint with your client ID and secret.
- Use the accessToken returned in the response in the Authorization header for all subsequent API calls.
Find your credentials Authentication docs
Step 2: Perform a SIM Validation
The core function of the API is to validate SIM serial numbers via the Mobile Inventory Management API. To get the result, send a GET request to the /product endpoint.
Important: Every SIM serial number used as a query parameter must be prefixed with SIMPS:.
Scenario A: Single SIM validation
- Endpoint: GET /product
- Query parameter: id=SIMPS:{id}
- Example:
GET https://api.wholesale.bt.com/mobile/tmf/productInventoryManagement/v4/product?id=SIMPS:341241100994
Scenario B: Multiple SIM validation
You can validate multiple SIMs in a single request by separating the IDs with a comma (encoded as %2C). You can include a maximum of 100 SIMs in a single API call.
- Endpoint: GET /product
- Query parameter: id=SIMPS:{id1}%2CSIMPS:{id2}%2C…
- Example:
GET https://api.wholesale.bt.com/mobile/tmf/productInventoryManagement/v4/product?id=SIMPS:341241100994%2CSIMPS:341241100995
Required headers
| Header parameter | Description | Example value |
|---|---|---|
| APIGW-Tracking-Header | A unique UUID you generate to track the transaction from end to end (a 36-character alphanumeric string "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"). | 96bb97fa-b941-46bb-8c4e-86c616c28a13 |
| Authorization | The OAuth 2.0 access token you obtained in Step 1. | Bearer <accessToken> |
| Content-Type | Specifies the expected response format. | application/json |
| source | A label identifying that the order is from a Wholesale reseller. Only one value is permitted. | business.mobile.reseller |
Step 3: Understand the response
The API will return the status of each SIM requested.
|
Property |
Example value |
Details |
|---|---|---|
|
product.products[0].id |
"SIMPS:341241100994" |
The unique ID for the SIM check, including the required prefix. |
|
SIMNumber |
"341241100994" |
The SIM serial number returned by the API. |
|
SIMAvailableToUse |
true / false |
Indicates if the SIM is free to be activated. Proceed with a product order only if SIMAvailableToUse is true. |
|
status |
"created" |
The "created" status generally indicates the SIM is available to use. Other possible values are:
|
- View an example "SIM found" response
-
{"product": {"products": [{"id": "SIMPS:341241100994","productSpecification": {"id": "FMS011","name": "SIM","@referredType": "ProductSpecification"},"productCharacteristic": [{"name": "SIMNumber","value": "341241100994"},{"name": "SIMAvailableToUse","value": true}],"status": "created","@type": "Product Specification"}]}}
- View an example "SIM Not found or Unavailable" response
-
{"product": {"products": [{"id": "SIMPS:477344679349","productCharacteristic": [{"name": "SIMNumber","value": "477344679349"},{"name": "SIMAvailableToUse","value": false}],"status": null,"@type": "Product Specification"}]}}
Note: A SIM may be unavailable if it is currently in cooling-off, already in use, or assigned to another pending order.
Troubleshooting
If your request is unsuccessful, the API will return a synchronous error response.
For general authentication and request errors, such as 401 Unauthorized or 404 Not Found, please see our main Troubleshooting guide for a complete list of standard codes and solutions.
Common API-specific errors
For issues specific to the API, the service will return a 400 Bad Request or 403 Forbidden status. The exact cause will be detailed in the JSON response body with a specific errorCode, which you can find in the table below.
|
Code |
Reason |
How to fix |
|---|---|---|
|
25 |
Missing header: <parameter> |
Your request is missing a required header. Check that both the APIGW-Tracking-Header and Authorization headers are present and correctly formatted, as shown in Step 2. |
|
27 |
Missing query-string parameter: id |
Ensure you have included the ?id= parameter in your GET request. |
|
28 |
Invalid query-string parameter value |
|
|
51 |
Forbidden Requester |
The SIM you are querying does not belong to your reseller account inventory. |
|
61 |
Method not allowed |
You are using an incorrect HTTP method. This endpoint only supports GET. Correct the method and resubmit. |
Next steps
Once you have validated that your SIMs are available to use, you can proceed to place your order.