NetSuite SOAP API: Populate PurchaseOrderList on VendorBill record retrieval - soap

When using the NetSuite SOAP API I would like to retrieve the purchaseOrderList for a VendorBill record. The purchaseOrderList field is shown as a RecordRefList on this docs page, however that field doesn't populate on responses when performing a get to retrieve a vendorBill based on the internalId.
I've tried setting the bodyFieldsOnly header to false, hoping this would cause it to return all related fields, however this doesn't change the response.
Does anyone know how to force a RecordRefList field type to populate?

After searching through the docs online it seems that the purchaseOrderList property on the Vendor Bill is only used when updating the bill to associate it with Purchase Orders, it doesn't look like the property can be returned when retrieving Vendor Bill records. See this docs page under the 'Linking Purchase Orders to a Vendor Bill' section.
In order to retrieve the PO numbers associated with a Vendor Bills items and expenses I am retrieving them from the itemList and expenseList properties which are present on the Vendor Bill. If anyone knows of another way please feel free to comment or edit.

Related

Google Places API filter by "user_ratings_total" number or between range

I'm trying to figure out a way to filter Places API results by number of user ratings despite the rating score, I've done something like this but it doesn't makes a difference : https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=24.7588310%2C46.7330426&radius=10500&type=restaurant&user_ratings_total=15000&key=GOOGLE_API_KEY.
My actual goal is to have a result similar to (Example: Show list of restaurants with number or total ratings more than 1000 users and rating score with 4.5)
Your assistance is much appreciated.
I don't think the user_ratings_total is used liked that. It is only a value set for place details request and not a parameter itself. The parameter that usually uses it is the fields parameter for place detail request.
The docs says:
"Place Search requests and Place Details requests do not return the same fields. Place Search requests return a subset of the fields that are returned by Place Details requests."
This means that the reviews and ratings that are being returned on your sample request are just a common result from nearby search. In this case "a subset of the fields".
"To return one or more of these data fields for a place, make a Place Details request, pass a place ID, and specify which fields to return."
ref: Place Data Fields docs
A Place Details request looks like this: https://maps.googleapis.com/maps/api/place/details/output?parameters
And fields parameter can be added in this format: fields=user_ratings_total
In summary, user_ratings_total is not used to filter Nearby Search result, but it is used to get more total ratings of a user in a certain Place/POI using Place Details request.
I tried looking through the docs and I can't seem to find this feature on the Places API. So what you can do for now if your really want this feature, is to file a Feature Request on Google Issue Tracker and let it be reviewed by Google engineers if it is possible to be implemented on the API.

Adding Account Code filter to XeroInvoice API

We are creating a Salesforce API and only want to import Xero Invoices that relate to certain account codes. We don't want every Xero contact and Xero invoice in the system.
At present, we call a page of invoices and then loop over the line items in each invoice them and only insert the Invoices that contain the accound codes we are looking for.
This is not an efficient process. So I wanted to check with the XeroAPI gurus are there are any filters I can apply to the GET call?
Sorry but there's no way to filter invoices on any of the line item level attributes (account, tracking, item etc). You'll have to continue looping through them all.
If you're not doing so already, I'd advise using the if-modified-since header so you're only looping through what's changed since your previous call but you still need to do it for all invoices.

How to use "correctAction" and "correctInstitutionTransactionId" in Intuit's Customer Account Data API

My questions concern the Transaction data object in Intuit's Customer Account Data API.
I am not sure how to use the following fields (or even really what they mean):
correctAction: The documentation does mention that "replace" and "delete" are possible values, which leads me to think that the word "correct" is being used to mean "fix", not as in the opposite of "incorrect".
correctInstitutionTransactionId: The documentation does not provide any details on this field. My best guess is that this id is used in conjunction with the "correctAction" field. I do not know how.
How do I use these fields?

Customer Account Data Types of Categories seems out of date

https://developer.intuit.com/docs/0020_customeraccountdata/0005_service_features/0050_categorization
The schedule_c_categories listed here seems out of date. I see a lot more categories in my data than what is listed here.
For example, in my data, I see "Other Business Expenses", "Deductible Meals", etc...
Is there a more complete list of all schedule_c_categories intuit uses?
Also, while we are at it, is the regular category and sub-category list complete?
Thanks.
Please submit a support ticket - https://developer.intuit.com/Support/Incident

What is a good strategy for adding additional information in a GET query over REST?

Given that we provide a restful api that serves book entities listening at
/books
And a client can get a book at the usual
GET /books/{id}
Suppose that we want to begin offering discounts on books to only our most vigilant buyers. These buyers would be given a discount code, and that code will reduce the price of the book.
Thus, a generic response may be
GET /books/4
{"id":4, "price":"24.95"}
Where a response to a query with a discount code may be
GET /books/4
{"id":4, "price":"24.95", "yourPrice":"19.95"}
The back-end processing we can get figured out, but what is the best practice for a client submitting a discount code over a restful api?
Certain books will be eligible for discounts while others will not. Discounts will not be broad (20% off everything), but instead will map to a specific price for that particular code (or client/code combo).
We've considered:
kludging the url
GET /codes/{someCode}/books/{id}
Adding the code in a header value
Using a query string
GET /books?code=myCode
anything else?
EDIT: Our goal is not to implement single-use codes. Instead, these discount codes could be used some fixed number of times for some fixed set of books.
I like using query variables. I just looked at the RESTful Web Services book, my main reference in this area, and they say:
Use query variables only to suggest
arguments being plugged into an
algorithm... If two URIs differ only
in their query variables, it implies
they're the different sets of inputs
into the same underlying algorithm.
It seems to me your discount codes are inputs to a discounting algorithm.
Charles
If you're going to be submitting anything that's not idempotent, I would suggest using POST instead of GET. You wouldn't want a client to be able to use their code more than once.
Anything you add in the URL or header values are open to be intercepted, and possibly allowing other users to 'fake' their discount ID. 1 approach would be to introduce a new POST call, that will allow the ID to be encrypted with simple HTTPS. The POSTed data could be as simple as the discountID or customerID.
Added - Sorry Michael, you already said that :)
You can register the code in a table so when the user retrieves that book automatically returns that book with the proper discount, for example:
The user can add some code
POST /register/{code}
This will add an entry to a table {user} - {code} so when the user retrieves by
GET /books/{id}
will use that entry to apply the discount. I'm guessing that you already have some relation between {code}-{book} so wont get into that.