> 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/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](/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 **sku** (`sku` name in the request) and a **portfolio** (with `portfolio_id` in the request).

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

If you aren't sure about what `portfolio` or `sku` 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](/data-access/status-codes.md#order-states) for more information on how the order can be processed.

### Order Credit Data Sample Request

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

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://sandbox.bloom.dev/v2/data-access/orders/' \
--header 'Authorization: Bearer <ACCESS_TOKEN_WILL_BE_HERE>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data": {
        "type": "order",
        "attributes": {
            "consumer_id": "<CONSUMER_ID>",
            "portfolio_id": "<ACCOUNT_ID_WILL_BE_HERE>",
            "sku": "equifax-gold-hard-fico"
        }
    }
}'
```

{% endtab %}

{% tab title="HTTP" %}

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

{
   "data": {
        "type": "order",
        "attributes": {
            "consumer_id": "<CONSUMER_ID>",
            "portfolio_id": "<ACCOUNT_ID_WILL_BE_HERE>",
            "sku": "equifax-gold-hard-fico"
        }
    }
}
```

{% endtab %}

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

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

var raw = JSON.stringify({
  "data": {
        "type": "order",
        "attributes": {
            "consumer_id": "<CONSUMER_ID>",
            "portfolio_id": "<ACCOUNT_ID_WILL_BE_HERE>",
            "sku": "equifax-gold-hard-fico"
        }
    }
});

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));
```

{% endtab %}

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

```python
import requests
import json

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

payload = json.dumps({
  "data": {
        "type": "order",
        "attributes": {
            "consumer_id": "<CONSUMER_ID>",
            "portfolio_id": "<ACCOUNT_ID_WILL_BE_HERE>",
            "sku": "equifax-gold-hard-fico"
        }
    }
})
headers = {
  'Authorization': 'Bearer <ACCESS_TOKEN_WILL_BE_HERE>',
  'Content-Type': 'application/json'
}

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

print(response.text)

```

{% endtab %}

{% tab 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>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "data": {
        "type": "order",
        "attributes": {
            "consumer_id": "<CONSUMER_ID>",
            "portfolio_id": "<ACCOUNT_ID_WILL_BE_HERE>",
            "sku": "equifax-gold-hard-fico"
        }
    }
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

{% endtab %}

{% tab title="Go" %}

```go
package main

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

func main() {

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

  payload := strings.NewReader(`{
    "data": {
        "type": "order",
        "attributes": {
            "consumer_id": "<CONSUMER_ID>",
            "portfolio_id": "<ACCOUNT_ID_WILL_BE_HERE>",
            "sku": "equifax-gold-hard-fico"
        }
    }
}`)

  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("Content-Type", "application/json")

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

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

{% endtab %}
{% endtabs %}

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

The `sku` is the name of the SKU bundle you wish to pull data on, they come prepacked for usage of Bloom's API and need to be provided with the request.
{% endhint %}

### Order Credit Data Sample Response

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>

<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",
      "sku": "equifax-bronze-hard",
      "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](/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 given SKU is not enabled for the provided portfolio.

{% 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 portfolio id. The portfolio ID is not valid or doesn't exists.

{% code title="JSON" %}

```json
{
    "data": {
        "type": "order",
        "id": "58cb4230-04ce-4915-9d27-d4deb7b603a0",
        "attributes": {
            "status_code": "12",
            "status_message": "Invalid portfolio 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 minor",
            "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.

### Get order status sample request

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

{% tabs %}
{% tab 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>' \
```

{% endtab %}

{% tab title="HTTP" %}

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

{% endtab %}

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

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <ACCESS_TOKEN_WILL_BE_HERE>");

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));
```

{% endtab %}

{% tab 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>'
}

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

print(response.text)

```

{% endtab %}

{% tab 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>'
  }

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

{% endtab %}

{% tab title="Go" %}

```go
package main

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

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>")

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

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

{% endtab %}
{% endtabs %}

### Get order status sample response

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",
            "sku": "",
            "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>

<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](/reference/data-access/orders/build-a-new-order-for-ingestion.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/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.
