Ubercart USPS error message - ubercart

I have shipping quotes with USPS enabled, and I turned on debugging information so I can receive the request/response information:
API=RateV3&XML=
<RateV3Request USERID="(Hidden)">
<Package ID="0">
<Service>ALL</Service>
<ZipOrigination>90038</ZipOrigination>
<ZipDestination>90024</ZipDestination>
<Pounds>1</Pounds>
<Ounces>0.0</Ounces>
<Container>RECTANGULAR</Container>
<Size>REGULAR</Size>
<Machinable>False</Machinable>
</Package>
</RateV3Request>
<?xml version="1.0"?>
<RateV3Response>
<Package ID="0">
<ZipOrigination>90038</ZipOrigination>
<ZipDestination>90024</ZipDestination>
<Pounds>1</Pounds>
<Ounces>0.0</Ounces>
<Size>REGULAR</Size>
<Machinable>FALSE</Machinable>
<Zone>1</Zone>
<Postage CLASSID="23">
<MailService>Express Mail Sunday/Holiday Guarantee</MailService>
<Rate>27.50</Rate>
</Postage>
<Postage CLASSID="25">
<MailService>Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee</MailService>
<Rate>30.00</Rate>
</Postage>
<Postage CLASSID="2">
<MailService>Express Mail Hold For Pickup</MailService>
<Rate>15.00</Rate>
</Postage>
<Postage CLASSID="27">
<MailService>Express Mail Flat-Rate Envelope Hold For Pickup</MailService>
<Rate>17.50</Rate>
</Postage>
<Postage CLASSID="3">
<MailService>Express Mail</MailService>
<Rate>15.00</Rate>
</Postage>
<Postage CLASSID="13">
<MailService>Express Mail Flat-Rate Envelope</MailService>
<Rate>17.50</Rate>
</Postage>
<Postage CLASSID="1">
<MailService>Priority Mail</MailService>
<Rate>4.95</Rate>
</Postage>
<Postage CLASSID="16">
<MailService>Priority Mail Flat-Rate Envelope</MailService>
<Rate>4.95</Rate>
</Postage>
<Postage CLASSID="28">
<MailService>Priority Mail Small Flat-Rate Box</MailService>
<Rate>4.95</Rate>
</Postage>
<Postage CLASSID="17">
<MailService>Priority Mail Regular/Medium Flat-Rate Boxes</MailService>
<Rate>10.35</Rate>
</Postage>
<Postage CLASSID="22">
<MailService>Priority Mail Large Flat-Rate Box</MailService>
<Rate>13.95</Rate>
</Postage>
<Postage CLASSID="4">
<MailService>Parcel Post</MailService>
<Rate>4.90</Rate>
</Postage>
<Postage CLASSID="5">
<MailService>Bound Printed Matter</MailService>
<Rate>2.33</Rate>
</Postage>
<Postage CLASSID="6">
<MailService>Media Mail</MailService>
<Rate>2.38</Rate>
</Postage>
<Postage CLASSID="7">
<MailService>Library Mail</MailService>
<Rate>2.26</Rate>
</Postage>
</Package>
</RateV3Response>
It looks like the response is fine, but I'm not getting an actual shipping quote on my page after asking it to calculate. Instead I get the error "There were problems getting a shipping quote. Please verify the delivery and product information and try again. If this does not resolve the issue, please call in to complete your order."
If anyone has any information why it would still show an error, I would appreciate the help.

Did you figure out a solution? I was getting a similar response and I was able to clear it up by selecting different shipping options. It seems in the usps shipping module the First Class Mail Parcel and the First Class Mail Flat options are set to values that don't correspond to shipping rates.
this is on a Drupal 6 site.

Related

Unable to add item on eBay API due to Item Specific Type missing

