Address

This page contains the documentation for the address endpoints.

The address endpoints allow you to add, modify, select and delete an address. You can view the list of addresses that you have.

Get Addresses

get
/address/list

This endpoint allows you to get the list of addresses.

Authorizations
AuthorizationstringRequired

Provide your API key.

Responses
200

Successful response. Returns the user's address information.

application/json
get
/address/list
GET /address/list HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "_id": "6556dd7a50e4db57682be25c",
  "user": {
    "_id": "6555a0f89feeac7dccd9b1dd",
    "name": "first account"
  },
  "addresses": [
    {
      "address": "383 Kent St, Sydney NSW 2000, Australia",
      "main": false,
      "_id": "656bf54c99723847983a9714"
    },
    {
      "address": "80 Collins St, Melbourne VIC 3000, Australia",
      "main": true,
      "_id": "656d3c9b6f828da5305bad97"
    }
  ],
  "__v": 53
}

Get Google Places Key

get
/address/api_key

This endpoint allows you to get the API key for Google Places API. Learn more here.

Authorizations
AuthorizationstringRequired

Provide your API key.

Responses
200

Successful response. The order has been created successfully.

text/plain
Responsestring

The API key for Google Places.

Example: AIzaSyC6ASDCKAAS3G1E2EjRKlzk8TvHziasds"
get
/address/api_key
GET /address/api_key HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
AIzaSyC6ASDCKAAS3G1E2EjRKlzk8TvHziasds"

Add an Address

post
/address/add

This endpoint allows you to add an address for the user.

Authorizations
AuthorizationstringRequired

Provide your API key.

Body
addressstringRequired

The address of the user to add. Newly added address will be selected as the main address.

Responses
200

Successful response. The order has been created successfully.

text/plain
ResponsestringExample: success
post
/address/add
POST /address/add HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 53

{
  "address": "383 Kent St, Sydney NSW 2000, Australia"
}
success

Delete an Address

delete
/address/delete

This endpoint allows you to delete an address.

Authorizations
AuthorizationstringRequired

Provide your API key.

Body
addressIdstringRequired

The address ID of the user to be deleted. Use the GET get addresses endpoint to look at the list of addresses, and it's ID.

Responses
200

Successful response. Returns the user's address information.

application/json
delete
/address/delete
DELETE /address/delete HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "addressId": "674b3347dc3d9360b4c32da3"
}
{
  "_id": "6556dd7a50e4db57682be25c",
  "user": "6555a0f89feeac7dccd9b1dd",
  "addresses": [
    {
      "address": "383 Kent St, Sydney NSW 2000, Australia",
      "main": false,
      "_id": "656bf54c99723847983a9714"
    },
    {
      "address": "80 Collins St, Melbourne VIC 3000, Australia",
      "main": true,
      "_id": "656d3c9b6f828da5305bad97"
    }
  ],
  "__v": 53
}

Last updated