POST api/AggregateOrders_V1

Aggregate mmultiple orders based on aggregation rules

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.OrderAggregation.AggregationRequest
NameDescriptionTypeAdditional information
WS_Key

(Mandatory) Webservice Key provided by 2ship support

string

None.

Filter

(Optional) Filter the orders that you wanat to be aggregated

WS_Repository.Models.Requests.OrderAggregation.OrdersFilter

None.

RunRateAfterAggregationIsDone

(Optional) Run Rate After Aggregation Is Done (will rate the aggregated groups to apply the cheepest service for each)

boolean

None.

Webhooks

Optional webhook options, to have 2Ship post AggregationResponse ( returned by AggregateOrders method) when the aggregation process finished

Collection of WS_Repository.Models.Requests.OrderAggregation.Webhook

None.

MarkConsideredForAggregation

(Optional) Mark orders Considered for Aggregation and these orders will be filter out in the next aggregation request

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "WS_Key": "sample string 1",
  "Filter": {
    "LocationId": 1,
    "ProjectId": "sample string 2"
  },
  "RunRateAfterAggregationIsDone": true,
  "Webhooks": [
    {
      "Uri": "http://webapihelppage1.com",
      "Username": "sample string 2",
      "Password": "sample string 3"
    },
    {
      "Uri": "http://webapihelppage1.com",
      "Username": "sample string 2",
      "Password": "sample string 3"
    }
  ],
  "MarkConsideredForAggregation": true
}

application/xml, text/xml

Sample:
<AggregationRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.OrderAggregation">
  <Filter>
    <LocationId>1</LocationId>
    <ProjectId>sample string 2</ProjectId>
  </Filter>
  <MarkConsideredForAggregation>true</MarkConsideredForAggregation>
  <RunRateAfterAggregationIsDone>true</RunRateAfterAggregationIsDone>
  <WS_Key>sample string 1</WS_Key>
  <Webhooks>
    <Webhook_Aggregation>
      <Password>sample string 3</Password>
      <Uri>http://webapihelppage1.com/</Uri>
      <Username>sample string 2</Username>
    </Webhook_Aggregation>
    <Webhook_Aggregation>
      <Password>sample string 3</Password>
      <Uri>http://webapihelppage1.com/</Uri>
      <Username>sample string 2</Username>
    </Webhook_Aggregation>
  </Webhooks>
</AggregationRequest>

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.OrderAggregation.AggregationRequest'.

Response Information

Resource Description

WS_Repository.Models.Responses.OrderAggregation.AggregationResponse
NameDescriptionTypeAdditional information
Status

The Status of the aggregation Process

WS_Repository.Models.Responses.OrderAggregation.AggregationStatus

None.

Message

The Message when tha status is Failed

string

None.

TaskGuid

The Task Id of the Rate Aggregation Status (Used when you want to call the aggregation rate Progress status)

string

None.

AggregationDetails

Details of aggregation

WS_Repository.Models.Responses.OrderAggregation.AggregationDetails

None.

Response Formats

application/json, text/json

