• Customer Management/
    Addresses API/
    Get an Address

    Get an Address

    GET Get By ID

    https://api.moltin.com/v2/customers/:customerId/addresses/:addressId
    

    OR

    https://api.moltin.com/v2/accounts/:accountId/addresses/:addressId
    

    Parameters

    Path parameters

    NameRequiredTypeDescription
    addressIdRequiredstringThe ID for the Address you are requesting.
    customerIdRequired (for customer addresses)stringA customer ID that has addresses.
    accountIdRequired (for account addresses)stringAn account ID that has addresses.

    Headers

    NameRequiredTypeDescription
    X-Moltin-Customer-TokenOptionalstringA customer token used to access customer addresses implicitly.
    EP-Account-Management-Authentication-TokenOptionalstringAn account management authentication token that identifies the authenticated account member.
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Request Examples Get Customer Address With Customer Token

    Curl

    curl -X GET https://api.moltin.com/v2/customers/:customer_id/addresses/:address_id \
         -H "X-Moltin-Customer-Token: XXXX"
         -H "Authorization: Bearer XXXX"
    

    JavaScript SDK

    const MoltinGateway = require("@moltin/sdk").gateway;
    const Moltin = MoltinGateway({
        client_id: "X",
    });
    const customerId = "XXXX";
    const addressId = "XXXX";
    const customerToken = "XXXX";
    Moltin.CustomerAddresses.Get({
        customer: customerId,
        address: addressId,
        token: customerToken,
    }).then((address) => {
        // Do something
    });
    

    Request Examples Get Customer Address Without Customer Token

    Curl

    curl -X GET https://api.moltin.com/v2/customers/:customer_id/addresses/:address_id \
         -H "Authorization: Bearer XXXX"
    

    JavaScript SDK

    const MoltinGateway = require("@moltin/sdk").gateway;
    const Moltin = MoltinGateway({
        client_id: "X",
        client_secret: "X",
    });
    const customerId = "XXXX";
    const addressId = "XXXX";
    Moltin.CustomerAddresses.Get({
        customer: customerId,
        address: addressId,
    }).then((address) => {
        // Do something
    });
    

    Request Examples Get Account Address With Account Token

    Curl

    curl -X GET https://api.moltin.com/v2/accounts/:account_id/addresses/:address_id \
         -H "Ep-Account-Management-Authentication-Token: XXXX"
         -H "Authorization: Bearer XXXX"
    

    JavaScript SDK

    const MoltinGateway = require("@moltin/sdk").gateway;
    const Moltin = MoltinGateway({
        client_id: "X",
    });
    const accountId = "XXXX";
    const addressId = "XXXX";
    const accountToken = "XXXX";
    Moltin.AccountAddresses.Get({
        customer: accountId,
        address: addressId,
        token: accountToken,
    }).then((address) => {
        // Do something
    });
    

    Request Examples Get Account Address Without Account Token

    Curl

    curl -X GET https://api.moltin.com/v2/accounts/:account_id/addresses/:address_id \
         -H "Authorization: Bearer XXXX"
    

    JavaScript SDK

    const MoltinGateway = require("@moltin/sdk").gateway;
    const Moltin = MoltinGateway({
        client_id: "X",
        client_secret: "X",
    });
    const accountId = "XXXX";
    const addressId = "XXXX";
    Moltin.AccountAddresses.Get({
        account: accountId,
        address: addressId,
    }).then((address) => {
        // Do something
    });
    

    Response example

    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",
        "region": "Peterborough",
        "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"
            }
        }
    }
    

    Was this helpful?

    Previous
    Get Addresses