> For the complete documentation index, see [llms.txt](https://developers.bloomcredit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.bloomcredit.io/docs/v2.1/quick-start/ordering-credit-data.md).

# Order Credit Data

Retrieving Credit Data for Consumers from Bloom's Data Access API

## Creating a Credit Data Order

After creating a consumer (see [Create Consumer](/docs/v2.1/quick-start/create-your-first-consumer.md) for reference as how to register a consumer), you can start ordering credit data for that consumer using a **credential** (with `credential_id` in the request). The credential determines which SKU and bureau configuration will be used for the order.

{% hint style="info" %}
**Note:**

If you aren't sure about what `credential` you may have, you can reach out to Bloom Credit and we'll help you understand them.
{% endhint %}

Credit Data can be ordered synchronously (blocking) or asynchronously (non-blocking), and the HTTP request will either return immediately when ordering credit data asynchronously, or the HTTP request will wait until the entire credit data order completes in a terminal state.

Please refer to [Order States](/docs/v2.1/data-access/status-codes.md#order-states) for more information on how the order can be processed.

<details>

<summary>Order Credit Data Sample Request</summary>

You can see an example of a `POST` request made to the **Order Credit Data** endpoint below:

{% code title="cURL" %}

```bash
curl --location --request POST 'https://sandbox.bloom.dev/v2/data-access/orders' \
--header 'Authorization: Bearer <ACCESS_TOKEN_WILL_BE_HERE>' \
--header 'X-Bas-Router: true' \
--header 'Content-Type: application/json' \
--data '{
  "data": {
    "type": "orders",
    "attributes": {
      "consumer_id": "<CONSUMER_ID>",
      "credential_id": "<CREDENTIAL_ID>"
    }
  }
}'
```

{% endcode %}

{% code title="HTTP" %}

```http
POST /v2/data-access/orders HTTP/1.1
Host: sandbox.bloom.dev
Authorization: Bearer <ACCESS_TOKEN_WILL_BE_HERE>
X-Bas-Router: true
Content-Type: application/json
Content-Length: 541

{
  "data": {
    "type": "orders",
    "attributes": {
      "consumer_id": "<CONSUMER_ID>",
      "credential_id": "<CREDENTIAL_ID>"
    }
  }
}
```

{% endcode %}

{% code title="JavaScript - Fetch" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <ACCESS_TOKEN_WILL_BE_HERE>");
myHeaders.append("X-Bas-Router", "true");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "data": {
    "type": "orders",
    "attributes": {
      "consumer_id": "<CONSUMER_ID>",
      "credential_id": "<CREDENTIAL_ID>"
    }
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://sandbox.bloom.dev/v2/data-access/orders", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endcode %}

{% code title="Python - Request" %}

```python
import requests
import json

url = "https://sandbox.bloom.dev/v2/data-access/orders"

payload = json.dumps({
  "data": {
    "type": "orders",
    "attributes": {
      "consumer_id": "<CONSUMER_ID>",
      "credential_id": "<CREDENTIAL_ID>"
    }
  }
})
headers = {
  'Authorization': 'Bearer <ACCESS_TOKEN_WILL_BE_HERE>',
  'X-Bas-Router': 'true',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endcode %}

{% code title="Node.js" %}

```
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://sandbox.bloom.dev/v2/data-access/orders',
  'headers': {
    'Authorization': 'Bearer <ACCESS_TOKEN_WILL_BE_HERE>',
    'X-Bas-Router': 'true',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "data": {
      "type": "orders",
      "attributes": {
        "consumer_id": "<CONSUMER_ID>",
        "credential_id": "<CREDENTIAL_ID>"
      }
    }
  })
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

{% endcode %}

{% code title="Go" %}

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  url := "https://sandbox.bloom.dev/v2/data-access/orders"
  method := "POST"

  payload := strings.NewReader(`{
  "data": {
    "type": "orders",
    "attributes": {
      "consumer_id": "<CONSUMER_ID>",
      "credential_id": "<CREDENTIAL_ID>"
    }
  }
}`)

  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer <ACCESS_TOKEN_WILL_BE_HERE>")
  req.Header.Add("X-Bas-Router", "true")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endcode %}

{% hint style="info" %}
**Credential**

The `credential_id` identifies the credential configuration to use for this order. Each credential is associated with a specific SKU and bureau configuration.
{% endhint %}

</details>

<details>

<summary>Order Credit Data Sample Response</summary>

You can see an example of a response from the **Order Credit Data** endpoint below:

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
        "attributes": {
            "status": "PROCESSING"
        }
    }
}
```

{% endcode %}

</details>

<details>

<summary>Rejected Order response</summary>

{% code title="JSON" %}

```json
{
  "data": {
    "type": "orders",
    "id": "5ebf4d5c-15f8-492d-8f72-b593f80b35cf",
    "attributes": {
      "status_code": "10",
      "status_message": "SKU not enabled",
      "status": "REJECTED"
    }
  }
}
```

{% endcode %}

</details>

<details>

<summary>Async Order response</summary>

{% code title="JSON" %}

```json
{
  "data": {
    "type": "orders",
    "id": "4d6d92af-ae16-4dac-b028-3c9172e60ddc",
    "attributes": {
      "status": "PROCESSING"
    }
  }
}
```

{% endcode %}

</details>

<details>

<summary>Get Success Order response</summary>

{% code title="JSON" %}

```json
{ 
  "data": {
    "type": "orders",
    "id": "4d6d92af-ae16-4dac-b028-3c9172e60ddc",
    "attributes": {
      "consumer_id": "52705fc7-d0ff-47b9-bbfd-5519b706c541",
  		"credential_id": "0da2c731-8a5b-40d6-92d5-f338d8e4e5be",
      "order_placed": "2023-04-17T17:57:21.812057Z",
      "order_filled": "2023-04-17T17:57:21.98094Z",
      "order_updated": "2023-04-17T17:57:21.99703Z",
      "status": "SUCCESS"
    }
  }
}
```

{% endcode %}

</details>

<details>

<summary>API Documentation</summary>

## v1 API

If you're looking for our previous Data Access API version, see [Version 1 Documentation](https://docs.bloom.dev/docs/credit-data-api/0d8e4de7cb383-ordering-data)

## v2 API

For API documentation regarding orders, see [Version 2 API Documentation](/docs/v2.1/quick-start/ordering-credit-data.md)

</details>

<details>

<summary>Possible causes for REJECTED response</summary>

## Possible causes for REJECTED response

Status code 10: SKU not enabled. The SKU is not enabled for the provided credential.

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
        "attributes": {
            "status_code": "10",
            "status_message": "SKU not enabled",
            "status": "REJECTED"
        }
    }
}
```

