# Concepts

> Terms used in the routes: service center, carpenter, salesperson, internal code, materials, service and service status codes.

Canonical URL: https://apis.cortecloud.com.br/docs/en/comecando/conceitos/

Business terms used in the routes and guides.

## Who is who {#quem-e-quem}

| Term | Meaning |
| --- | --- |
| **Service center** | Company that sells the materials and produces the parts ordered by carpenters. The data your integration reads and changes always belongs to a service center. |
| **Carpenter** | The service center's customer: a professional who designs and assembles furniture and orders the parts through Cortecloud. In the routes, `carpenter`. |
| **Salesperson** | Service center employee who serves the carpenter. In the routes, `seller`, identified by email. |
| **Integration** | Your system, identified by the api key (see [Authentication](https://apis.cortecloud.com.br/docs/en/comecando/autenticacao.md)). |

## Internal code {#codigo-interno}

The API identifies service centers, materials, services and carpenters by their **internal code** (`internal_code`): the code that identifies the record in the service center's system, usually the ERP. This way your integration works with the codes it already knows, not with Cortecloud ids.

| Record | Internal code | Where it appears |
| --- | --- | --- |
| Service center | Service center code | `x-company-internal-code` header of every request. |
| Material | Item code in the ERP | `internal_code` in the [materials](https://apis.cortecloud.com.br/docs/en/guias/integracao-erp/materiais.md) routes and in a service's materials and parts. |
| Service | Order number in the ERP | The service's `internal_code`, written by your integration (see [Update services](https://apis.cortecloud.com.br/docs/en/guias/integracao-erp/atualizar-servicos.md)). |
| Carpenter | Customer code in the ERP | A service's `client.internal_code` and `carpenterInternalCode` in [embedded login](https://apis.cortecloud.com.br/docs/en/guias/login-embutido.md). |
| Production line | Line code | `productionInternalCode` in [embedded login](https://apis.cortecloud.com.br/docs/en/guias/login-embutido.md). |

### Service center code {#codigo-da-central}

Each request acts on a single service center, indicated by its code in the `x-company-internal-code` header. The same api key can be linked to several service centers: to work with another one, change the header value. If you do not know the code of the service center you will integrate, ask support for it along with the credentials.

## Materials {#materiais}

Materials are the items the service center sells and that make up a service. There are three types:

| Type | In the API | What it is |
| --- | --- | --- |
| **Board** | `boards` | MDF, particleboard or similar panel from which the parts are cut. |
| **Edge banding** | `edges` | Strip that covers and finishes the edges of the cut parts. |
| **Hardware component** | `components` | Hardware and accessories, such as hinges, drawer slides, handles and screws. |

Each material has:

- **`internal_code`**: the item's [internal code](https://apis.cortecloud.com.br/docs/en/comecando/conceitos.md#codigo-interno). Materials without an internal code do not appear in the routes.
- **`active`**: whether the item is active at the service center.
- **`price`**: the item's price at the service center.
- **`stock`**: available stock.
- **`unit`**: the item's rounding unit (optional).

## Service {#servico}

A **service** is an order for custom-cut parts placed on Cortecloud by a carpenter (or by a salesperson on their behalf) with a service center. It corresponds to an order in your ERP. It is identified by its numeric Cortecloud `id` and, once your integration links it to an order, also by its `internal_code` (the order number in the ERP).

The content of a service includes:

- **parts**: each piece cut from a board, with dimensions, quantity, edge banding applied to each side (`c1`, `c2`, `l1`, `l2`), drilling and machining;
- **consumed materials**: boards, edge banding and hardware components, with quantity and price;
- **labor**: cutting, edge banding application, machining (holes and grooves), packing and shipping;
- **status** and the history of status changes.

The service is produced on a **production line** of the service center, the unit that cuts and finishes the parts.

## Service status {#status-do-servico}

The status (`status.code`) indicates which stage the service is in. The API works with these:

| Code | Status | Meaning |
| --- | --- | --- |
| `4` | Quote generated | Cortecloud calculated the quote and the service is waiting for the carpenter's approval. |
| `25` | Awaiting online payment | The carpenter chose to pay online and the payment is in progress in the service center's checkout (see [Payment checkout](https://apis.cortecloud.com.br/docs/en/guias/checkout.md)). |
| `6` | Approved | The quote was approved; the service can be sent to production. |
| `7` | Sent to production | The service was sent to the production line. |
| `9` | Produced | The parts were produced. |

`GET /services` lists services in any of these statuses, and linking an `internal_code` is only accepted when the service is in one of them.

The most common path is quote generated (`4`) → approved (`6`) → sent to production (`7`) → produced (`9`). With online payment, the service goes through awaiting online payment (`25`) between `4` and `6`; if the payment is canceled, it goes back to `4`. Refunding an already confirmed payment also takes the service from `6` back to `4`.

Cortecloud has other internal statuses (for example, service saved and not yet quoted, being optimized, canceled or archived). `GET /services` does not accept these codes in the `status` filter, and linking an `internal_code` is refused for services in them.
