ParcelParcelAPI docs

API docs Endpoints

Update an address

Markdown

Change one or more fields of a saved address in your ParcelParcel address book.

PATCHhttps://services.parcelparcel.com/partners-api/v1/address-book/{addressId}

Example request

Change the phone number and clear address line 2

curl --request PATCH 'https://services.parcelparcel.com/partners-api/v1/address-book/456' \
  --header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
  --header 'Content-Type: application/json' \
  --data '{
  "phone": "+12125550199",
  "addressLine2": null
}'

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 changes a saved address in the address book of your account. Only the fields you send change. All other fields keep their saved value.

Replace {addressId} with the id of the address. You get this id when you list your addresses or save an address.

You can only update addresses of your own account. An address of another account gives the same 404 as an unknown id.

There is no endpoint to delete an address. You can delete addresses under Address book in MyParcelParcel.

Add the following headers:

NameValue
Content-Typeapplication/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 only the fields you want to change. The fields are the same as in Save an address: countryCode, companyName, contactPerson, phone, email, addressLine1, addressLine2, zipcode, city, provinceCode, vatNumber and eoriNumber. Every text field can have at most 255 characters.

  • Change a field: send the new value, for example "phone": "+12125550199".
  • Clear an optional field: send null or "", for example "addressLine2": null.
  • Required fields (countryCode, contactPerson, phone, addressLine1 and city) cannot be cleared. Sending null or "" for one of them gives a 400 and nothing changes.

If one field is wrong, none of the fields change.

Response

The response body is the full address after the update. It has the same elements as Get an address.

If the request is not valid, the response has an errors array with one entry per wrong field, the same as in Save an address.

Status codes

Status codeMeaning
200 OKThe address is updated. The response is the full address.
400 Bad RequestNothing changed. You tried to clear a required field, a field is too long, or a value is not valid. See errors.
404 Not FoundWe could not find the address in your account. Make sure that the addressId is correct.

Examples

Don't know how to test these requests? Check our guide.

Request example - Change the phone number and clear address line 2

curl --location --request PATCH 'https://services.parcelparcel.com/partners-api/v1/address-book/456' \
--header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "phone": "+12125550199",
  "addressLine2": null
}'

Don't forget to change the X-PP-API element in the header, or this request will not work.

Response example - Address updated (200)

JSON
{
  "id": 456,
  "company": "Acme Inc.",
  "contactPerson": "Jane Smith",
  "phone": "+12125550199",
  "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 - Required field cleared (400)

JSON
{
  "errors": [
    {
      "field": "city",
      "message": "city is required."
    }
  ]
}

Response example - EORI number not valid (400)

JSON
{
  "errors": [
    {
      "field": "eoriNumber",
      "message": "EORI number must start with a 2-letter country code followed by 1 to 15 alphanumeric characters."
    }
  ]
}

Response example - Address not found (404)

JSON
"Address not found"