> 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/data-access/querying-reports.md).

# Querying Reports

Once an order is fulfilled, you may query it using Bloom Credit's GraphQL interface.

## Queries

### Query by order-id

Returns a Credit Data Order by ID.

{% code title="GraphQL" %}

```graphql
query ($id: uuid!){
  credit_data_order_by_pk(order_id: $id) {
    # order fields
  }
}
```

{% endcode %}

**Arguments**

`orderId` - `uuid!` `non-null`

The ID of the order to return.

**Posible returns**

`Order.*`- [`CreditDataOrder`](/reference/data-access/schema/credit-data-order.md)

Any requested field from the Order object.

#### Examples

<details>

<summary>Get an order by its ID</summary>

The following query retrieves an order with its ID, returning the order date.

{% code title="GQL" %}

```graphql
query ($id: uuid!){
  credit_data_order_by_pk(order_id: $id) {
    consumer_id
    credit_scores {
      model
      value
    },
    order_id,
    order_date,
    tradelines{
        account{
            account_number,
            type,
            type_description,
            account_date_opened,
            account_date_closed
        }
    }
  }
}
```

{% endcode %}

{% code title="Response" %}

```json
{
    "data": {
        "credit_data_order_by_pk": {
            "consumer_id": "e61b2429-ed55-4f40-be12-ff860d4de39a",
            "credit_scores": [
                {
                    "model": "FICO8",
                    "value": 571
                }
            ],
            "order_id": "df547033-414c-44c7-be43-73ec60b73684",
            "order_date": null,
            "tradelines": [
                {
                    "account": {
                        "account_number": "9064264682000",
                        "type": "REVOLVING",
                        "type_description": "Credit Card",
                        "account_date_opened": "2022-03-01",
                        "account_date_closed": null
                    }
                }
            ]
        }
    }
}
```

{% endcode %}

</details>

### Query credit attributes

Returns a Credit Attributes related to a order.

{% code title="GraphQL" %}

```graphql
query ($id: String!){
  get_auto_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_delinquency_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_mortgage_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_revolving_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_specialized_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_student_loans_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_tradeline_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_worst_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
  get_unsecured_installment_attributes_by_order_id(args: {id: $id}) {
    # credit data fields
  }
}
```

{% endcode %}

**Arguments**

`id` - `String!` `non-null`

The ID of the related order

**Posible returns**

Refer to the [Credit Attributes](/data-access/credit-reports/attributes.md) page for detailed infromation

#### Examples

<details>

<summary>Get unsecured installment Credit Attributes</summary>

The following query retrieves an order with its ID, returning the order date.

{% code title="GQL" %}

```graphql
query ($id: String!){
   get_unsecured_installment_attributes_by_order_id(args: {id: $id}) {
    unsecured_installment_tradelines_opened_6_months
    total_unsecured_installment_tradelines
    total_monthly_payment_obligation_for_open_unsecured_installment
    outstanding_balance_open_unsecured_installment_tradelines
    open_unsecured_installment_tradelines
    months_recent_unsecured_installment_tradelines_opened
    months_recent_unsecured_installment_tradeline_delinquency
    active_installment_tradelines
  }
}
```

{% endcode %}

{% code title="Response" %}

```json
{
    "data": {
        "get_unsecured_installment_attributes_by_order_id": [
            {
                "unsecured_installment_tradelines_opened_6_months": "000000098",
                "total_unsecured_installment_tradelines": null,
                "total_monthly_payment_obligation_for_open_unsecured_installment": null,
                "outstanding_balance_open_unsecured_installment_tradelines": null,
                "open_unsecured_installment_tradelines": "000000098",
                "months_recent_unsecured_installment_tradelines_opened": "000000998",
                "months_recent_unsecured_installment_tradeline_delinquency": "000000996",
                "active_installment_tradelines": "000000006"
            }
        ]
    }
}
```

{% endcode %}

</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/data-access/querying-reports.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.
