> For the complete documentation index, see [llms.txt](https://docs.quantumbyte.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quantumbyte.ai/home/quantumbyte-v2.0/3.microsites-1/9.sdk/4.alamat/3.add.md).

# Add

Nama function yang digunakan adalah

```ts
AddAddress(data: {
  utama: number; // 1 or 0 // status untuk menentukan sebagai alamat utama
  label: string;
  penerima: string;
  phone: string;
  prov?: string;
  prov_id?: number;
  kota?: string;
  kota_id?: number;
  kec?: string;
  kec_id?: number;
  kel?: string;
  kel_id?: number;
  kode_pos: string;
  alamat: string;
  catatan?: string;
  lat?: string;
  lon?: string;
  shipper?: object;
  shipper_txt?: string;
  wilayah?: any;
})
```

Cara Menggunakannya adalah dengan memasukkan parameter yang dibutuhkan kedalam function seperti ini

```js
import { InaLib } from "ina-digital-sdk";
const inaLib = new InaLib({ mode: string, secret_key: string });
inaLib
  .AddAddress(data)
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
```

### Contoh

Berikut ini merupakan contoh dalam penggunaan

```js
import { InaLib } from "ina-digital-sdk";
const inaLib = new InaLib({ mode: 'prod', secret_key: '{your_secret_key}' })
inaLib.AddAddress({
  utama: 1,
	label: "Rumah",
	penerima: "Sabiq",
	phone: "08972XXXXXXX",
	prov: null,
	prov_id: null,
	kota: null,
	kota_id: null,
	kec: null,
	kec_id: null,
	kel: null,
	kel_id: null,
	kode_pos: "99999",
	alamat: "jl. komodo",
	catatan: "deket gang manggis",
	lat: "-6.239278248495757",
	lon: "106.80155041561764",
	shipper: { "id": "2104", "name": "Jagakarsa", "type": "kecamatan", "level": "5", "postcode": "", "geo_coord": { "lat": "", "lng": "" } },
	shipper_txt: "Jagakarsa, Kota Jakarta Selatan, DKI Jakarta"
})
		.then(function (response) {
			console.log(response);
		})
		.catch(function (error) {
			console.log(error);
		});
```

Maka output yang akan keluar adalah

```json
{
    "statusCode": 200,
    "data": {
        "utama": 1,
        "label": "Rumah",
        "penerima": "Sabiq",
        "phone": "08972XXXXXXX",
        "prov": null,
        "prov_id": null,
        "kota": null,
        "kota_id": null,
        "kec": null,
        "kec_id": null,
        "kel": null,
        "kel_id": null,
        "kode_pos": "99999",
        "alamat": "jl. komodo",
        "catatan": "deket gang manggis",
        "lat": "-6.239278248495757",
        "lon": "106.80155041561764",
        "shipper": {
            "id": "2104",
            "name": "Jagakarsa",
            "type": "kecamatan",
            "level": "5",
            "postcode": "",
            "geo_coord": {
                "lat": "",
                "lng": ""
            }
        },
        "shipper_txt": "Jagakarsa, Kota Jakarta Selatan, DKI Jakarta",
        "id_member": 2711806,
        "createdAt": "2024-03-05T09:50:36.000Z",
        "updatedAt": "2024-03-05T09:50:36.000Z",
        "createdBy": null,
        "updatedBy": null,
        "deletedBy": null,
        "id": 97120,
        "deletedAt": null
    },
    "message": "Success"
}
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.quantumbyte.ai/home/quantumbyte-v2.0/3.microsites-1/9.sdk/4.alamat/3.add.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
