The TaxType code 'MOSS Spain 21%' cannot be used with account code '200' - xero-api

My UK-based application needs to create invoices using Xero's API. Some customers are in other EU countries, so I have to use a different VAT rate for them.
I've added a new Tax Rate called 'MOSS Spain 21%', with the Tax Type as 'MOSS Sales'.
When creating an invoice via the API using this tax rate I get the following validation exception:
The TaxType code MOSS Spain 21% does not exist or cannot be used for this type of transaction.
The TaxType code 'MOSS Spain 21%' cannot be used with account code '200'.
200 is the sales account, so should be fine. I can manually create an invoice in the Xero UI. It's just the API call that fails. Other invoices with the normal OUTPUT2 tax rate work.
I'm using the .NET Xero API: https://github.com/XeroAPI/Xero-Net

The TaxType code isn't the user displayed name (MOSS Spain 21%) but something like TAX001 .
I had to query the API's Tax Rates end point to find the correct code for my custom tax rate.

Related

Prestashop Multistore - local product attributes cost overwritten by default shop

My question is related to already solved issue where saving product in "All shops" context made prices in all shops the same no matter the currency. So if product in Poland would cost for example 100 PLN, then in Germany 100 EUR and in Great Britain 100 GBP. Link to this topic:
Prestashop Multistore - local store prices are overwritten with price from default shop
Anyways the provided solution doesn't cover this very same problem of product combinations additional costs. So I want to ignore those fields when saving product in "All shops" context.
Does anyone know how to solve it??
I achieved it by editing overriden Product.php (from /classes/Product.php) - funtion updateAttribute (around line 1800+). I took it's body, except return, into an if statement:
public function updateAttribute(...) {
if (Shop::getContext() == Shop::CONTEXT_SHOP){
// function body here
}
return true;
}
Now when saving product with combinations in "All shops", it's not updating product attributes (additional price, stock etc.) - those can only be saved in context of specific/selected shop.

Ebay API - How To Determine Shipping Locations From FindItemsByCategory?

I'm retrieving all used buy-it-now camera and lenses from
EBAY-AT, EBAY-CH, EBAY-DE, EBAY-ES, EBAY-FR, EBAY-FRBE, EBAY-GB, EBAY-IE, EBAY-IT, EBAY-NL, EBAY-NLBE, EBAY-PL and EBAY-US
My 'customers' will come from all over Europe and the United States
I want to show them products which offer delivery to their country regardless of which EBAY site it originates.
https://developer.ebay.com/DevZone/finding/CallRef/findItemsByCategory.html#findItemsByCategory
shipToLocations - An international location or region to which the seller is willing to ship the item. Only returned when the seller has specifically identified locations where she is willing to ship the given item. specified.
https://developer.ebay.com/DevZone/finding/CallRef/Enums/shipToLocationList.html
This lists the possible values for the shipToLocation
However the API calls all come back with 'Worldwide' for shipToLocation, however this is just not true as I checked some which say are ship to just UK, Europe or even collection only.
What other options are there?

Currency Code in Twitter Ads Business account

How can I get what currency code is set for twitter ads business account. I have gone through their api-documentation, but i don't seem to find any endpoint mentioning currency code.
On the Ads Getting Started guide, there is a section discussing Currency:
The type of a currency is identified using ISO-4217. This is a three-letter string like “USD” or “EUR”. The value of a currency is represented in micros. For USD, $5.50 is encoded as 5.50*1e6, or 5,500,000. To represent a “whole value”, you need to multiply the local micro by 1e6 (1_000_000) for all currencies.
Currency is associated with a funding instrument and can be programmatically queried using the Funding Instrument API endpoints.

how to set currency code in square payment gateway? and what types of currency it support.?

i have integrate payment gateway in my web application on PHP and i want to use CAD or GBP for currency so how to use that currency and what types of currency support it.
I have to set as below:
$request_body2 = array("amount_money" => array (
"amount" => (int)$total_ammount,
"currency" => "USD"
));`);
You can find all of Square's supported currencies here.
In order to charge a card in a specific currency, your location must support that currency. See Square's documentation on Charge for v2 in the section for amount_money.
The value of currency must match the currency associated with the business that is charging the card.
You can also only create locations for the country with which you had registered your Square account. So if you had registered in the US, you can only create US locations and process USD on your Square account.
If you're processing payments on behalf of other Square accounts (using OAuth), then you could process the payment in the currency that matches that Square account's country.

How can I use Stripe to delay charging a customer until a physical item is shipped?

I'm in the process of building an online marketplace which sells shippable goods. The site will be similar to Etsy, which will connect merchants with buyers.
I'd like to be able to charge a customer's card ONLY when an item is shipped by a merchant to avoid chargebacks and provide an Amazon-like payment experience. This will also help us avoid chargebacks and payment disputes in case a merchant is slow to ship or flakes out. In some cases, the goods will take more than 7 days to be custom manufactured and shipped out
Here's an example timeline:
1/1/2014 - Customer adds $75 worth of items to their cart and clicks "buy". Enters credit card info.
1/1/2014 - Customer's card is verified and a $75 temporary hold is placed on their card. Order is sent to merchant for fulfillment.
1/14/2014 - Merchant ships goods to customer and adds shipping tracking info
1/14/2014 - Customer's card is charged for the full amount and merchant receives $75 minus fees.
I plan to use Stripe Connect for payment processing, but am not sure how to delay capturing a payment for more than 7 days. Any thoughts? I don't want to aggregate the funds under my own account and use payouts since this will likely run afoul of money transmission laws. Any help would be appreciated!
EDIT: It looks like Quora has a similar question here , but the answers don't seem to deal with the case where a merchant ships out the item but the payment fails.
After further research, it seems there's no way to delay capturing a charge past the 7 day authorization window.
But here's one way to delay a charge:
Tokenize a credit card using the stripe.js library
Create a new stripe customer passing in the token as the "card" param
An example from the Stripe FAQ: https://support.stripe.com/questions/can-i-save-a-card-and-charge-it-later
Note that the longer you wait between tokenizing a card and actually charging it, the more likely your charge will be declined for various reasons (expired card, lack of funds, fraud, etc). This also adds a layer of complexity (and lost sales) since you'll need to ask a buyer to resubmit payment info.
I'd still like to confirm that a certain amount can be charged (like a "preauthorization"), but this lets me at least charge the card at a later date.
Celery has built a service to help you do this with Stripe. They are very easy to use, but note that they charge 2% per transaction.
actually you can save user token and pay later with tracking info
# get the credit card details submitted by the form or app
token = params[:stripeToken]
# create a Customer
customer = Stripe::Customer.create(
card: token,
description: 'description for payinguser#example.com',
email: 'payinguser#example.com'
)
# charge the Customer instead of the card
Stripe::Charge.create(
amount: 1000, # in cents
currency: 'usd',
customer: customer.id
)
# save the customer ID in your database so you can use it later
save_stripe_customer_id(user, customer.id)
# later
customer_id = get_stripe_customer_id(user)
Stripe::Charge.create(
amount: 1500, # $15.00 this time
currency: 'usd',
customer: customer_id
)
Stripe release a delay method to place a hold without charging. https://stripe.com/docs/payments/capture-later
<?php
require_once('stripe-php/init.php');
\Stripe\Stripe::setApiKey('your stripe key');
$token = $_POST['stripeToken'];
$stripeinfo = \Stripe\Token::retrieve($token);
$email = $stripeinfo->email;
$customer = \Stripe\Customer::create(array(
"source" => $token,
"email" => $email)
);
?>