{% endcode %}

Status code 11: Invalid consumer id. The consumer ID is not valid or doesn't exists.

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
        "attributes": {
            "status_code": "11",
            "status_message": "Invalid consumer id",
            "status": "REJECTED"
        }
    }
}
```

{% endcode %}

Status code 12: Invalid credential id. The credential ID is not valid or doesn't exist.

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
        "attributes": {
            "status_code": "12",
            "status_message": "Invalid credential id",
            "status": "REJECTED"
        }
    }
}
```

{% endcode %}

Status code 13: minor. The consumer ID provided belongs to a minor.

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
        "attributes": {
            "status_code": "13",
            "status_message": "Consumer is under 18",
            "status": "REJECTED"
        }
    }
}
```

{% endcode %}

Status code 14: Consumer deleted. The consumer is deleted or not found.

{% code title="JSON" %}

```json
{
  "data": {
      "type": "order",
      "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
      "attributes": {
          "status_code": "14",
          "status_message": "Consumer is deleted or not found",
          "status": "REJECTED"
      }
  }
}
```

{% endcode %}

</details>

## Checking order status

After submitting an order for consumer data, you can then check order status by just passing using the order\_id that we originally provided to you.

<details>

<summary>Get order status sample request</summary>

You can see an example of a `GET` request made to the required **Order Credit Data** endpoint below:

{% code title="cURL" %}

```bash
curl --location --request GET 'https://sandbox.bloom.dev/v2/data-access/orders/<ORDER-ID>' \
--header 'Authorization: Bearer <ACCESS_TOKEN_WILL_BE_HERE>' \
--header 'X-Bas-Router: true'
```

{% endcode %}

{% code title="HTTP" %}

```http
GET /v2/data-access/orders/<ORDER-ID> HTTP/1.1
Host: sandbox.bloom.dev
Authorization: Bearer <ACCESS_TOKEN_WILL_BE_HERE>
X-Bas-Router: true
```

{% endcode %}

{% code title="JavaScript - Fetch" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <ACCESS_TOKEN_WILL_BE_HERE>");
myHeaders.append("X-Bas-Router", "true");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://sandbox.bloom.dev/v2/data-access/orders/<ORDER-ID>", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endcode %}

{% code title="Python - Request" %}

```python
import requests
import json

url = "https://sandbox.bloom.dev/v2/data-access/orders/<ORDER-ID>"

headers = {
  'Authorization': 'Bearer <ACCESS_TOKEN_WILL_BE_HERE>',
  'X-Bas-Router': 'true'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

```

{% endcode %}

{% code title="Node.js" %}

```
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://sandbox.bloom.dev/v2/data-access/orders/<ORDER-ID>',
  'headers': {
    'Authorization': 'Bearer <ACCESS_TOKEN_WILL_BE_HERE>',
    'X-Bas-Router': 'true'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endcode %}

{% code title="Go" %}

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  url := "https://sandbox.bloom.dev/v2/data-access/orders/<ORDER-ID>"
  method := "GET"

  client := &http.Client{}
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer <ACCESS_TOKEN_WILL_BE_HERE>")
  req.Header.Add("X-Bas-Router", "true")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endcode %}

</details>

<details>

<summary>Get order status sample response</summary>

You can see an example of the response with the details of the order here:

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "b097d8cd-f72b-4fbb-aad1-7454e0e8ce82",
        "attributes": {
            "consumer_id": "1f3259d8-f115-4c4b-9bf6-3b704f57b9a7",
            "credential_id": "0da2c731-8a5b-40d6-92d5-f338d8e4e5be",
  					"sku": "core-credit.gold.us.equifax",
            "order_placed": "2023-03-16T18:28:42.297018Z",
            "order_filled": "2023-03-16T18:28:42.433244Z",
            "order_updated": "2023-03-16T18:28:42.45531Z",
            "status": "SUCCESS"
        }
    }
}
```

{% endcode %}

</details>

<details>

<summary>API Documentation</summary>

## v1 API

If you're looking for our previous Data Access API version, see [Version 1 Documentation](https://docs.bloom.dev/docs/credit-data-api/0d8e4de7cb383-ordering-data)

## v2 API

For API documentation regarding orders, see [Version 2 API Documentation](/docs/v2.1/data-access/status-codes.md)

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.bloomcredit.io/docs/v2.1/quick-start/ordering-credit-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
