Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for getCity(cityId) #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ RajaOngkir.getCities().then(function (result){
// Aksi ketika error terjadi
});
```
### Menampilkan Spesifik Kota (Starter)
```javascript
var RajaOngkir = require('rajaongkir-nodejs').Starter('apiKey');

var id = 1; // ID Kota
RajaOngkir.getCity(id).then(function (result){
// Aksi ketika data Kota berhasil ditampilkan
}).catch(function (error){
// Aksi ketika error terjadi
});

### Menghitung Biaya Kirim JNE (Starter)
```javascript
Expand All @@ -111,6 +121,37 @@ RajaOngkir.getJNECost(params).then(function (result){
// Aksi ketika error terjadi
});
```
### Menghitung Biaya Kirim TIKI (Starter)
```javascript
var RajaOngkir = require('rajaongkir-nodejs').Starter('apiKey');

var params = {
origin: 501, // ID Kota atau Kabupaten Asal
destination: 114, // ID Kota atau Kabupaten Tujuan
weight: 1700 // Berat Barang dalam gram (gr)
};
RajaOngkir.getTIKICost(params).then(function (result){
// Aksi ketika data Biaya berhasil ditampilkan
}).catch(function (error){
// Aksi ketika error terjadi
});
```

### Menghitung Biaya Kirim POS (Starter)
```javascript
var RajaOngkir = require('rajaongkir-nodejs').Starter('apiKey');

var params = {
origin: 501, // ID Kota atau Kabupaten Asal
destination: 114, // ID Kota atau Kabupaten Tujuan
weight: 1700 // Berat Barang dalam gram (gr)
};
RajaOngkir.getPOSCost(params).then(function (result){
// Aksi ketika data Biaya berhasil ditampilkan
}).catch(function (error){
// Aksi ketika error terjadi
});
```

<a name="usage"></a>
# Penggunaan
Expand Down