Get an Address

Last updated 9 months ago

get
Get By ID

https://api.moltin.com
/v2/customers/:customerId/addresses/:addressId
Request
Response
Path Parameters
addressId
required
string
The ID for the Address you are requesting
customerId
required
string
A customer ID that has addresses
Headers
X-Moltin-Customer-Token
optional
string
A customer token used to access customer addresses implicitly
Authorization
required
string
The Bearer token to grant access to the API
200: OK
{
"id": "5f8da740-6680-463e-b31c-190b2db4bf9d",
"type": "address",
"name": "Home",
"first_name": "Ron",
"last_name": "Swanson",
"company_name": "",
"phone_number": "(555) 555-1234",
"line_1": "1 Sunny Street",
"line_2": "Sunny Place",
"city": "Sunny Town",
"postcode": "SU33 1YY",
"county": "Sunnyville",
"country": "GB",
"instructions": "Leave in the shed",
"links": {
"self":
"https://api.moltin.com/v2/addresses/5f8da740-6680-463e-b31c-190b2db4bf9d"
},
"meta": {
"timestamps": {
"created_at": "2018-05-04T15:20:09.734Z",
"updated_at": "2018-05-04T15:20:09.734Z"
}
}
}

With Customer Token

cURL
JavaScript SDK
curl -X GET https://api.moltin.com/v2/customers/:customer_id/addresses/:address_id \
-H "X-Moltin-Customer-Token: XXXX"
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const customerId = 'XXXX'
const addressId = 'XXXX'
const customerToken = 'XXXX'
Moltin.Addresses.Get({
customer: customerId,
addresss: addressId,
token: customerToken
}).then(address => {
// Do something
})

Without Customer Token

cURL
JavaScript SDK
curl -X GET https://api.moltin.com/v2/customers/:customer_id/addresses/:address_id \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const customerId = 'XXXX'
const addressId = 'XXXX'
Moltin.Addresses.Get({
customer: customerId,
addresss: addressId
}).then(address => {
// Do something
})