POST api/AddOrUpdateRecipients_V1

Add User/Client Recipients

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.AddressBook.AddRecipientsRequest
NameDescriptionTypeAdditional information
WS_Key

(Mandatory) Client Or User Webservice Key provided by 2ship support - the type of the ws_key should be set by WSKeyLevel field

string

None.

WSKeyLevel

(Mandatory) Specify the WS_Key type ( User or Client)

WS_Repository.Models.Common.WSKeyLevelType

None.

RecipientsList

(Mandatory) The List of Recipients to Add/Update

Collection of WS_Repository.Models.Requests.AddressBook.RecipientToAdd

None.

AddRecipientAsGlobal

(Optional) Specify to add the recipient as global regardless of WS_Key type

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "WS_Key": "sample string 1",
  "WSKeyLevel": 0,
  "RecipientsList": [
    {
      "ID": "sample string 1",
      "Contact": "sample string 2",
      "Company": "sample string 3",
      "CountryCode": "sample string 4",
      "ProvinceOrState": "sample string 5",
      "City": "sample string 6",
      "Postal": "sample string 7",
      "Address1": "sample string 8",
      "Address2": "sample string 9",
      "Address3": "sample string 10",
      "Tel": "sample string 11",
      "Extension": "sample string 12",
      "Fax": "sample string 13",
      "Email": "sample string 14",
      "Email1": "sample string 15",
      "Email2": "sample string 16",
      "IsResidential": true,
      "TaxID": "sample string 18",
      "Instructions": "sample string 19",
      "ShipmentInstructions": "sample string 20",
      "RecipientType": "sample string 21",
      "AddressLocation": "sample string 22",
      "PreferredCarrier": 1,
      "PreferredServiceCode": "sample string 23",
      "PreferredBillingType": 1,
      "PreferredCustomerPricingValue": 1.0,
      "PreferredCustomerPricingCalculationType": 0,
      "RecipientLogoBase64String": "sample string 24",
      "CarrierAccounts": [
        {
          "CarrierId": 1,
          "AccountNumber": "sample string 2",
          "DifferentBillingAddressThanRecipientAddress": true,
          "BillingAddress": {
            "Contact": "sample string 1",
            "Company": "sample string 2",
            "ProvinceOrState": "sample string 4",
            "City": "sample string 5",
            "Postal": "sample string 6",
            "Address1": "sample string 7",
            "Address2": "sample string 8",
            "Tel": "sample string 9",
            "Fax": "sample string 10",
            "Email": "sample string 11",
            "IsResidential": true,
            "TaxID": "sample string 13"
          },
          "AccountType": 0
        },
        {
          "CarrierId": 1,
          "AccountNumber": "sample string 2",
          "DifferentBillingAddressThanRecipientAddress": true,
          "BillingAddress": {
            "Contact": "sample string 1",
            "Company": "sample string 2",
            "ProvinceOrState": "sample string 4",
            "City": "sample string 5",
            "Postal": "sample string 6",
            "Address1": "sample string 7",
            "Address2": "sample string 8",
            "Tel": "sample string 9",
            "Fax": "sample string 10",
            "Email": "sample string 11",
            "IsResidential": true,
            "TaxID": "sample string 13"
          },
          "AccountType": 0
        }
      ],
      "PreferredDepartmentCode": "sample string 25",
      "PreferredDepartmentName": "sample string 26"
    },
    {
      "ID": "sample string 1",
      "Contact": "sample string 2",
      "Company": "sample string 3",
      "CountryCode": "sample string 4",
      "ProvinceOrState": "sample string 5",
      "City": "sample string 6",
      "Postal": "sample string 7",
      "Address1": "sample string 8",
      "Address2": "sample string 9",
      "Address3": "sample string 10",
      "Tel": "sample string 11",
      "Extension": "sample string 12",
      "Fax": "sample string 13",
      "Email": "sample string 14",
      "Email1": "sample string 15",
      "Email2": "sample string 16",
      "IsResidential": true,
      "TaxID": "sample string 18",
      "Instructions": "sample string 19",
      "ShipmentInstructions": "sample string 20",
      "RecipientType": "sample string 21",
      "AddressLocation": "sample string 22",
      "PreferredCarrier": 1,
      "PreferredServiceCode": "sample string 23",
      "PreferredBillingType": 1,
      "PreferredCustomerPricingValue": 1.0,
      "PreferredCustomerPricingCalculationType": 0,
      "RecipientLogoBase64String": "sample string 24",
      "CarrierAccounts": [
        {
          "CarrierId": 1,
          "AccountNumber": "sample string 2",
          "DifferentBillingAddressThanRecipientAddress": true,
          "BillingAddress": {
            "Contact": "sample string 1",
            "Company": "sample string 2",
            "ProvinceOrState": "sample string 4",
            "City": "sample string 5",
            "Postal": "sample string 6",
            "Address1": "sample string 7",
            "Address2": "sample string 8",
            "Tel": "sample string 9",
            "Fax": "sample string 10",
            "Email": "sample string 11",
            "IsResidential": true,
            "TaxID": "sample string 13"
          },
          "AccountType": 0
        },
        {
          "CarrierId": 1,
          "AccountNumber": "sample string 2",
          "DifferentBillingAddressThanRecipientAddress": true,
          "BillingAddress": {
            "Contact": "sample string 1",
            "Company": "sample string 2",
            "ProvinceOrState": "sample string 4",
            "City": "sample string 5",
            "Postal": "sample string 6",
            "Address1": "sample string 7",
            "Address2": "sample string 8",
            "Tel": "sample string 9",
            "Fax": "sample string 10",
            "Email": "sample string 11",
            "IsResidential": true,
            "TaxID": "sample string 13"
          },
          "AccountType": 0
        }
      ],
      "PreferredDepartmentCode": "sample string 25",
      "PreferredDepartmentName": "sample string 26"
    }
  ],
  "AddRecipientAsGlobal": true
}

