POST Addresses

Adds an Address. Do not try to set AccountWide labels or favourites here. Use the patch methods. Similarly, setting distances here wont work either. Use the AddressDistances resource instead.


Parameters

NameDescriptionAdditional information
request
The Address to add. 
            When adding a new Address through the API, the following properties are required:
            Id: Must be set to 0, or the add will throw an error.
            Label: Must be set to something meaningful, or the add will throw an error.

Define this parameter in the request body.

Request body formats

application/json, text/json

Sample:
{
  "Id": 0,
  "GlobalIdentifier": null,
  "AddressSource": 0,
  "AddressName": "Your Business",
  "FriendlyName": null,
  "Line1": "Business House",
  "Line2": "Business Lane",
  "Line3": "Business Area",
  "City": "Business City",
  "County": "BusinessShire",
  "Country": 1,
  "Postcode": "BI2 N1S",
  "AccountWideLabels": [],
  "IsAccountWideFavourite": false,
  "FavouriteId": 0,
  "PrimaryAccountWideLabel": null,
  "RecommendedDistances": [],
  "IsRetriveable": false,
  "AddressActionOutcome": 0,
  "Label": null,
  "LabelId": 0,
  "StartDate": null,
  "EndDate": null,
  "IsHomeAddress": false,
  "IsOfficeAddress": false,
  "StepSummary": null,
  "AddressFriendlyText": null,
  "EsrAssignmentId": 0,
  "Archived": false
}

application/xml, text/xml

Sample:
<Address xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Types">
  <Archived>false</Archived>
  <AccountWideLabels xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <AddressActionOutcome>Success</AddressActionOutcome>
  <AddressFriendlyText i:nil="true" />
  <AddressName>Your Business</AddressName>
  <AddressSource>SEL</AddressSource>
  <City>Business City</City>
  <Country>1</Country>
  <County>BusinessShire</County>
  <EndDate i:nil="true" />
  <EsrAssignmentId>0</EsrAssignmentId>
  <FavouriteId>0</FavouriteId>
  <FriendlyName i:nil="true" />
  <GlobalIdentifier i:nil="true" />
  <Id>0</Id>
  <IsAccountWideFavourite>false</IsAccountWideFavourite>
  <IsHomeAddress>false</IsHomeAddress>
  <IsOfficeAddress>false</IsOfficeAddress>
  <IsRetriveable>false</IsRetriveable>
  <Label i:nil="true" />
  <LabelId>0</LabelId>
  <Line1>Business House</Line1>
  <Line2>Business Lane</Line2>
  <Line3>Business Area</Line3>
  <Postcode>BI2 N1S</Postcode>
  <PrimaryAccountWideLabel i:nil="true" />
  <RecommendedDistances xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <StartDate i:nil="true" />
  <StepSummary i:nil="true" />
</Address>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response body formats

An AddressResponse.

application/json, text/json

Sample:
{
  "Item": {
    "Id": 1,
    "GlobalIdentifier": "sample string 2",
    "AddressSource": 0,
    "AddressName": "sample string 3",
    "FriendlyName": "sample string 4",
    "Line1": "sample string 5",
    "Line2": "sample string 6",
    "Line3": "sample string 7",
    "City": "sample string 8",
    "County": "sample string 9",
    "Country": 10,
    "Postcode": "sample string 11",
    "AccountWideLabels": [
      1,
      2,
      3
    ],
    "IsAccountWideFavourite": true,
    "FavouriteId": 13,
    "PrimaryAccountWideLabel": 1,
    "RecommendedDistances": [
      1,
      2,
      3
    ],
    "IsRetriveable": true,
    "AddressActionOutcome": 0,
    "Label": "sample string 15",
    "LabelId": 16,
    "StartDate": "2025-01-26T06:57:04.4842766+00:00",
    "EndDate": "2025-01-26T06:57:04.4842766+00:00",
    "IsHomeAddress": true,
    "IsOfficeAddress": true,
    "StepSummary": "sample string 19",
    "AddressFriendlyText": "sample string 20",
    "EsrAssignmentId": 21,
    "Archived": true
  },
  "ResponseInformation": {
    "Errors": [
      {
        "ErrorCode": "sample string 1",
        "Message": "sample string 2"
      },
      {
        "ErrorCode": "sample string 1",
        "Message": "sample string 2"
      },
      {
        "ErrorCode": "sample string 1",
        "Message": "sample string 2"
      }
    ],
    "Status": 0,
    "Links": [
      {
        "Rel": "sample string 1",
        "Href": "sample string 2",
        "Title": "sample string 3",
        "IsTemplated": true
      },
      {
        "Rel": "sample string 1",
        "Href": "sample string 2",
        "Title": "sample string 3",
        "IsTemplated": true
      },
      {
        "Rel": "sample string 1",
        "Href": "sample string 2",
        "Title": "sample string 3",
        "IsTemplated": true
      }
    ]
  }
}

