Detail

Mendapatkan Detail Alamat Pengiriman Pengguna

Nama function yang digunakan adalah

GetAddressDetail(idAddress: number)

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

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

Contoh

Berikut ini merupakan contoh dalam penggunaan

import { InaLib } from "ina-digital-sdk";
const inaLib = new InaLib({ mode: 'prod', secret_key: '{your_secret_key}' })
inaLib.GetAddressDetail(97110)
		.then(function (response) {
			console.log(response);
		})
		.catch(function (error) {
			console.log(error);
		});

Maka output yang akan keluar adalah

{
    "statusCode": 200,
    "data": {
        "id": 97110,
        "id_member": 2711806,
        "utama": 0,
        "label": "Rumah",
        "penerima": "sabiq",
        "phone": "+62856XXXXXXXX",
        "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 cendrawasih",
        "catatan": null,
        "lat": null,
        "lon": null,
        "createdBy": null,
        "updatedBy": null,
        "deletedBy": null,
        "shipper": {
            "id": 1023,
            "name": "Bojonggede",
            "type": "kecamatan",
            "level": 5,
            "postcode": "",
            "geo_coord": {
                "lat": null,
                "lng": null
            }
        },
        "shipper_txt": "Bojonggede, Kabupaten Bogor, Jawa Barat",
        "createdAt": "2024-02-26T10:01:56.000Z",
        "updatedAt": "2024-02-27T06:08:34.000Z",
        "deletedAt": null
    },
    "message": "Success"
}

Last updated