Add Address via API

Hi ya,

I want to add a new address in Ordoro via the API.

I see https://ordoro.docs.apiary.io/#reference/address/address/post?console=1

But when I try to post it just sits there… no error or result.

Maybe I’m missing required fields?

Please post the full URL you are using as well as the request body.

Sure.

https://api.ordoro.com/address/

“address”:
{
“company”: “TEST INC.”,
“street1”: “TEST ST”,
“street2”: “”,
“zip”: “12550”,
“name”: “BRUCE BANNER”,
“city”: “NEWBURGH”,
“state”: “NY”,
“country”: “US”,
“email”: "test@test.com",
“phone”: “(888) 743-8423”,
}

Using what you posted, and curl. I had to remove the smart quotes from copy/paste, and remove the trailing comma for proper json, but otherwise was able to get a proper response.

Are you having a language specific problem? Perhaps some logging, or if you are trying curl, a verbose output will help.

Example:
Note: The id in the response is faked.

curl --user $U:$P -X POST -H 'Content-type: application/json' https://api.ordoro.com/address/ --data '{
"company": "TEST INC.",
"street1": "TEST ST",
"street2": "",
"zip": "12550",
"name": "BRUCE BANNER",
"city": "NEWBURGH",
"state": "NY",
"country": "US",
"email": "test@test.com",
"phone": "(888) 743-8423"
}'
{"company": "TEST INC.", "street1": "TEST ST", "street2": "", "zip": "12550", "id": 1234, "name": "BRUCE BANNER", "city": "NEWBURGH", "state": "NY", "country": "US", "email": "test@test.com", "phone": "(888) 743-8423", "fax": null, "reference_number": null, "cart_address_id": null, "validation": {"suggested": [], "is_error": false, "additional_text": null}}

Okay we’re getting somewhere. But I’m getting this error

{
“error_message”: “put() missing 1 required positional argument: ‘address_id’”,
“param”: null
}

And if I add an address_id it says.

{
“error_message”: “The input field ‘address_id’ was not expected.”,
“param”: null
}

This is what im putting in POSTMAN

{
“company”: “TEST INC.”,
“street1”: “TEST ST”,
“street2”: “”,
“zip”: “12550”,
“name”: “BRUCE BANNER”,
“city”: “NEWBURGH”,
“state”: “NY”,
“country”: “US”,
“email”: "test@test.com",
“phone”: “(888) 743-8423”,
“address_id”: “00000001”
}

Just so I’m clear, is the address_id something that has to be already generated and this is updating an already added address?

I want to add a new address entry that was never in ORDORO before.

Again I’m not sure if this is possible without an order attached to it.

Thanks!

That error message is telling me that you are using PUT instead of POST.

DUH! Boom! Works… you are awesome.

Thanks so much for sticking with me :slight_smile: