How to set shipping method using “cart_shipping.method” in magento api v1 - api

I want to set shipping method using "cart_shipping.method" but it's giving me fetal error. Error message is "Uncaught SoapFault exception: [1062] Shipping method is not available". I am using method like that
$result = $proxy->call($sessionId, 'cart_shipping.method', array(1402,'flatrate'));

I had the same problem because I was using test information which was not valid in the address call (cart_customer.addresses (SOAP V1) or shoppingCartCustomerAddresses (SOAP V2)).
So try a valid address which also works in the front end. For example, if you use the wrong country, magento will probably think: shipping is not available for this country. And then throw the 1062 error you experienced.
Maybe you had the same problem.
(btw I am using this as an example: https://magento.stackexchange.com/questions/6424/how-to-create-order-using-magento-web-services-in-php)

Related

Workflowmax client update endpoint giving 500 error

When I try to update the existing client with https://api.xero.com/workflowmax/3.0/client.api/update this endpoint, I am getting a 500 error without any details.client list and get endpoints working fine. I tried with one field update. That also failing. any suggestions for this?
Please can you raise a case with Xero (api#xero.com) and include the client id for your app, the tenant name, the time and date of the most recent error and the payload that you were sending.

Unable to POST NZ employee openingBalances to Xero?

I am attempting to create a single opening balances record against an existing employee but keep getting a 400 Bad Request response with this detail...
At least one NZ opening balance item is required in the request
I am following the instructions as per this documentation...
https://developer.xero.com/documentation/api/payrollnz/employeeopeningbalances#post-opening-balances
URL : {DestinationID} is properly replaced with the employee GUIDhttps://api.xero.com/payroll.xro/2.0/employees/{DestinationID}/openingBalances
JSON Body[{"periodEndDate":"2011-01-30T00:00:00","daysPaid":5.00,"unpaidWeeks":0.00,"grossEarnings":1442.31}]
The Xero forums and support is pretty unreliable so I'm posting here in the hopes for a better response.
After some trial and error using the API Explorer that Xero provides I was able to get it working using their example....
I eventually learned that daysPaid and unpaidWeeks must both be integer whole numbers or else it fails.... The error message provided is misleading but this resolves the problem.

How to add parameters to API calls?

I'm using CareerBuilder's API:
http://api.careerbuilder.com/Search/jobsearch/jobsearchinfo.aspx
In the description, the endpoint is:
http://api.careerbuilder.com/v1/jobsearch
As the developer key is necessary, I assume that the key should insert after v1 with a ?, as follows:
http://api.careerbuilder.com/v1?DeveloperKey=XXXXXXXXXXXXXXXX/jobsearch
Then, if I put this into a browser, it should return me the XML as the output.
When I have done this, the page gave me 404 errors.
How does this type of API works? I assume it works like Google APIs
I eventually solve this by adding parameters at the end of the endpoint URL...
http://api.careerbuilder.com/v1/jobsearch?DeveloperKey=XXXXXXXXXXXXXXXX&ID=YYYYY

I am trying to use Yodlee/executeUserSearchRequest as a RESTful request and need an answer on how to call

I am working with the Yodlee services in c# and using the RESTful api. So far I have successfully connected and logged in with my CobrandSession and UserSessionToken in the development environment. I used the sample apps provided in c# and with some advice from shreyans i got an app working. What I got working was
1) Get YodleeAuthentication
2) Get UserAuthentication
3) Get ItemSummaries
I am now trying to get the full transaction details for each of the Items (i.e. collections of accounts that are an Item)
reading the Docs here https://developer.yodlee.com/Indy_FinApp/Aggregation_Services_Guide/REST_API_Reference/executeUserSearchRequest it states that I need to call executeUserSearchRequest and then paginate through the results using the getUserTransactions. So I am stuck at this point. I dont really want a search which has parameters I just want ALL transactions for this account that I can see.
However, I am using the variables as defined in that page :-
var request = new RestRequest("/jsonsdk/TransactionSearchService/executeUserSearchRequest", Method.POST);
request.AddParameter("cobSessionToken", param.CobSessionToken);
request.AddParameter("userSessionToken", param.UserSessionToken);
request.AddParameter("transactionSearchRequest.containerType", param.ContainerType);
request.AddParameter("transactionSearchRequest.higherFetchLimit", param.HigherFetchLimit);
request.AddParameter("transactionSearchRequest.lowerFetchLimit", param.LowerFetchLimit);
request.AddParameter("transactionSearchRequest.resultRange.endNumber", param.EndNumber);
request.AddParameter("transactionSearchRequest.resultRange.startNumber", param.StartNumber);
request.AddParameter("transactionSearchRequest.searchFilter.currencyCode", param.CurrencyCode);
request.AddParameter("transactionSearchRequest.searchFilter.postDateRange.fromDate", param.FromDate);
request.AddParameter("transactionSearchRequest.searchFilter.postDateRange.toDate", param.ToDate);
request.AddParameter("transactionSearchRequest.searchFilter.transactionSplitType.splitType", param.SplitType);
request.AddParameter("transactionSearchRequest.ignoreUserInput", param.IgnoreUserInput);
request.AddParameter("transactionSearchRequest.searchFilter.itemAcctId", param.ItemAcctId);
var response = RestClientUtil.GetBase().Execute(request);
var content = response.Content;
return new YodleeServiceResultDto(content);
As per the response from shreyans in this posting Getting Error "Any one of [**] of transactionSearchFilter cannot be NULL OR Invalid Values I am not putting in the ClientId and the ClientName
The documentation doesn't specify the format of the dates but the example seems to tell me that its american date format. And specifies a parameter saying IgnoreUserinput, but doesnt have a parameter for user input so this is confusing
When I make a call using this format I get an error response
var getSearchResult = yodleeExecuteUserSearchRequest.Go(yodleeExecuteUserSearchRequestDto);
getSearchResult.Result="
{"errorOccured":"true","exceptionType":"Exception Occured","refrenceCode":"_60ecb1d7-a4c4-4914-b3cd-49182518ca5d"}"
But I get no error message in this and I have no idea what I have done wrong or where to look up this error, can somebody who has used Yodlee REST Api point me in the right direction as I need to get this researched quickly....
thanks your your help, advice, corrections and pointers....
Here is the list of parameters which you can try
1) For a specific ItemAccountId all transactions
transactionSearchRequest.containerType=all
transactionSearchRequest.higherFetchLimit=500
transactionSearchRequest.lowerFetchLimit=1
transactionSearchRequest.resultRange.startNumber=1
transactionSearchRequest.resultRange.endNumber=500
transactionSearchRequest.searchClients.clientId=1
transactionSearchRequest.searchClients.clientName=DataSearchService
transactionSearchRequest.searchFilter.currencyCode=USD
transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
transactionSearchRequest.ignoreUserInput=true
transactionSearchRequest.ignoreManualTransactions=false
transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
transactionSearchRequest.searchFilter.itemAccountId.identifier=10000353
2) For a Specific account (itemAccountId) with start and end dates
transactionSearchRequest.containerType=all
transactionSearchRequest.higherFetchLimit=500
transactionSearchRequest.lowerFetchLimit=1
transactionSearchRequest.resultRange.startNumber=1
transactionSearchRequest.resultRange.endNumber=500
transactionSearchRequest.searchClients.clientId=1
transactionSearchRequest.searchClients.clientName=DataSearchService
transactionSearchRequest.searchFilter.currencyCode=USD
transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
transactionSearchRequest.ignoreUserInput=true
transactionSearchRequest.ignoreManualTransactions=false
transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
transactionSearchRequest.searchFilter.itemAccountId.identifier=10000353
transactionSearchRequest.searchFilter.postDateRange.fromDate=08-01-2013
transactionSearchRequest.searchFilter.postDateRange.toDate=10-31-2013

Order creation via API fails in Magento

I am getting a rather strange error when trying to create a new order via the Magento API V1.0. Here is the basic workflow of my code:
Create shopping cart using the cart.create method.
Set a customer as 'guest' using the cart_customer.set method.
Add products to cart using the cart_product.add method.
Create the order using the cart.order method.
At this point, the cart.order method throws a SoapFault exception with the message "Call to a member function setFinalPrice() on a non-object". The same exception is thrown if I replace the cart.order method with other methods such as cart.info or cart_product.list.
Since the exception's message does not seem very descriptive, I was wondering if anybody else has ever bumped into this.
Thanks.
UPDATE: The problem is due to the fact that I am adding products to the cart using their SKUs when calling the cart_product.add method. The exception is no longer thrown when using product IDs instead of SKUs (I suspect this could be a bug). However, at this point the cart.order method returns false, so the order is still not created.
Before you do cart.order method, you must assign the payment and shipping address to your cart.
it's standard procedure to create an order in magento.
the steps should be like this :
Create shopping cart using the cart.create method.
Set a customer as 'guest' using the cart_customer.set method.
Add products to cart using the cart_product.add method.
try to call
cart_shipping.method and cart_payment.method before you call cart.order
Create the order using the cart.order method.