We are getting the following error when calling the eBay AddItemRequest API
The item specific Type is missing. Add Type to this listing, enter a valid value, and then try again.21919303
<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>XXXXXXXXXXX</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Title>test-800</Title>
<Description>test 800</Description>
<PrimaryCategory>
<CategoryID>176971</CategoryID>
</PrimaryCategory>
<StartPrice>200</StartPrice>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<ConditionID>1000</ConditionID>
<Country>US</Country>
<Currency>USD</Currency>
<DispatchTimeMax>3</DispatchTimeMax>
<ListingDuration>GTC</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
<PictureURL>https://eznetcrm.net/img/eZnetLogo.png</PictureURL>
</PictureDetails>
<PostalCode>32746</PostalCode>
<ProductListingDetails>
<UPC></UPC>
<BrandMPN>
<Brand>HP</Brand>
<MPN>845418-B21</MPN>
</BrandMPN>
<IncludeStockPhotoURL>true</IncludeStockPhotoURL>
<IncludePrefilledItemInformation>true</IncludePrefilledItemInformation>
<UseFirstProduct>true</UseFirstProduct>
<UseStockPhotoURLAsGallery>true</UseStockPhotoURLAsGallery>
<ReturnSearchResultOnDuplicates>true</ReturnSearchResultOnDuplicates>
</ProductListingDetails>
<Quantity>5</Quantity>
<ItemSpecifics>
<NameValueList>
<Name>Brand</Name>
<Value>HP</Value>
</NameValueList>
<NameValueList>
<Name>MPN</Name>
<Value>845418-B21</Value>
</NameValueList>
</ItemSpecifics>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSMedia</ShippingService>
<ShippingServiceAdditionalCost>0</ShippingServiceAdditionalCost>
<ShippingServiceCost>0</ShippingServiceCost>
</ShippingServiceOptions>
</ShippingDetails>
<Site>US</Site>
</Item>
</AddItemRequest>
We are trying to add an item using the above XML through eBay APIs but are unable to do so. What we are doing wrong in XML format? Also, we have added specific data as we got an error.
When adding ItemSpecifics, you will need to check if there are any ItemSpecific entries that are mandatory for your CategoryID. This can be checked from the GetCategorySpecifics API.
In your case, the category ID is 176971 and in the XML payload, there are two existing ItemSpecifics: Brand and MPN. As suggested by the error message you are getting and confirming from the GetCategorySpecifics API on eBay, it is evident that you need to add an ItemSpecific with the name Type within your ItemSpecifics. After doing that, your ItemSpecifics should look like this:
<ItemSpecifics>
<NameValueList>
<Name>Brand</Name>
<Value>HP</Value>
</NameValueList>
<NameValueList>
<Name>Type</Name>
<Value>CustomTypeNameHere</Value>
</NameValueList>
<NameValueList>
<Name>MPN</Name>
<Value>845418-B21</Value>
</NameValueList>
</ItemSpecifics>
You can verify the call using the VerifyAddItemResponse API once you add the Type ItemSpecific.
In general, to figure out what ItemSpecifics are needed for a given CategoryId, you can refer to the following documentation (Listing with Required Item Specifics. However, very briefly, to determine which item specifics are required, call GetCategorySpecifics to retrieve the item specifics recommendations for the category you're listing in. In the response, look for these fields for each recommendation:
This item specific name is required for the category: Recommendations.NameRecommendation.ValidationRules.MinValues
You can only use one of these values that eBay has defined (as returned in the response): Recommendations.NameRecommendation.ValidationRules.SelectionMode=SelectionOnly

Add Itinerary Remark SABRE

While i am sending Add Itinerary Remark in sabre FLIGHT API Request it's through Error (Business logic Error). Please Suggest me
<?xml version='1.0' encoding='utf-8'?>
<soap-env:Envelope xmlns:soap-env='http://schemas.xmlsoap.org/soap/envelope/'>
<soap-env:Header>
<eb:MessageHeader xmlns:eb='http://www.ebxml.org/namespaces/messageHeader'>
<eb:From>
<eb:PartyId eb:type='urn:x12.org.IO5:01'>sabre#example.com</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type='urn:x12.org.IO5:01'>webservices.sabre.com</eb:PartyId>
</eb:To>
<eb:ConversationId>1500986572sabre#example.com</eb:ConversationId>
<eb:Service eb:type='OTA'>Air</eb:Service>
<eb:Action>AddRemarkLLSRQ</eb:Action>
<eb:CPAID>IPCC</eb:CPAID>
<eb:MessageData>
<eb:MessageId>mid:1500986572sabre#example.com</eb:MessageId>
<eb:Timestamp>2017-07-25T12-42-52Z</eb:Timestamp>
<eb:TimeToLive>2017-07-25T12-42-52Z</eb:TimeToLive>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext'>
<wsse:UsernameToken>
<wsse:Username>USER</wsse:Username>
<wsse:Password>PASS</wsse:Password>
<Organization>IPCC</Organization>
<Domain>Default</Domain>
</wsse:UsernameToken>
<wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!-3250684970584119419!1379810!0</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<AddRemarkRQ xmlns='http://webservices.sabre.com/sabreXML/2011/10' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ReturnHostCommand='false' Version='2.1.0'>
<RemarkInfo>
<FOP_Remark>
<CC_Info>
<PaymentCard Code="VI" ExpireDate="2022-3" Number="4111111111111111" />
</CC_Info>
</FOP_Remark>
<Remark Type="General">
<Text>Swadesh Dash,nandan#gmail.com,8989852356</Text>
</Remark>
<Remark Type="Client Address">
<Text>Swadesh Dash,8989852356, nandan#gmail.com</Text>
</Remark>
</RemarkInfo>
</AddRemarkRQ>
</soap-env:Body>
</soap-env:Envelope>
Would help knowing what is the business error you got, but I see:
ExpireDate="2022-3" - I presume that it does not take 3 as month, it should be 03
In the other 2 remarks there # signs which likely are characters not supported in remarks.
For an improved response, please post the business error.
I can get only one possible reason and that is "Special Characters not allowed by Sabre"
And you have used # in remarks.
Special Characters which are not allowed are #,$,%,&,(,),[,],{,},<,>,?,=,+,;,Σ,_,' etc.

eBay CompleteSale API giving error in response

I am using the following xml for eBay CompleteSale API call:
<?xml version="1.0" encoding="utf-8"?>
<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$auth_token</eBayAuthToken>
</RequesterCredentials>
<ItemID>$itemId</ItemID>
<TransactionID>$transId</TransactionID>
<FeedbackInfo>
<CommentText> string </CommentText>
<CommentType>Positive</CommentType>
<TargetUser></TargetUser>
</FeedbackInfo>
<Shipped>1</Shipped>
<Paid>1</Paid>
<ListingType>Half</ListingType>
<Shipment>
<ShipmentTrackingDetails>
<ShipmentTrackingNumber>$trackingNo</ShipmentTrackingNumber>
<ShippingCarrierUsed>$carrier</ShippingCarrierUsed>
</ShipmentTrackingDetails>
<ShippedTime>$shippingDate</ShippedTime>
</Shipment>
<ErrorLanguage> string </ErrorLanguage>
<MessageID> string </MessageID>
<Version>889</Version>
<ErrorHandling>BestEffort</ErrorHandling>
<WarningLevel>Low</WarningLevel>
</CompleteSaleRequest>
When I run the script, the tracking number gets updated in the eBay correctly, but the response XML gives error:
<?xml version="1.0" encoding="UTF-8"?>
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2014-10-13T14:39:52.430Z</Timestamp>
<Ack>Failure</Ack>
<CorrelationID> string </CorrelationID>
<Errors>
<ShortMessage>Invalid shipment tracking number or carrier</ShortMessage>
<LongMessage>You have entered an incorrect shipment tracking number/carrier.</LongMessage>
<ErrorCode>2191111</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Tracking numbers invalid</ShortMessage>
<LongMessage>The following Tracking Numbers are invalid : TRACKING_NUMBER_VALUE.</LongMessage>
<ErrorCode>21916897</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorParameters ParamID="0">
<Value>TRACKING_NUMBER_VALUE</Value>
</ErrorParameters>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Internal error to the application.</ShortMessage>
<LongMessage>Internal error to the application.</LongMessage>
<ErrorCode>10007</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>An error occurred.</ShortMessage>
<LongMessage>An error number "{0}" occurred while processing your request.</LongMessage>
<ErrorCode>36</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>893</Version>
<Build>E893_CORE_APIXO_17070435_R1</Build>
</CompleteSaleResponse>
Why I am not getting the success in response?
The tracking Number is like: 1Z7X887R0368851221 and carrier is 'UPS'
Please help.
Thanks
Per eBay's own dev site:
Error 10007 ("Internal error to the application") indicates an error on the eBay server side, not an error in your application.
So you'd probably need to contact eBay about the specific issue, but my assumption is that while eBay will accept in any information into the Carrier and Tracking number fields, the format of the tracking number field must match some other critieria set by the carrier for inserting into another API upstream.
Have you tested the tracking number in UPS's own tracking mechanism? It returns a valid package tracking response?
Also, per the eBay dev site, if you are using UPS Mail Innovations rather than UPS, the carrier name to specifiy is UPS-MI.

eBay API call AddItem using item's UPC code

I want to add products using AddItem API call in eBay with UPC code. I have searched about it, but did not get any specific answer. I want to ask what will be the UPC code for item that will be added in to the eBay list.
Please help me.
Thanks & Regards
This is an old question, and surely you have moved on. But surprisingly no other related examples here on stackoverflow or at developer.ebay.com were to be found when I ran into a similar need with the eBay API AddFixedPriceItem (almost exactly identical to AddItem but aimed at non-auction listings). Here is the XML request structure that worked for me in POSTing to this API for UPC or ISBN coded products illustrated using the Verify version of the API:
<?xml version="1.0" encoding="utf-8"?>
<VerifyAddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>YOUR TOKEN STRING HERE</eBayAuthToken>
</RequesterCredentials>
<Item>
<AutoPay>false</AutoPay>
<Country>US</Country>
<Currency>USD</Currency>
<ListingType>FixedPriceItem</ListingType>
<ListingDuration>Days_30</ListingDuration>
<PaymentMethods>PayPal</PaymentMethods>
<PaymentMethods>VisaMC</PaymentMethods>
<PayPalEmailAddress>SELLER PAYPAL EMAIL ADDR HERE</PayPalEmailAddress>
<ProductListingDetails>
<UPC>BARCODE HERE</UPC>
<EAN>Does not apply</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
<UseStockPhotoURLAsGallery>true</UseStockPhotoURLAsGallery>
</ProductListingDetails>
<ShippingDetails>
<ShippingServiceOptions>
<ShippingService>USPSFirstClass</ShippingService>
<ShippingServiceCost currencyID="USD">3.00</ShippingServiceCost>
<ShippingServiceAdditionalCost>1.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSPriority</ShippingService>
<ShippingServiceCost currencyID="USD">5.00</ShippingServiceCost>
<ShippingServiceAdditionalCost>2.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>2</ShippingServicePriority>
</ShippingServiceOptions>
<ShippingType>Flat</ShippingType>
</ShippingDetails>
<ShipToLocations>US</ShipToLocations>
<Quantity>1</Quantity>
<Site>US</Site>
<StartPrice currencyID="USD">1.99</StartPrice>
<Title>YOUR GREAT ITEM TITLE</Title>
<Location>CITY,STATE HERE</Location>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
</PictureDetails>
<DispatchTimeMax>3</DispatchTimeMax>
<ReturnPolicy>
<RefundOption>MoneyBack</RefundOption>
<Refund>Money Back</Refund>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<ReturnsWithin>30 Days</ReturnsWithin>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<ReturnsAccepted>Returns Accepted</ReturnsAccepted>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
<ShippingCostPaidBy>Buyer</ShippingCostPaidBy>
</ReturnPolicy>
<ConditionID>EBAY CONDITION CODE</ConditionID>
<ConditionDisplayName>EBAY CONDITION DISPLAY TEXT</ConditionDisplayName>
</Item>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>Low</WarningLevel>
</VerifyAddFixedPriceItemRequest>
This is the VerifyAddFixedPriceItem call, which again is very very similar to the VerifyAddItem API. You can use the Verify version of either to check out that the request will be OK once debugged (just don't trust the fees either of them report even in production). The AddFixedPriceItem API adds the item to eBay using the UPC code only, via the eBay product catalog content. You can replace <UPC> and </UPC> with <ISBN> and </ISBN> for books as well. You could use this as an XML template for the VerifyAddItem and AddItem APIs as well.
Text in CAPS needs to be customized, the shipping prices are just random for illustration. I ran this using eBay Trading API version 1001 (as of this posting date you can ignore the warnings about no seller profile being in place). Also you can find the eBay condition codes and name text here: eBay Condition ID Values and Names
Hope this helps you or someone else that comes along with a similar need.

How to read values from a DB and use them with the SMTP connector in Mule 3

I would like to read some email details from the DB, and here's what my connector looks like:
<jdbc:connector name="dbConnector" dataSource-ref="dataSource">
<jdbc:query key="sqlQuery"
value="SELECT from, to, subject, body FROM email WHERE status='PENDING'" />
<jdbc:query key="sqlQuery.ack"
value="UPDATE email SET status='IN PROGRESS' WHERE id=#[map-payload:id]" />
</jdbc:connector>
I would then like to use those details to send a bunch of mails. I expect that the inbound-endpoint will be the JDBC Connector and the outbound-endpoint will be SMTP Connector, but I don't know how to store and use data I read from that table. Is there a way to do this without resorting to Java code?
Using transformers should be enough to achieve your goal: the inbound JDBC endpoint will give you a Map payload. From this payload you will extract the properties required by the outbound SMTP endpoint and the body of the message:
<!-- Set SMTP endpoint properties -->
<message-properties-transformer>
<add-message-property key="subject" value="#[map-payload:subject]"/>
...
</message-properties-transformer>
<!-- Set the message Body as new payload -->
<expression-transformer>
<return-argument evaluator="map-payload" expression="body"/>
</expression-transformer>