Is it possible to send an invoice number with an authorize.net refund request? - e-commerce

Is it possible to send the invoiceNumber field in an AIM XML refund request with Authorize.Net? I try some variations on how to do it based on the documentation, and I get errors like:
The element 'transactionRequest' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element
'invoiceNumber' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements
expected: 'authCode, refTransId, splitTenderId, order, lineItems, tax,
duty, shipping, taxExempt, poNumber, customer, billTo, shipTo,
customerIP, cardholderAuthentication, retail, transactionSettings,
userFields' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
The reason I ask is because I'd like to have my refunds tie back to their original transaction for reporting reasons. That way, I can search on an invoice number and find where the purchase record came in, along with each refund record, all of which would share the same invoice number. As is now, the Authorize.Net system shows me no way to match a given customer's original purchase with their refund.

Sorry for responding to an old post, but the above answer is not correct.
To have the invoice number associate with the transaction and appear in your Auth.net transaction logs, include the following bit of XML:
<order><invoiceNumber>123456</invoiceNumber></order>
See the schema https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd within <xs:complexType name="transactionRequestType"> to view the necessary order (because order does matter).
In the above example, it would go here:
<?xml version="1.0"?>
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>yourloginid</name>
<transactionKey>yourtransactionkey</transactionKey>
</merchantAuthentication>
<refId>15444549</refId>
<transactionRequest>
<transactionType>refundTransaction</transactionType>
<amount>5</amount>
<payment>
<creditCard>
<cardNumber>XXXX1111</cardNumber>
<expirationDate>122016</expirationDate>
</creditCard>
</payment>
<authCode>2165668159</authCode>
<order>
<invoiceNumber>123456</invoiceNumber>
</order>
</transactionRequest>
</createTransactionRequest>

Related

Show customer address from S.O. on delivery slip

In Odoo v15 I am trying to display customer address from Sales Order on delivery slip (report - printed document).
Customer and delivery address are not the same on sales order and on report when I print delivery slip by default it is showing me the same information for contact and delivery address. I tested this on runbot in v16 also - it is strange.
To solve this I inherited 'stock.report_delivery_document' and tried to replace div with name 'partner_header' inside of which should customer address display with this code:
<xpath expr="//div[#name='partner_header']" position="replace">
<span class="pt-5" t-esc="o.partner_id.name"/><br />
</xpath>
The code is giving me info from delivery address, not from Customer that is on Sales Order.
Please help - sorry if creating module is not the way to do it.
I found solution - in inherited "stock.report_delivery_document" I accessed customer address from related Sales Order using o.sale_id.partner_id
Here is the code - used contact widget to format it:
<div t-field="o.sale_id.partner_id" t-options-widget="'contact'"/>

eBay SDK - adding an item - error: No product found for ProductListingDetails. with EAN

I'm trying to add a product to eBay using the API.
Here's a snippet of the code:
<Item>
<Currency>GBP</Currency>
<Country>GB</Country>
<ListingDuration>Days_30</ListingDuration>
<PrimaryCategory>
<CategoryID>31413</CategoryID>
</PrimaryCategory>
<Location>GB</Location>
<StartPrice>42.79</StartPrice>
<Quantity>10</Quantity>
<ProductListingDetails>
<BrandMPN>
<Brand>Nourkrin</Brand>
<MPN>NRK-0033</MPN>
</BrandMPN>
<UPC>5707725100255</UPC>
<EAN>5707725100255</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
</ProductListingDetails>
eBay now requires the Brand, MPN, EAN and UPC however when I add these to my code, I get the error:
<ShortMessage>No product found for ProductListingDetails.<EAN> <5707725100255>. </ShortMessage>
I think this is because eBay is looking up the EAN in it's product database to see if it exits and is a known product.
If I remove the EAN I get the error:
<ShortMessage>No product found for ProductListingDetails.<EAN> <5707725100255>. </ShortMessage>
I guess because it's using the UPC, if I remove EAN and UPC I get the error:
<ShortMessage>No product found for ProductListingDetails.<BrandMPN> <, NRK0033>. </ShortMessage>
and..
<LongMessage>Required field, EAN, is missing. Please add EAN to the listing and retry.</LongMessage>
I've tried changing EAN and UPC to 'Does not apply'
<UPC>Does not apply</UPC>
<EAN>Does not apply</EAN>
but I get the error:
<ShortMessage>No product found for ProductListingDetails.<UPC> <Does not apply>. </ShortMessage>
the AddItem template on the sandbox API looks like this:
<ISBN> string </ISBN>
<UPC> string </UPC>
<EAN> string </EAN>
<BrandMPN><Brand> string </Brand>
<MPN> string </MPN>
</BrandMPN>
https://developer.ebay.com/devzone/xml/docs/Reference/ebay/AddItem.html
I've also tried removing <ListIfNoProduct>true</ListIfNoProduct> but it doesn't seem to make any difference.
I looked at this post too:
eBay SDK AddItem new ProductDetails EAN Requirements CANNOT List Or Revise
How can i get this product to list? What am I doing wrong?
I had a lot of problems with this, but what worked for me is: if you have UPC number then you have to pass "Does not apply" for EAN (but with EAN then pass empty string to UPC).
Do not pass a number to both fields as this always result in error.
So this should do:
<Item>
<Currency>GBP</Currency>
<Country>GB</Country>
<ListingDuration>Days_30</ListingDuration>
<PrimaryCategory>
<CategoryID>31413</CategoryID>
</PrimaryCategory>
<Location>GB</Location>
<StartPrice>42.79</StartPrice>
<Quantity>10</Quantity>
<ProductListingDetails>
<BrandMPN>
<Brand>Nourkrin</Brand>
<MPN>NRK-0033</MPN>
</BrandMPN>
<UPC>Does not apply</UPC>
<EAN>5707725100255</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
...
</ProductListingDetails>
<ItemSpecifics>
//add brand and mpn here as well
</ItemSpecifics>
Also eBay recommends putting Brand and MPN in <ItemSpecifics> tag as well. Sorry I'm working with C# API so I can't give you exact XML representation of it.
Hope this helps.
EDITED:
Checked and 5707725100255 is an EAN number not UPC. Edited my answer.

