Jump to content

XpressPost with Canada Post Shipping Module


Papirus39

Recommended Posts

Here is your request
Claude

Request Sent - http://sellonline.canadapost.ca/
<eparcel> <language>en</language> <ratesAndServicesRequest> <merchantCPCID>****</merchantCPCID> <fromPostalCode>J0L 1N0</fromPostalCode> <itemsPrice>294.36</itemsPrice> <lineItems> <item> <quantity>1</quantity> <weight>0.512</weight> <length>0</length> <width>0</width> <height>0</height> <description>Online Order</description> </item> </lineItems> <city>ste-julie</city> <provOrState>Québec</provOrState> <country>CA</country> <postalCode>J3E 1L3</postalCode> </ratesAndServicesRequest> </eparcel>
Response received
<?xml version="1.0"?> <!DOCTYPE eparcel [ <!-- EVERY REQUEST CONTAIN THE eparcel TAG --> <!ELEMENT eparcel (ratesAndServicesResponse)> <!-- ********************************************************* --> <!-- * Standard response for request for rates and services * --> <!-- ********************************************************* --> <!ELEMENT ratesAndServicesResponse (statusCode, statusMessage+, requestID, handling, language, product+, packing*, emptySpace*, shippingOptions, comment, nearestPostalOutlet*)> <!ELEMENT statusCode (#PCDATA)> <!ELEMENT statusMessage (#PCDATA)> <!ELEMENT requestID (#PCDATA)> <!ELEMENT handling (#PCDATA)> <!ELEMENT language (#PCDATA)> <!ELEMENT product (name, rate, shippingDate, deliveryDate, deliveryDayOfWeek, nextDayAM?, packingID)> <!ATTLIST product id CDATA #REQUIRED sequence CDATA #REQUIRED > <!ELEMENT name (#PCDATA)> <!ELEMENT rate (#PCDATA)> <!ELEMENT shippingDate (#PCDATA)> <!ELEMENT deliveryDate (#PCDATA)> <!ELEMENT deliveryDayOfWeek (#PCDATA)> <!ELEMENT nextDayAM (#PCDATA)> <!ELEMENT packingID (#PCDATA)> <!ELEMENT packing (packingID, box+)> <!ELEMENT box (name, weight, expediterWeight, length, width, height, packedItem+)> <!ELEMENT weight (#PCDATA)> <!ELEMENT expediterWeight (#PCDATA)> <!ELEMENT length (#PCDATA)> <!ELEMENT width (#PCDATA)> <!ELEMENT height (#PCDATA)> <!ELEMENT packedItem (quantity, description)> <!ELEMENT quantity (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT emptySpace (length, width, height, weight)> <!ELEMENT shippingOptions (insurance, deliveryConfirmation, signature, flexiblePaymentAvailable?)> <!ELEMENT insurance (#PCDATA)> <!ELEMENT deliveryConfirmation (#PCDATA)> <!ELEMENT signature (#PCDATA)> <!ELEMENT flexiblePaymentAvailable EMPTY> <!ELEMENT comment (#PCDATA)> <!-- ********************************************************* --> <!-- * 'nearestPostalOutlet' is optional and is returned * --> <!-- * only if the merchant profile has this option enabled * --> <!-- ********************************************************* --> <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo, distance, outletName, businessName, postalAddress, phoneNumber, businessHours+)> <!ELEMENT postalOutletSequenceNo (#PCDATA)> <!ELEMENT distance (#PCDATA)> <!ELEMENT outletName (#PCDATA)> <!ELEMENT businessName (#PCDATA)> <!ELEMENT postalAddress (addressLine+, postalCode, municipality, province?)> <!ELEMENT addressLine (#PCDATA)> <!ELEMENT postalCode (#PCDATA)> <!ELEMENT municipality (#PCDATA)> <!ELEMENT province (#PCDATA)> <!ELEMENT phoneNumber (#PCDATA)> <!ELEMENT businessHours (dayId, dayOfWeek, time)> <!ELEMENT dayId (#PCDATA)> <!ELEMENT dayOfWeek (#PCDATA)> <!ELEMENT time (#PCDATA)> ]> <eparcel> <ratesAndServicesResponse> <statusCode>1</statusCode> <statusMessage>OK</statusMessage> <requestID>2246837</requestID> <handling>0.0</handling> <language>0</language> <product id="1020" sequence="1"> <name>Expedited</name> <rate>9.1</rate> <shippingDate>2015-05-15</shippingDate> <deliveryDate>2015-05-19</deliveryDate> <deliveryDayOfWeek>3</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="1010" sequence="2"> <name>Regular</name> <rate>9.1</rate> <shippingDate>2015-05-15</shippingDate> <deliveryDate>2015-05-20</deliveryDate> <deliveryDayOfWeek>4</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <packing> <packingID>P_0</packingID> <box> <name>moyenne_1_24</name> <weight>0.592</weight> <expediterWeight>0.592</expediterWeight> <length>13.0</length> <width>13.0</width> <height>13.0</height> <packedItem> <quantity>1</quantity> <description>Online Order</description> </packedItem> </box> </packing> <shippingOptions> <insurance>No</insurance> <deliveryConfirmation>Yes</deliveryConfirmation> <signature>No</signature> </shippingOptions> <comment></comment> </ratesAndServicesResponse> </eparcel> <!--END_OF_EPARCEL--> 

 

Link to comment
Share on other sites

According to the response, CP is offering only the shipping product 1020:Expedited and 1010:Regular.

I have found that a response from any shipping provider will include all available shipping products based on the criteria set by the shipper from the package's description.

I see that the package's description gives weight and declared value, but there is no mention of length, width, and height.

I don't have a copy of the CanadaPost Shipper's Manual, but I will guess that XpressPost and Priority Courier may require these values.

To test, enter values for these fields and start the checkout process again.

After the test, reply with the latest Request/Response from the Request Log.

Link to comment
Share on other sites

OK,

I don't know why, I change the test customer adress to NT and all the 4 quotes are there!

 
Request Sent - http://sellonline.canadapost.ca/
<eparcel> <language>en</language> <ratesAndServicesRequest> <merchantCPCID>****</merchantCPCID> <fromPostalCode>J0L 1N0</fromPostalCode> <itemsPrice>336.55</itemsPrice> <lineItems> <item> <quantity>1</quantity> <weight>0.608</weight> <length>0</length> <width>0</width> <height>0</height> <description>Online Order</description> </item> </lineItems> <city>Yellowknife</city> <provOrState>Northwest Territories</provOrState> <country>CA</country> <postalCode>X1A 2N2</postalCode> </ratesAndServicesRequest> </eparcel>
Response received
<?xml version="1.0"?> <!DOCTYPE eparcel [ <!-- EVERY REQUEST CONTAIN THE eparcel TAG --> <!ELEMENT eparcel (ratesAndServicesResponse)> <!-- ********************************************************* --> <!-- * Standard response for request for rates and services * --> <!-- ********************************************************* --> <!ELEMENT ratesAndServicesResponse (statusCode, statusMessage+, requestID, handling, language, product+, packing*, emptySpace*, shippingOptions, comment, nearestPostalOutlet*)> <!ELEMENT statusCode (#PCDATA)> <!ELEMENT statusMessage (#PCDATA)> <!ELEMENT requestID (#PCDATA)> <!ELEMENT handling (#PCDATA)> <!ELEMENT language (#PCDATA)> <!ELEMENT product (name, rate, shippingDate, deliveryDate, deliveryDayOfWeek, nextDayAM?, packingID)> <!ATTLIST product id CDATA #REQUIRED sequence CDATA #REQUIRED > <!ELEMENT name (#PCDATA)> <!ELEMENT rate (#PCDATA)> <!ELEMENT shippingDate (#PCDATA)> <!ELEMENT deliveryDate (#PCDATA)> <!ELEMENT deliveryDayOfWeek (#PCDATA)> <!ELEMENT nextDayAM (#PCDATA)> <!ELEMENT packingID (#PCDATA)> <!ELEMENT packing (packingID, box+)> <!ELEMENT box (name, weight, expediterWeight, length, width, height, packedItem+)> <!ELEMENT weight (#PCDATA)> <!ELEMENT expediterWeight (#PCDATA)> <!ELEMENT length (#PCDATA)> <!ELEMENT width (#PCDATA)> <!ELEMENT height (#PCDATA)> <!ELEMENT packedItem (quantity, description)> <!ELEMENT quantity (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT emptySpace (length, width, height, weight)> <!ELEMENT shippingOptions (insurance, deliveryConfirmation, signature, flexiblePaymentAvailable?)> <!ELEMENT insurance (#PCDATA)> <!ELEMENT deliveryConfirmation (#PCDATA)> <!ELEMENT signature (#PCDATA)> <!ELEMENT flexiblePaymentAvailable EMPTY> <!ELEMENT comment (#PCDATA)> <!-- ********************************************************* --> <!-- * 'nearestPostalOutlet' is optional and is returned * --> <!-- * only if the merchant profile has this option enabled * --> <!-- ********************************************************* --> <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo, distance, outletName, businessName, postalAddress, phoneNumber, businessHours+)> <!ELEMENT postalOutletSequenceNo (#PCDATA)> <!ELEMENT distance (#PCDATA)> <!ELEMENT outletName (#PCDATA)> <!ELEMENT businessName (#PCDATA)> <!ELEMENT postalAddress (addressLine+, postalCode, municipality, province?)> <!ELEMENT addressLine (#PCDATA)> <!ELEMENT postalCode (#PCDATA)> <!ELEMENT municipality (#PCDATA)> <!ELEMENT province (#PCDATA)> <!ELEMENT phoneNumber (#PCDATA)> <!ELEMENT businessHours (dayId, dayOfWeek, time)> <!ELEMENT dayId (#PCDATA)> <!ELEMENT dayOfWeek (#PCDATA)> <!ELEMENT time (#PCDATA)> ]> <eparcel> <ratesAndServicesResponse> <statusCode>1</statusCode> <statusMessage>OK</statusMessage> <requestID>2249259</requestID> <handling>0.0</handling> <language>0</language> <product id="1040" sequence="1"> <name>Priority</name> <rate>43.92</rate> <shippingDate>2015-05-15</shippingDate> <deliveryDate>2015-05-21</deliveryDate> <deliveryDayOfWeek>5</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="1030" sequence="2"> <name>Xpresspost</name> <rate>17.05</rate> <shippingDate>2015-05-15</shippingDate> <deliveryDate>2015-05-22</deliveryDate> <deliveryDayOfWeek>6</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="1020" sequence="3"> <name>Expedited</name> <rate>13.65</rate> <shippingDate>2015-05-15</shippingDate> <deliveryDate>2015-05-28</deliveryDate> <deliveryDayOfWeek>5</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <product id="1010" sequence="4"> <name>Regular</name> <rate>13.65</rate> <shippingDate>2015-05-15</shippingDate> <deliveryDate>2015-06-01</deliveryDate> <deliveryDayOfWeek>2</deliveryDayOfWeek> <nextDayAM>false</nextDayAM> <packingID>P_0</packingID> </product> <packing> <packingID>P_0</packingID> <box> <name>moyenne_1_24</name> <weight>0.688</weight> <expediterWeight>0.688</expediterWeight> <length>13.0</length> <width>13.0</width> <height>13.0</height> <packedItem> <quantity>1</quantity> <description>Online Order</description> </packedItem> </box> </packing> <shippingOptions> <insurance>No</insurance> <deliveryConfirmation>Yes</deliveryConfirmation> <signature>No</signature> </shippingOptions> <comment></comment> </ratesAndServicesResponse> </eparcel> <!--END_OF_EPARCEL--> 
 

AAA.png

Edited by Papirus39
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...