Skip to content

Instantly share code, notes, and snippets.

@adamkuipers
Last active April 1, 2016 18:37
Show Gist options
  • Save adamkuipers/217da51c5364c49eb90aeaa2fa6c2864 to your computer and use it in GitHub Desktop.
Save adamkuipers/217da51c5364c49eb90aeaa2fa6c2864 to your computer and use it in GitHub Desktop.
# Create new address
curl \
-v \
-H "Content-Type: application/json" \
-X POST \
-d '{
"id": "GARBAGE",
"customerId": "5a57604e-e717-11e5-a529-5f344b5b4cee",
"firstName": "The Sweetest",
"lastName": "Ever",
"street1": "999",
"city": "palmdale",
"state": "CA",
"postalCode": "94112",
"countryCode": "US",
"isDefault": true
}' \
$ACCOUNTS_HOST/api/v1/customers/$CUSTOMER_ID/addresses\?accessToken\=$AUTH_TOKEN
# * upload completely sent off: 335 out of 335 bytes
# < HTTP/1.1 200 OK
# < Transfer-Encoding: chunked
# < Date: Fri, 01 Apr 2016 18:27:15 GMT
# < Server: Warp/3.2.2
# < Content-Type: application/json
# < Connection: close
# <
# * Closing connection 0
# {"state":"CA","postalCode":"94112","id":"5bb3845a-f837-11e5-bdce-63d3ae48a2ea","customerId":"e121a9d8-f836-11e5-bdcd-fb4e6c7bd4dc","firstName":"The Sweetest","lastName":"Ever","street1":"999","city":"palmdale","countryCode":"US","isDefault":true}%
# Get all addresses
curl \
-v \
$ACCOUNTS_HOST/api/v1/customers/$CUSTOMER_ID/addresses\?accessToken\=$AUTH_TOKEN
# < HTTP/1.1 200 OK
# < Transfer-Encoding: chunked
# < Date: Fri, 01 Apr 2016 18:28:45 GMT
# < Server: Warp/3.2.2
# < Content-Type: application/json
# < Connection: close
# <
# * Closing connection 0
# [{"state":"CA","postalCode":"94112","id":"5bb3845a-f837-11e5-bdce-63d3ae48a2ea","customerId":"e121a9d8-f836-11e5-bdcd-fb4e6c7bd4dc","firstName":"The Sweetest","lastName":"Ever","street1":"999","city":"palmdale","countryCode":"US","isDefault":false}]%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment