---
title: "Frete"
description: "Endereços, cotações e rastreio de entrega."
---
<div class="lm-ref-kicker"><code>shipping</code><span>namespace</span></div>

Endereços, cotações e rastreio de entrega.

<div class="lm-ref-stats lm-ref-stats--compact">
  <div class="lm-ref-stat"><strong>7</strong><span>métodos</span></div>
  <div class="lm-ref-stat"><code>shipping</code><span>namespace</span></div>
</div>

> Esta página é gerada automaticamente pelo `@luckymaker/sdk-generator`. Não edite manualmente.

## `createAddress`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/shipping/address</code></div>

Assinatura:

```ts
createAddress(body?: CreateAddressBody, settings?: SdkSettings): Promise<CreateAddressResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `kind` | `"HOME_ADDRESS" \| "WORK_ADDRESS" \| "OTHER_ADDRESS"` | sim |
| `cep` | `string` | sim |
| `address` | `string` | sim |
| `streetNumber` | `string` | sim |
| `neighborhood` | `string` | sim |
| `complement` | `string \| null` | não |
| `referencePoint` | `string \| null` | não |
| `city` | `string` | sim |
| `state` | `string` | sim |

### Tipos

```ts
type CreateAddressBody = { "kind": "HOME_ADDRESS" | "WORK_ADDRESS" | "OTHER_ADDRESS"; "cep": string; "address": string; "streetNumber": string; "neighborhood": string; "complement"?: string | null; "referencePoint"?: string | null; "city": string; "state": string; };
type CreateAddressResponse = { "id": string; "kind": "HOME_ADDRESS" | "WORK_ADDRESS" | "OTHER_ADDRESS"; "isDefault": boolean; "cep": string; "address": string; "streetNumber": string; "neighborhood": string; "complement": string | null; "referencePoint": string | null; "city": string; "state": string; "createdAt": string; "updatedAt": string; };
```

### Exemplo

```ts
const response = await sdk.shipping.createAddress({ "kind": "HOME_ADDRESS", "cep": "string", "address": "string", "streetNumber": "string", "neighborhood": "string", "city": "string", "state": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=createAddress">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `deleteAddress`

<div class="lm-endpoint"><span class="lm-http lm-http--delete">DELETE</span><code>/user/shipping/address/:id</code></div>

Assinatura:

```ts
deleteAddress(id: string, settings?: SdkSettings): Promise<DeleteAddressResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Tipos

```ts
type DeleteAddressParams = { "id": string; };
type DeleteAddressResponse = null;
```

### Exemplo

```ts
const response = await sdk.shipping.deleteAddress("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=deleteAddress">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getQuote`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/shipping/quote</code></div>

Assinatura:

```ts
getQuote(query?: GetQuoteQuery, settings?: SdkSettings): Promise<GetQuoteResponse>
```

### Query

| Nome | Tipo | Obrigatório |
|---|---|---|
| `cep` | `string` | sim |
| `itemId` | `string` | não |
| `items` | `string` | não |

### Tipos

```ts
type GetQuoteQuery = { "cep": string; "itemId"?: string; "items"?: string; };
type GetQuoteResponse = { "options": Array<{ "quoteId": string; "serviceId": string; "serviceName": string; "carrier": string; "price": number; "deliveryDays": number; "error"?: string; }>; "provider": "MELHOR_ENVIO" | "CUSTOM"; };
```

### Exemplo

```ts
const response = await sdk.shipping.getQuote({ "cep": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=getQuote">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `listAddresses`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/shipping/address</code></div>

Assinatura:

```ts
listAddresses(settings?: SdkSettings): Promise<ListAddressesResponse>
```

### Tipos

```ts
type ListAddressesResponse = Array<{ "id": string; "kind": "HOME_ADDRESS" | "WORK_ADDRESS" | "OTHER_ADDRESS"; "isDefault": boolean; "cep": string; "address": string; "streetNumber": string; "neighborhood": string; "complement": string | null; "referencePoint": string | null; "city": string; "state": string; "createdAt": string; "updatedAt": string; }>;
```

### Exemplo

```ts
const response = await sdk.shipping.listAddresses();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=listAddresses">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `setDefaultAddress`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/shipping/address/:id/default</code></div>

Assinatura:

```ts
setDefaultAddress(id: string, settings?: SdkSettings): Promise<SetDefaultAddressResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Tipos

```ts
type SetDefaultAddressParams = { "id": string; };
type SetDefaultAddressResponse = { "id": string; "kind": "HOME_ADDRESS" | "WORK_ADDRESS" | "OTHER_ADDRESS"; "isDefault": boolean; };
```

### Exemplo

```ts
const response = await sdk.shipping.setDefaultAddress("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=setDefaultAddress">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `unsetDefaultAddress`

<div class="lm-endpoint"><span class="lm-http lm-http--delete">DELETE</span><code>/user/shipping/address/:id/default</code></div>

Assinatura:

```ts
unsetDefaultAddress(id: string, settings?: SdkSettings): Promise<UnsetDefaultAddressResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Tipos

```ts
type UnsetDefaultAddressParams = { "id": string; };
type UnsetDefaultAddressResponse = null;
```

### Exemplo

```ts
const response = await sdk.shipping.unsetDefaultAddress("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=unsetDefaultAddress">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `updateAddress`

<div class="lm-endpoint"><span class="lm-http lm-http--put">PUT</span><code>/user/shipping/address/:id</code></div>

Assinatura:

```ts
updateAddress(id: string, body?: UpdateAddressBody, settings?: SdkSettings): Promise<UpdateAddressResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `kind` | `"HOME_ADDRESS" \| "WORK_ADDRESS" \| "OTHER_ADDRESS"` | não |
| `cep` | `string` | não |
| `address` | `string` | não |
| `streetNumber` | `string` | não |
| `neighborhood` | `string` | não |
| `complement` | `string \| null` | não |
| `referencePoint` | `string \| null` | não |
| `city` | `string` | não |
| `state` | `string` | não |

### Tipos

```ts
type UpdateAddressParams = { "id": string; };
type UpdateAddressBody = { "kind"?: "HOME_ADDRESS" | "WORK_ADDRESS" | "OTHER_ADDRESS"; "cep"?: string; "address"?: string; "streetNumber"?: string; "neighborhood"?: string; "complement"?: string | null; "referencePoint"?: string | null; "city"?: string; "state"?: string; };
type UpdateAddressResponse = { "id": string; "kind": "HOME_ADDRESS" | "WORK_ADDRESS" | "OTHER_ADDRESS"; "isDefault": boolean; "cep": string; "address": string; "streetNumber": string; "neighborhood": string; "complement": string | null; "referencePoint": string | null; "city": string; "state": string; "createdAt": string; "updatedAt": string; };
```

### Exemplo

```ts
const response = await sdk.shipping.updateAddress("string", { "kind": "HOME_ADDRESS", "cep": "string", "address": "string", "streetNumber": "string", "neighborhood": "string", "complement": "string", "referencePoint": "string", "city": "string", "state": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=shipping&method=updateAddress">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>