The Address Book API lets you manage saved shipper and receiver addresses. Save frequently used addresses and reuse them when creating shipments — no need to type the same address every time.
Authentication required. All requests need your
integration_key. See the API Overview for details.
Endpoint
GET/POST /api/v1/addresses.php
Use the action parameter to specify the operation: list, get, add, edit, or delete.
1. List Addresses
Get all saved addresses, optionally filtered by type.
GET /api/v1/addresses.php?action=list
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | No | Defaults to list |
type | string | No | Filter: shipper or receiver |
Example Request
curl -X GET "https://app.myshipi.com/api/v1/addresses.php?action=list&type=shipper" \
-H "X-Integration-Key: sk_live_abc123"
// PHP
$url = "https://app.myshipi.com/api/v1/addresses.php?" . http_build_query([
'action' => 'list',
'type' => 'shipper',
'integration_key' => 'sk_live_abc123'
]);
$result = json_decode(file_get_contents($url, false, stream_context_create([
'http' => ['header' => "Accept: application/json\r\n"]
])), true);
// JavaScript
const res = await fetch("https://app.myshipi.com/api/v1/addresses.php?action=list&type=shipper", {
headers: { "X-Integration-Key": "sk_live_abc123" }
});
const data = await res.json();
# Python
import requests
response = requests.get("https://app.myshipi.com/api/v1/addresses.php", params={
"action": "list",
"type": "shipper"
}, headers={"X-Integration-Key": "sk_live_abc123"})
addresses = response.json()
Example Response
{
"status": "success",
"count": 3,
"data": [
{
"id": 42,
"type": "shipper",
"name": "John Smith",
"company": "MyShop Inc",
"mobile": "555-0100",
"email": "john@myshop.com",
"address1": "123 Main Street",
"address2": "Suite 200",
"country": "US",
"state": "NY",
"city": "New York",
"postal": "10001",
"meta_data": {
"gstin": {
"label": "Tax ID / GSTIN / VAT",
"value": "22ABCDE1234F1ZK"
}
},
"created_at": "2025-01-15 10:30:00",
"updated_at": "2025-01-20 14:45:00"
}
]
}
2. Get Single Address
GET /api/v1/addresses.php?action=get&id=42
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be get |
id | integer | Yes | Address ID |
Returns a single address object (same format as the list response).
3. Add New Address
Save a new address to your address book.
POST /api/v1/addresses.php
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be add |
type | string | No | shipper or receiver (default: shipper) |
name | string | Yes | Contact name |
company | string | No | Company name |
mobile | string | No | Phone number |
email | string | No | Email address |
address1 | string | Yes | Street address line 1 |
address2 | string | No | Street address line 2 |
city | string | Yes | City |
state | string | No | State or province code |
country | string | Yes | Country code (US, CA, IN, GB, etc.) |
postal | string | Yes | Postal / ZIP code |
tax_id | string | No | Tax ID / GSTIN / VAT number |
s_house | string | No | House number (for European addresses) |
meta_data | object | No | Custom key-value fields (see below) |
Custom Meta Data
You can store any custom fields using the meta_data object. Each key maps to a {label, value} pair:
{
"meta_data": {
"department": {
"label": "Department",
"value": "Warehouse B"
},
"dock_number": {
"label": "Loading Dock",
"value": "Dock 4"
}
}
}
Example Request
curl -X POST "https://app.myshipi.com/api/v1/addresses.php" \
-H "X-Integration-Key: sk_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"action": "add",
"type": "shipper",
"name": "John Smith",
"company": "MyShop Inc",
"mobile": "555-0100",
"email": "john@myshop.com",
"address1": "123 Main Street",
"address2": "Suite 200",
"city": "New York",
"state": "NY",
"country": "US",
"postal": "10001",
"tax_id": "22ABCDE1234F1ZK"
}'
// PHP
$ch = curl_init("https://app.myshipi.com/api/v1/addresses.php");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-Integration-Key: sk_live_abc123",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"action" => "add",
"type" => "shipper",
"name" => "John Smith",
"company" => "MyShop Inc",
"address1" => "123 Main Street",
"city" => "New York",
"state" => "NY",
"country" => "US",
"postal" => "10001"
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
// JavaScript
const res = await fetch("https://app.myshipi.com/api/v1/addresses.php", {
method: "POST",
headers: {
"X-Integration-Key": "sk_live_abc123",
"Content-Type": "application/json"
},
body: JSON.stringify({
action: "add",
type: "receiver",
name: "Jane Doe",
address1: "456 Oak Avenue",
city: "Los Angeles",
state: "CA",
country: "US",
postal: "90001"
})
});
const data = await res.json();
# Python
import requests
response = requests.post("https://app.myshipi.com/api/v1/addresses.php",
headers={"X-Integration-Key": "sk_live_abc123"},
json={
"action": "add",
"type": "shipper",
"name": "John Smith",
"company": "MyShop Inc",
"address1": "123 Main Street",
"city": "New York",
"state": "NY",
"country": "US",
"postal": "10001"
}
)
print(response.json())
Response (201 Created)
{
"status": "success",
"message": "Address added successfully.",
"data": {
"id": 43,
"type": "shipper",
"name": "John Smith",
"company": "MyShop Inc",
...
}
}
4. Edit Address
Update an existing address. Only send the fields you want to change.
POST /api/v1/addresses.php
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be edit |
id | integer | Yes | Address ID to update |
| (any field) | string | No | Only include fields you want to change |
Example — Update only the phone number
curl -X POST "https://app.myshipi.com/api/v1/addresses.php" \
-H "X-Integration-Key: sk_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"action": "edit",
"id": 42,
"mobile": "555-9999"
}'
Response
{
"status": "success",
"message": "Address updated successfully.",
"data": {
"id": 42,
"name": "John Smith",
"mobile": "555-9999",
...
}
}
5. Delete Address
Permanently remove an address from your address book.
POST /api/v1/addresses.php
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be delete |
id | integer | Yes | Address ID to delete |
Example
curl -X POST "https://app.myshipi.com/api/v1/addresses.php" \
-H "X-Integration-Key: sk_live_abc123" \
-H "Content-Type: application/json" \
-d '{"action": "delete", "id": 42}'
Response
{
"status": "success",
"message": "Address deleted successfully.",
"data": { "id": 42 }
}
Address Object Fields
| Field | Type | Description |
|---|---|---|
id | integer | Unique address ID |
type | string | shipper or receiver |
name | string | Contact name |
company | string | Company name |
mobile | string | Phone number |
email | string | Email address |
address1 | string | Street address line 1 |
address2 | string | Street address line 2 |
city | string | City |
state | string | State / province |
country | string | Country code |
postal | string | Postal / ZIP code |
meta_data | object | Custom fields as {key: {label, value}} |
created_at | string | Creation timestamp |
updated_at | string | Last update timestamp |