Address

Address allows users to manage addresses for a given Address Book entry. It contains:

  • Address related fields:

    • AddressLine1\

    • AddressLine2\

    • City\

    • StateProvince\

    • ZipCode\

    • Country\

  • Description: free text to easily identify an address (for example: Home, Commercial, etc)\

  • ParentKey: the Address Book entry key that the address is related to\

A few relevant information about CRUD operations:

  • When reading using Legacy driver (default), at least one filter must be provided in the SearchCriteria. When using SQL driver, SearchCriteria can be empty (although not recommended).\

  • When updating, ParentKey cannot be changed (value provided in the payload is ignored). If those fields need to be changed, the entire Address must be deleted, and a new one must be created.

HowTo's

Read - Top 3 Addresses

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Address": {
        "Scope": {
            "Fields": {
                "Key": 1,
                "DisplayValue": 1
            }
        },
        "Criteria": {
            // SearchQuery is mandatory when using Legacy Driver
            "SearchQuery": {},
            "Top": 3
        }
    },
    "Configuration": {
        "Drivers": {
            "IAddressSearcher": "Maximizer.Model.Access.Sql.AddressSearcher"
        }
    }
}

MetaData

Read Address metadata (simple)

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Schema": {
        "Scope": {
            "Fields": 1
        },
        "Criteria": {
            "SearchQuery": {
                "Key": {
                    "$TREE": "/Address"
                }
            }
        }
    },
    "Compatibility": {
        "SchemaObject": "1.0"
    }
}

Read Address metadata (more)

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Schema": {
        "Scope": {
            "Fields": {
                "Key": 1,
                "Alias": 1,
                "Type": 1,
                "Name": 1,
                "AppliesTo": 1,
                "Sortable": 1,
                "Queryable": 1,
                "Mandatory": 1,
                "Attributes": 1,
                "DisplayValue": 1
            }
        },
        "Criteria": {
            "SearchQuery": {
                "Key": {
                    "$TREE": "/Address"
                }
            }
        }
    },
    "Compatibility": {
        "SchemaObject": "1.0"
    }
}

FieldOptions

Read Address FieldOptions - City

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Address": {
        "FieldOptions": {
            "City": {
                "Key": 1,
                "DisplayValue": 1
            }
        }
    }
}

Read Address FieldOptions - Country

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Address": {
        "FieldOptions": {
            "Country": {
                "Key": 1,
                "DisplayValue": 1
            }
        }
    }
}

Read Address FieldOptions - StateProvince

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Address": {
        "FieldOptions": {
            "StateProvince": {
                "Key": 1,
                "DisplayValue": 1
            }
        }
    }
}

Address CRUD

Create - Address

// POST https://api.maximizer.com/octopus/Create
// Authorization: Bearer <token>
{
    "Address": {
        "Data": {
            "Key": null,
            "ParentKey": "QWJFbnRyeQlERU1PXzFDCTA=", // mandatory
            "Description": "Address created from Postman",
            "AddressLine1": "1234 Test Street",
            "AddressLine2": "Unit #456",
            "City": "Vancouver",
            "Country": "Canada",
            "StateProvince": "BC",
            "ZipCode": "V3T1P3",
            "Default": true
        }
    }
}

Read - Address

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "Address": {
        "Scope": {
            "Fields": {
                "Key": {
                    "Value": 1,
                    "ID": 1,
                    "Number": 1,
                    "EntityType": 1
                },
                "Description": 1,
                "AddressLine1": 1,
                "AddressLine2": 1,
                "City": 1,
                "Country": 1,
                "StateProvince": 1,
                "ZipCode": 1,
                "Default": 1,
                "ParentKey": 1,
                "DisplayValue": 1
            }
        },
        "Criteria": {
            // SearchQuery is mandatory when using Legacy Driver
            "SearchQuery": {
                "ParentKey": {
                    "$EQ": "QWJFbnRyeQlERU1PXzFDCTA="
                }
            }
        }
    },
    "Compatibility": {
        "AbEntryKey": "2.0" // for ParentKey
    },
    "Configuration": {
        "Drivers": {
            "IAddressSearcher": "Maximizer.Model.Access.Sql.AddressSearcher"
        }
    }
}

Update - Address

// POST https://api.maximizer.com/octopus/Update
// Authorization: Bearer <token>
{
    "Address": {
        "Data": {
            "Key": "QWRkcmVzcwlERU1PXzFDCTYwMDAx", // mandatory
            "Description": "Address updated from Postman",
            "AddressLine1": "1234 Test Street (updated)",
            "AddressLine2": "Unit #456 (updated)"
        }
    }
}

Delete - Address

// POST https://api.maximizer.com/octopus/Delete
// Authorization: Bearer <token>
{
    "Address": {
        "Data": {
            "Key": "QWRkcmVzcwlERU1PXzFDCTYwMDAx" // mandatory
        }
    }
}