curl --request POST \
--url https://app.hoppier.com/api/v1/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postalCode": "10118"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({line1: '350 Fifth Avenue', city: 'New York', state: 'NY', postalCode: '10118'})
};
fetch('https://app.hoppier.com/api/v1/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hoppier.com/api/v1/addresses"
payload = {
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postalCode": "10118"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "ad_7Ym2p0Lx3Q",
"object": "address",
"line1": "350 Fifth Avenue",
"line2": "Floor 20",
"city": "New York",
"state": "New York",
"postalCode": "10118",
"country": "US",
"isDefault": true
}Save an address
Saves a US address for your company and returns it, for new programs to use as their addressId. A prepaid Visa card program’s address is the billing address on its cards.
The key’s owner must be an admin who is allowed to create programs.
curl --request POST \
--url https://app.hoppier.com/api/v1/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postalCode": "10118"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({line1: '350 Fifth Avenue', city: 'New York', state: 'NY', postalCode: '10118'})
};
fetch('https://app.hoppier.com/api/v1/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hoppier.com/api/v1/addresses"
payload = {
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postalCode": "10118"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "ad_7Ym2p0Lx3Q",
"object": "address",
"line1": "350 Fifth Avenue",
"line2": "Floor 20",
"city": "New York",
"state": "New York",
"postalCode": "10118",
"country": "US",
"isDefault": true
}- Safe to repeat. Saving an address your company already has returns the saved one instead of a copy. Case and spacing don’t matter, and a state’s code counts the same as its name.
- US only, as in the dashboard. Send the state as its two-letter code or its name; Hoppier stores the name.
- The oldest address is the default. New programs use it when you leave out
addressId. Saving another address doesn’t change the default. - At most 50 saved addresses per company.
- Not in the API: changing or deleting an address. Use the dashboard.
Authorizations
Send your key in the Authorization header: Authorization: Bearer hk_live.…. The word Bearer is case-sensitive.
Keys are shown once. Treat them like passwords and never put one in code that runs in a browser or an app.
Body
4 - 255"350 Fifth Avenue"
1 - 255"New York"
A US state or territory, by its two-letter code (NY) or its name (New York), in any case. The District of Columbia, Puerto Rico, Guam, the US Virgin Islands, American Samoa and the Northern Mariana Islands are included.
"NY"
A US ZIP code, five digits or ZIP+4.
^\d{5}(-\d{4})?$"10118"
255"Floor 20"
Only US addresses can be saved.
US Response
The address: the new one, or the saved one if your company already had it.
One of your company's saved addresses.
The address's id. Starts with ad_.
"ad_7Ym2p0Lx3Q"
"address""350 Fifth Avenue"
"New York"
The state or territory's name.
"New York"
"10118"
Two-letter country code.
"US"
true for the address new programs use when you leave out addressId: your company's oldest saved address.
Left out when the address has no second line.
"Floor 20"