---
title: Add
slug: backyardapi/zipcodes-api/add
docTags: 
createdAt: 2024-07-23T14:57:52.062Z
---

# Add Zipcode

<font color="#fa8c16">`POST`</font>  `/zipcodes`

To add zipcodes to your account you should make an  `HTTP POST`  request to the Add Zipcodes endpoint, specifying an array of objects containing a  `zipcode`  and  `domain`  property describing the zipcodes you'd like to add and the domain to use them on.

:::hint{type="info"}
**Zipcode Licensing**
To view how many zipcodes you can add to your account you can use the [Account API](https://docs.trajectdata.com/backyardapi/account-api).
:::

Zipcodes can also be added visually via the [Dashboard](https://app.backyardapi.com/zipcodes).

For more information about using zip & postal codes with Backyard API please see the [zipcodes overview](https://docs.trajectdata.com/backyardapi/zipcodes-api/overview).

:::hint{type="info"}
**Zipcode Status**
When a zipcode is first added to your account it will report its status as  `status=preparing` . Zipcodes take around 2 minutes from the point they are added to your account to them being ready to service requests (during which time any requests specifing the zipcode in their  `customer_zipcode`  parameter will fail). When the zipcode is ready it will report as  `status=available`  and can then be used in a requests  `customer_zipcode`  parameter. For more information see the [zipcode overview](https://docs.trajectdata.com/backyardapi/zipcode-api/overview).
:::

:::CodeblockTabs
```curl
$ curl "https://api.backyardapi.com/zipcodes?api_key=demo" \
  --data '[ { "zipcode": "30339", "domain": "homedepot.com" } ]'
```

```nodejs
const axios = require('axios');

const body = [
  {
    'zipcode': '30339',
    'domain': 'homedepot.com'
  }
];

axios.post('https://api.backyardapi.com/zipcodes?api_key=demo', body)
  .then(response => {
    const apiResponse = response.data;

    console.log('Zipcodes Added: ' + JSON.stringify(apiResponse, 0, 2));

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests
import json

body = [
  {
    'zipcode': '30339',
    'domain': 'homedepot.com'
  }
];

api_result = requests.post('https://api.backyardapi.com/zipcodes?api_key=demo', json=body)

api_response = api_result.json()

print "Zipcodes Added: ", json.dumps(api_response)
```

```php
<?php
      
$body = array(
  array(
    'zipcode' => '30339',
    'domain' => 'homedepot.com'
  )
);

$ch = curl_init('https://api.backyardapi.com/zipcodes?api_key=demo');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
# the following options are required if you're using an outdated OpenSSL version
# more details: https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));

$json = curl_exec($ch);
curl_close($ch);

$api_result = json_decode($json, true);

print_r($api_result);

echo "Zipcodes Added", PHP_EOL;

?>
```
:::

An example of a successful response to the Add Zipcodes API is shown below:

```json
{
  "request_info": {
    "success": true,
    "message": "2 zipcodes added"
  }
}
```

***

**Next Steps**
     [Zipcodes Overview](https://docs.trajectdata.com/backyardapi/zipcodes-api/overview)
     [Deleting a zipcode via the Zipcodes API](https://docs.trajectdata.com/backyardapi/zipcodes-api/delete)
     [Listing all zipcodes via the Zipcodes API](https://docs.trajectdata.com/backyardapi/zipcodes-api/list)