application/xml, text/xml

Sample:
<AddRecipientsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.AddressBook">
  <AddRecipientAsGlobal>true</AddRecipientAsGlobal>
  <RecipientsList>
    <RecipientToAdd>
      <Address1>sample string 8</Address1>
      <Address2>sample string 9</Address2>
      <Address3>sample string 10</Address3>
      <AddressLocation>sample string 22</AddressLocation>
      <CarrierAccounts>
        <RecipientCarrierAccount>
          <AccountNumber>sample string 2</AccountNumber>
          <AccountType>Recipient</AccountType>
          <BillingAddress>
            <Address1>sample string 7</Address1>
            <Address2>sample string 8</Address2>
            <City>sample string 5</City>
            <Company>sample string 2</Company>
            <Contact>sample string 1</Contact>
            <Email>sample string 11</Email>
            <Fax>sample string 10</Fax>
            <IsResidential>true</IsResidential>
            <Postal>sample string 6</Postal>
            <ProvinceOrState>sample string 4</ProvinceOrState>
            <TaxID>sample string 13</TaxID>
            <Tel>sample string 9</Tel>
          </BillingAddress>
          <CarrierId>1</CarrierId>
          <DifferentBillingAddressThanRecipientAddress>true</DifferentBillingAddressThanRecipientAddress>
        </RecipientCarrierAccount>
        <RecipientCarrierAccount>
          <AccountNumber>sample string 2</AccountNumber>
          <AccountType>Recipient</AccountType>
          <BillingAddress>
            <Address1>sample string 7</Address1>
            <Address2>sample string 8</Address2>
            <City>sample string 5</City>
            <Company>sample string 2</Company>
            <Contact>sample string 1</Contact>
            <Email>sample string 11</Email>
            <Fax>sample string 10</Fax>
            <IsResidential>true</IsResidential>
            <Postal>sample string 6</Postal>
            <ProvinceOrState>sample string 4</ProvinceOrState>
            <TaxID>sample string 13</TaxID>
            <Tel>sample string 9</Tel>
          </BillingAddress>
          <CarrierId>1</CarrierId>
          <DifferentBillingAddressThanRecipientAddress>true</DifferentBillingAddressThanRecipientAddress>
        </RecipientCarrierAccount>
      </CarrierAccounts>
      <City>sample string 6</City>
      <Company>sample string 3</Company>
      <Contact>sample string 2</Contact>
      <CountryCode>sample string 4</CountryCode>
      <Email>sample string 14</Email>
      <Email1>sample string 15</Email1>
      <Email2>sample string 16</Email2>
      <Extension>sample string 12</Extension>
      <Fax>sample string 13</Fax>
      <ID>sample string 1</ID>
      <Instructions>sample string 19</Instructions>
      <IsResidential>true</IsResidential>
      <Postal>sample string 7</Postal>
      <PreferredBillingType>Prepaid</PreferredBillingType>
      <PreferredCarrier>1</PreferredCarrier>
      <PreferredCustomerPricingCalculationType>MarkupPercentage</PreferredCustomerPricingCalculationType>
      <PreferredCustomerPricingValue>1</PreferredCustomerPricingValue>
      <PreferredDepartmentCode>sample string 25</PreferredDepartmentCode>
      <PreferredDepartmentName>sample string 26</PreferredDepartmentName>
      <PreferredServiceCode>sample string 23</PreferredServiceCode>
      <ProvinceOrState>sample string 5</ProvinceOrState>
      <RecipientLogoBase64String>sample string 24</RecipientLogoBase64String>
      <RecipientType>sample string 21</RecipientType>
      <ShipmentInstructions>sample string 20</ShipmentInstructions>
      <TaxID>sample string 18</TaxID>
      <Tel>sample string 11</Tel>
    </RecipientToAdd>
    <RecipientToAdd>
      <Address1>sample string 8</Address1>
      <Address2>sample string 9</Address2>
      <Address3>sample string 10</Address3>
      <AddressLocation>sample string 22</AddressLocation>
      <CarrierAccounts>
        <RecipientCarrierAccount>
          <AccountNumber>sample string 2</AccountNumber>
          <AccountType>Recipient</AccountType>
          <BillingAddress>
            <Address1>sample string 7</Address1>
            <Address2>sample string 8</Address2>
            <City>sample string 5</City>
            <Company>sample string 2</Company>
            <Contact>sample string 1</Contact>
            <Email>sample string 11</Email>
            <Fax>sample string 10</Fax>
            <IsResidential>true</IsResidential>
            <Postal>sample string 6</Postal>
            <ProvinceOrState>sample string 4</ProvinceOrState>
            <TaxID>sample string 13</TaxID>
            <Tel>sample string 9</Tel>
          </BillingAddress>
          <CarrierId>1</CarrierId>
          <DifferentBillingAddressThanRecipientAddress>true</DifferentBillingAddressThanRecipientAddress>
        </RecipientCarrierAccount>
        <RecipientCarrierAccount>
          <AccountNumber>sample string 2</AccountNumber>
          <AccountType>Recipient</AccountType>
          <BillingAddress>
            <Address1>sample string 7</Address1>
            <Address2>sample string 8</Address2>
            <City>sample string 5</City>
            <Company>sample string 2</Company>
            <Contact>sample string 1</Contact>
            <Email>sample string 11</Email>
            <Fax>sample string 10</Fax>
            <IsResidential>true</IsResidential>
            <Postal>sample string 6</Postal>
            <ProvinceOrState>sample string 4</ProvinceOrState>
            <TaxID>sample string 13</TaxID>
            <Tel>sample string 9</Tel>
          </BillingAddress>
          <CarrierId>1</CarrierId>
          <DifferentBillingAddressThanRecipientAddress>true</DifferentBillingAddressThanRecipientAddress>
        </RecipientCarrierAccount>
      </CarrierAccounts>
      <City>sample string 6</City>
      <Company>sample string 3</Company>
      <Contact>sample string 2</Contact>
      <CountryCode>sample string 4</CountryCode>
      <Email>sample string 14</Email>
      <Email1>sample string 15</Email1>
      <Email2>sample string 16</Email2>
      <Extension>sample string 12</Extension>
      <Fax>sample string 13</Fax>
      <ID>sample string 1</ID>
      <Instructions>sample string 19</Instructions>
      <IsResidential>true</IsResidential>
      <Postal>sample string 7</Postal>
      <PreferredBillingType>Prepaid</PreferredBillingType>
      <PreferredCarrier>1</PreferredCarrier>
      <PreferredCustomerPricingCalculationType>MarkupPercentage</PreferredCustomerPricingCalculationType>
      <PreferredCustomerPricingValue>1</PreferredCustomerPricingValue>
      <PreferredDepartmentCode>sample string 25</PreferredDepartmentCode>
      <PreferredDepartmentName>sample string 26</PreferredDepartmentName>
      <PreferredServiceCode>sample string 23</PreferredServiceCode>
      <ProvinceOrState>sample string 5</ProvinceOrState>
      <RecipientLogoBase64String>sample string 24</RecipientLogoBase64String>
      <RecipientType>sample string 21</RecipientType>
      <ShipmentInstructions>sample string 20</ShipmentInstructions>
      <TaxID>sample string 18</TaxID>
      <Tel>sample string 11</Tel>
    </RecipientToAdd>
  </RecipientsList>
  <WSKeyLevel>User</WSKeyLevel>
  <WS_Key>sample string 1</WS_Key>
</AddRecipientsRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'WS_Repository.Models.Requests.AddressBook.AddRecipientsRequest'.

Response Information

Resource Description

WS_Repository.Models.Responses.AddressBook.AddRecipientsResponse
NameDescriptionTypeAdditional information
Success

Specify if the import was successfully done

boolean

None.

ErrorMessage

The error message if the import get an error

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "ErrorMessage": "sample string 2"
}

application/xml, text/xml

Sample:
<AddRecipientsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Responses.AddressBook">
  <ErrorMessage>sample string 2</ErrorMessage>
  <Success>true</Success>
</AddRecipientsResponse>