API docs Endpoints
Save an address
Add a new address to the address book of your ParcelParcel account.
https://services.parcelparcel.com/partners-api/v1/address-bookExample request
Save a recipient in the United States
curl --request POST 'https://services.parcelparcel.com/partners-api/v1/address-book' \
--header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
--header 'Content-Type: application/json' \
--data '{
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY"
}'{
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY"
}const response = await fetch("https://services.parcelparcel.com/partners-api/v1/address-book", {
method: "POST",
headers: {
"X-PP-API": "{YourAPIKey}@{YourAPISecret}",
"Content-Type": "application/json",
},
body: JSON.stringify({
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY"
}),
});
const data = await response.json();
console.log(data);import requests
response = requests.post(
"https://services.parcelparcel.com/partners-api/v1/address-book",
headers={
"X-PP-API": "{YourAPIKey}@{YourAPISecret}",
"Content-Type": "application/json",
},
json={
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY",
},
)
print(response.json())Tip: copy the cURL and paste it in Postman under Import, or straight into the URL bar of a new request. Postman fills in the method, headers and body for you. Replace {YourAPIKey}@{YourAPISecret} with your own API key and secret (use your sandbox key while testing), or import the whole Postman Collection.
This endpoint saves a new address in the address book of your account. The address shows up under Address book in MyParcelParcel, and you can use its id as addressBookId when you create a shipment.
The body uses the same keys as an address in Create a (draft) shipment, so you can save an address exactly as you send it in a shipment.
Header
Add the following headers:
| Name | Value |
|---|---|
Content-Type | application/json |
X-PP-API | {YourAPIKey}@{YourAPISecret} |
Don't have an API Key and API Secret yet? Check our Authentication page to see how to get them in under a minute.
Body
The request body is a JSON object with the following elements. Every text field can have at most 255 characters.
| Name | Value | Required | Comments |
|---|---|---|---|
countryCode | (string) | required | ISO 3166-1 alpha-2 country code, for example NL or US. |
companyName | (string) | optional | |
contactPerson | (string) | required | Full name of the contact person. |
phone | (string) | required | |
email | (string) | optional | |
addressLine1 | (string) | required | |
addressLine2 | (string) | optional | |
zipcode | (string) | optional | |
city | (string) | required | |
provinceCode | (string) | optional | State or province code, for example TX for Texas. |
vatNumber | (string) | optional | |
eoriNumber | (string) | optional | A 2-letter country code followed by 1 to 15 letters or digits, for example NL123456789. |
Saving an address with fewer fields is fine. A shipment still needs all its own required fields, such as email and zipcode. If the saved address does not have them, add them to the address in the shipment.
Response
The response body is the saved address. It has the same elements as Get an address, including the new id.
Note that the response uses the output names: company, stateOrProvince and country (instead of companyName, provinceCode and countryCode). These are the same names as in List your shipments.
If the request is not valid, the response has an errors array with one entry per wrong field:
| Name | Value | Comments |
|---|---|---|
errors | (array) | One entry per wrong field. |
errors.field | (string) | The name of the field in your body. |
errors.message | (string) | What is wrong with the field. |
Status codes
| Status code | Meaning |
|---|---|
| 201 Created | The address is saved. The response is the new address. |
| 400 Bad Request | The address is not saved. A required field is missing or empty, a field is too long, or a value is not valid. See errors. |
Examples
Don't know how to test these requests? Check our guide.
Request example - Save a recipient in the United States
curl --location --request POST 'https://services.parcelparcel.com/partners-api/v1/address-book' \
--header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
--header 'Content-Type: application/json' \
--data-raw '{
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY"
}'POST /partners-api/v1/address-book HTTP/1.1
Host: services.parcelparcel.com
X-PP-API: {YourAPIKey}@{YourAPISecret}
Content-Type: application/json
{
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY"
}{
"countryCode": "US",
"companyName": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"zipcode": "10118",
"city": "New York",
"provinceCode": "NY"
}Don't forget to change the X-PP-API element in the header, or this request will not work.
Response example - Address saved (201)
{
"id": 456,
"company": "Acme Inc.",
"contactPerson": "Jane Smith",
"phone": "+12125550100",
"email": "[email protected]",
"addressLine1": "350 5th Ave",
"addressLine2": null,
"zipcode": "10118",
"city": "New York",
"stateOrProvince": "NY",
"country": "US",
"vatNumber": null,
"eoriNumber": null,
"defaultPickup": false
}Response example - Address not valid (400)
{
"errors": [
{
"field": "contactPerson",
"message": "contactPerson is required."
},
{
"field": "countryCode",
"message": "countryCode must be a known 2-letter ISO country code."
}
]
}