Sample:
{
  "Status": 0,
  "Message": "sample string 1",
  "TaskGuid": "sample string 2",
  "AggregationDetails": {
    "AggregationGroups": [
      {
        "AggregationKey": "sample string 1",
        "RateService": {
          "HaveRate": true,
          "CarrierId": 2,
          "CarrierName": "sample string 3",
          "ServiceCode": "sample string 4",
          "ServiceName": "sample string 5",
          "Currency": "sample string 6",
          "TotalClientPrice": 7.0,
          "TotalCustomerPrice": 8.0,
          "CarrierType": 0
        },
        "AggregatedGroupOrders": [
          {
            "HoldShipmentId": 1,
            "OrderNumber": "sample string 2"
          },
          {
            "HoldShipmentId": 1,
            "OrderNumber": "sample string 2"
          }
        ]
      },
      {
        "AggregationKey": "sample string 1",
        "RateService": {
          "HaveRate": true,
          "CarrierId": 2,
          "CarrierName": "sample string 3",
          "ServiceCode": "sample string 4",
          "ServiceName": "sample string 5",
          "Currency": "sample string 6",
          "TotalClientPrice": 7.0,
          "TotalCustomerPrice": 8.0,
          "CarrierType": 0
        },
        "AggregatedGroupOrders": [
          {
            "HoldShipmentId": 1,
            "OrderNumber": "sample string 2"
          },
          {
            "HoldShipmentId": 1,
            "OrderNumber": "sample string 2"
          }
        ]
      }
    ],
    "NonAggregatedOrders": [
      {
        "HoldShipmentId": 1,
        "OrderNumber": "sample string 2"
      },
      {
        "HoldShipmentId": 1,
        "OrderNumber": "sample string 2"
      }
    ]
  }
}

application/xml, text/xml

Sample:
<AggregationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Responses.OrderAggregation">
  <AggregationDetails>
    <AggregationGroups>
      <AggregationGroup>
        <AggregatedGroupOrders>
          <AggregatedGroupOrder>
            <HoldShipmentId>1</HoldShipmentId>
            <OrderNumber>sample string 2</OrderNumber>
          </AggregatedGroupOrder>
          <AggregatedGroupOrder>
            <HoldShipmentId>1</HoldShipmentId>
            <OrderNumber>sample string 2</OrderNumber>
          </AggregatedGroupOrder>
        </AggregatedGroupOrders>
        <AggregationKey>sample string 1</AggregationKey>
        <RateService>
          <CarrierId>2</CarrierId>
          <CarrierName>sample string 3</CarrierName>
          <CarrierType>SmallPack</CarrierType>
          <Currency>sample string 6</Currency>
          <HaveRate>true</HaveRate>
          <ServiceCode>sample string 4</ServiceCode>
          <ServiceName>sample string 5</ServiceName>
          <TotalClientPrice>7</TotalClientPrice>
          <TotalCustomerPrice>8</TotalCustomerPrice>
        </RateService>
      </AggregationGroup>
      <AggregationGroup>
        <AggregatedGroupOrders>
          <AggregatedGroupOrder>
            <HoldShipmentId>1</HoldShipmentId>
            <OrderNumber>sample string 2</OrderNumber>
          </AggregatedGroupOrder>
          <AggregatedGroupOrder>
            <HoldShipmentId>1</HoldShipmentId>
            <OrderNumber>sample string 2</OrderNumber>
          </AggregatedGroupOrder>
        </AggregatedGroupOrders>
        <AggregationKey>sample string 1</AggregationKey>
        <RateService>
          <CarrierId>2</CarrierId>
          <CarrierName>sample string 3</CarrierName>
          <CarrierType>SmallPack</CarrierType>
          <Currency>sample string 6</Currency>
          <HaveRate>true</HaveRate>
          <ServiceCode>sample string 4</ServiceCode>
          <ServiceName>sample string 5</ServiceName>
          <TotalClientPrice>7</TotalClientPrice>
          <TotalCustomerPrice>8</TotalCustomerPrice>
        </RateService>
      </AggregationGroup>
    </AggregationGroups>
    <NonAggregatedOrders>
      <NonAggregatedOrder>
        <HoldShipmentId>1</HoldShipmentId>
        <OrderNumber>sample string 2</OrderNumber>
      </NonAggregatedOrder>
      <NonAggregatedOrder>
        <HoldShipmentId>1</HoldShipmentId>
        <OrderNumber>sample string 2</OrderNumber>
      </NonAggregatedOrder>
    </NonAggregatedOrders>
  </AggregationDetails>
  <Message>sample string 1</Message>
  <Status>Succeeded</Status>
  <TaskGuid>sample string 2</TaskGuid>
</AggregationResponse>