> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/quote/_costsset.md).

# \_costsSet

Modifies details of Quote costs.

### Parameters

#### id

The ID of the Quote.

#### costs

JSON values containing the new cost values. See the example for more details.

### Example

```
$costs = ['stock' => [
           ['sid' => 1,
            'amt' => 10,
            'cost' => 100,
            'price' => 50,
            'tax' => 20,
            'gross' => 60],
           ['sid' => 9,
            'amt' => 5,
            'cost' => 15,
            'price' => 25,
            'tax' => 15,
            'gross' => 28.75],
           ['sid' => 10,
            'amt' => 20,
            'cost' => 5,
            'price' => 10,
            'tax' => 25,
            'gross' => 12.5]
          ],
          'total_cost' => 12430,
          'other' => [
            ['description' => 'Other Thing One',
             'amt' => 50,
             'cost' => 200,
             'price' => 100,
             'tax' => 20,
             'gross' => 120],
            ['description' => 'Other Thing Two',
             'amt' => 100,
             'cost' => 5,
             'price' => 250,
             'tax' => 30,
             'gross' => 325]
          ],
          'verbose' => [
            ['summary' => 'First summary.',
             'verbose_descr' => 'First description.',
             'net_price' => '500',
             'gross' => 600],
            ['summary' => 'Second summary.',
            'verbose_descr' => 'Second description.',
            'net_price' => '250',
            'gross' => 300]
          ],
          'stock_total_cost' => 1175,
          'stock_total_price' => 825,
          'stock_total_gross' => 993.75,
          'sor' => [
            ['sid' => 1,
             'amt' => 1,
             'cost' => 5,
             'tax' => 20,
             'price' => 6]
            ],
          'sor_total_cost' => 5,
          'sor_total_price' => 6,
          'other_total_cost' => 10500,
          'other_total_price' => 30000,
          'other_total_gross' => 38500,
          'verbose_total_cost' => 750,
          'verbose_total_price' => 750,
          'verbose_total_gross' => 900];
FM_api('Quote_costsSet', ['id' => '1', 'costs' => json_encode($costs));
```

### Result

#### On Success

```
{'ok':1}
```

#### On Failure

If the User is not logged in: {'error':'not logged in'}

If no ID is supplied: {'error':'no id'}

If the specified Quote does not exist: {'error':'no such quote'}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/quote/_costsset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