application/xml, text/xml

Sample:
<AddressResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Responses">
  <ResponseInformation xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Common">
    <Errors>
      <ApiErrorDetail>
        <ErrorCode>sample string 1</ErrorCode>
        <Message>sample string 2</Message>
      </ApiErrorDetail>
      <ApiErrorDetail>
        <ErrorCode>sample string 1</ErrorCode>
        <Message>sample string 2</Message>
      </ApiErrorDetail>
      <ApiErrorDetail>
        <ErrorCode>sample string 1</ErrorCode>
        <Message>sample string 2</Message>
      </ApiErrorDetail>
    </Errors>
    <Links>
      <Link>
        <Href>sample string 2</Href>
        <IsTemplated>true</IsTemplated>
        <Rel>sample string 1</Rel>
        <Title>sample string 3</Title>
      </Link>
      <Link>
        <Href>sample string 2</Href>
        <IsTemplated>true</IsTemplated>
        <Rel>sample string 1</Rel>
        <Title>sample string 3</Title>
      </Link>
      <Link>
        <Href>sample string 2</Href>
        <IsTemplated>true</IsTemplated>
        <Rel>sample string 1</Rel>
        <Title>sample string 3</Title>
      </Link>
    </Links>
    <Status>Failure</Status>
  </ResponseInformation>
  <Item xmlns:d2p1="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Types" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Common">
    <d2p1:Archived>true</d2p1:Archived>
    <d2p1:AccountWideLabels xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>1</d3p1:int>
      <d3p1:int>2</d3p1:int>
      <d3p1:int>3</d3p1:int>
    </d2p1:AccountWideLabels>
    <d2p1:AddressActionOutcome>Success</d2p1:AddressActionOutcome>
    <d2p1:AddressFriendlyText>sample string 20</d2p1:AddressFriendlyText>
    <d2p1:AddressName>sample string 3</d2p1:AddressName>
    <d2p1:AddressSource>SEL</d2p1:AddressSource>
    <d2p1:City>sample string 8</d2p1:City>
    <d2p1:Country>10</d2p1:Country>
    <d2p1:County>sample string 9</d2p1:County>
    <d2p1:EndDate>2025-01-26T06:57:04.4842766+00:00</d2p1:EndDate>
    <d2p1:EsrAssignmentId>21</d2p1:EsrAssignmentId>
    <d2p1:FavouriteId>13</d2p1:FavouriteId>
    <d2p1:FriendlyName>sample string 4</d2p1:FriendlyName>
    <d2p1:GlobalIdentifier>sample string 2</d2p1:GlobalIdentifier>
    <d2p1:Id>1</d2p1:Id>
    <d2p1:IsAccountWideFavourite>true</d2p1:IsAccountWideFavourite>
    <d2p1:IsHomeAddress>true</d2p1:IsHomeAddress>
    <d2p1:IsOfficeAddress>true</d2p1:IsOfficeAddress>
    <d2p1:IsRetriveable>true</d2p1:IsRetriveable>
    <d2p1:Label>sample string 15</d2p1:Label>
    <d2p1:LabelId>16</d2p1:LabelId>
    <d2p1:Line1>sample string 5</d2p1:Line1>
    <d2p1:Line2>sample string 6</d2p1:Line2>
    <d2p1:Line3>sample string 7</d2p1:Line3>
    <d2p1:Postcode>sample string 11</d2p1:Postcode>
    <d2p1:PrimaryAccountWideLabel>1</d2p1:PrimaryAccountWideLabel>
    <d2p1:RecommendedDistances xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>1</d3p1:int>
      <d3p1:int>2</d3p1:int>
      <d3p1:int>3</d3p1:int>
    </d2p1:RecommendedDistances>
    <d2p1:StartDate>2025-01-26T06:57:04.4842766+00:00</d2p1:StartDate>
    <d2p1:StepSummary>sample string 19</d2p1:StepSummary>
  </Item>
</AddressResponse>
URI parameters
=
Headers | Add header
: Delete
Body
Samples:
Status
Headers
Body