QuickBooks IPP Rest API 3.0 CustomerRef in Invoice

When I use the IPP Rest API 3.0 to create a invoice, a example like this:
<Invoice xmlns="http://schema.intuit.com/finance/v3">
<Line>
<Description>Installation labor</Description>
<Amount>420.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef>33</ItemRef>
</SalesItemLineDetail>
</Line>
<CustomerRef>20</CustomerRef>
</Invoice>
In this example, 20 is the Id of this customer.
Now, for a third party program, it might not know the Id of this customer, might know the Name of the customer, so , I understand I can always query the customer to get the Id back first, then use that Id in this invoice creating format.
But my question is, can I just use the name without specify the Id of this customer to create this invoice?
Will the following works?
<Invoice xmlns="http://schema.intuit.com/finance/v3">
<Line>
<Description>Installation labor</Description>
<Amount>420.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef>33</ItemRef>
</SalesItemLineDetail>
</Line>
<CustomerRef name="ACB Company"></CustomerRef>
</Invoice>
Further more, If it DOES work, does this logic apply to all the ReferenceType in the API?
No. In API payload, you can't refer objects by name ( this behavior was partially supported in old V2 API which is now deprecated ).
You can verify this behavior using Apiexplorer.
https://developer.intuit.com/apiexplorer?apiname=V3QBO
In this case, you should query the customer by name and then extract the ID to refer it in the invoice create payload.
Thanks

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.

Shopify: Is it possible to find a product by sku number?

The data that I'm getting only contains the SKU numbers. I am trying to figure out how I can link these SKU numbers to the product variants in Shopify without the actual product id number.
Example data:
<Inventory ItemNumber="100B3001-B-01">
<ItemStatus Status="Avail" Quantity="0" />
</Inventory>
<Inventory ItemNumber="100B3001-B-02">
<ItemStatus Status="Avail" Quantity="0" />
</Inventory>
<Inventory ItemNumber="100B3001-B-03">
<ItemStatus Status="Avail" Quantity="-1" />
<ItemStatus Status="Alloc" Quantity="1" />
</Inventory>
<Inventory ItemNumber="100B3001-B-04">
<ItemStatus Status="Avail" Quantity="-1" />
<ItemStatus Status="Alloc" Quantity="1" />
</Inventory>
Here's a delightful, condescending discussion from Shopify employees in 2011 asking why you can't just store the Shopify ID everywhere. The "stock-keeping unit" is a universal systems integration point and, in every system I've seen, each SKU uniquely maps to a product because words have meaning, but apparently not at Shopify.
Three years later, you seem to have two options.
One is to create a Fulfillment Service and provide a URL where Shopify will call you asking for stock levels on a SKU; this is probably the simplest solution, provided you have a Web server sitting somewhere where you can expose such a callback.
The second is to periodically page through all of the Products and store a mapping of the Shopify ID to a SKU somewhere, consulting your map when you need to do an update. Because most of our integrations are cron jobs and I'd like to keep them that way, I periodically ask for the products that have changed since the last run, and then update my mapping.
As David Lazar points out in his comment, the ability to find a product based on its SKU is not currently supported in the Shopify API.
EDIT: This is an unreliable option that I once used as a last resort. I wouldn't recommend using this but I will leave it here in case as someone may find it helpful.
You can use this API endpoint:
/admin/products/search.json?query=sku:abc123
I have only used it in the browser though, and I can't find any documentation for it. And it may stop working at any time.
You can use
*.myshopify.com/search?view=json&q=sku:SKUID
Graph query on Shopify works for me: