Skip to main content

Addresses

List Addresses​

Lists the sender addresses saved to the account.

GET /courier/v1/addresses

Example Request​

curl -X GET 'https://use.api.co.id/courier/v1/addresses' \
-H 'x-api-co-id: YOUR_API_KEY'

Example Response​

{
"is_success": true,
"message": "OK",
"data": [
{
"id": "adr_7b1c",
"label": "Gudang Utama",
"contact_name": "Budi",
"contact_phone": "0899...",
"province_code": "33",
"city_code": "3374",
"district_code": "3374010",
"address_line": "Jl. Pemuda No. 1",
"postal_code": "50139",
"is_default": true
}
]
}

Create Address​

Saves a new sender address. The address can be used as sender_address_id in Shipping Rates and orders.

POST /courier/v1/addresses

Request Body​

ParameterTypeRequiredDescription
labelstringyesAddress name, e.g. "Gudang Utama".
contact_namestringyesSender contact name.
contact_phonestringyesSender phone number.
province_codestringyesProvince code.
city_codestringyesCity/regency code.
district_codestringyesDistrict code (must be served by a courier).
address_linestringyesFull address.
postal_codestringnoPostal code.
is_defaultbooleannoSet as the default address.

Example Request​

curl -X POST 'https://use.api.co.id/courier/v1/addresses' \
-H 'x-api-co-id: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"label": "Gudang Utama",
"contact_name": "Budi",
"contact_phone": "08990000000",
"province_code": "33",
"city_code": "3374",
"district_code": "3374010",
"address_line": "Jl. Pemuda No. 1",
"postal_code": "50139",
"is_default": true
}'

Example Response​

{
"is_success": true,
"message": "Alamat berhasil dibuat.",
"data": { "id": "adr_7b1c" }
}

Try it out​

tip

Use your sandbox Test Key to try these endpoints without creating real shipments or charges. See Sandbox.

  • GET/courier/v1/addressesList Addresses
  • POST/courier/v1/addressesCreate Address
Was this page helpful?