NetSuite Rest API - Sales Order Refunds - netsuite

I am very new to netsuite, I am using NetSuite Api to get the sales order, In the sales order object, i can see almost all the information except refund. I don't see any refund object there. Is there different call to get the refunds?
Currently I am sending following request from postman
{{REST_SERVICES}}/record/v1/salesOrder/12274116?expandSubResources=true

I find it easier to query netsuite using the SUITESQL and then send a SQL query to run. ex:
URL/services/rest/query/v1/suiteql
and then just send a simple sql query:
select * from table
From that moment you can check the fields being returned and see the things a bit more easily.

Related

Shopify REST API: Paid+Fulfilled and fully Refunded orders not retrievable by filter (but can be by ID)

The requirement is to periodically download all newly fulfilled or refunded orders from Shopify using the REST API. This has been attempted using parameters for modified date and status. This is the endpoint, and documentation is here.
/admin/api/{{api_version}}/orders.json
However, orders which are in either of the following states seem to always be excluded from the results:
Payment Status=Paid & FulfillmentStatus=Fulfilled
Payment Status=Refunded
In the Shopify admin UI, these appear greyed out in the order list.
I don't think these orders have become archived because even very recent (today's) orders are excluded, and also they can be retrieved by order ID using this endpoint:
/admin/api/{{api_version}}/orders/{{order_id}}.json
Is there any way to incrementally query for orders in these states, i.e. without knowing the IDs?
How the inaccessible orders appear in the UI:
This is the answer: orders in the above 2 states have an overall status of "closed" (as opposed to "open" or "cancelled"). Closed orders appear greyed out in the UI.
When querying for orders via the List endpoint, you can specify a status parameter, but if you do not Shopify applies a default of "open", so closed orders are excluded. Specify status="closed" to access closed orders only, or status="any" to access all statuses.

How to use Power Virtual Agents and Power Automate to let a Bot write in a user's outlook-calendar

I have created an bot for microsoft teams with power virtual agents. This bot works fine and people can talk with it in ms teams and give the bot some information about dates. For example you could tell the bot a start-date and an end-date for days you aren't able to work.
With the authentification in teams the bot also knows the username and the id of the person, who is talking with it.
Now I like to create an automated flow, which the bot should trigger with the infos like username, userid, startdate and enddate, which should do the following steps:
open/find the specific user's calendar in outlook/teams (I'm pretty sure both use the same calendar)
create for each day in the range of startdate and enddate a (full-day) entry, which says "unavailable"
for each conflict with another meeting in entries of Step 2. cancel the meeting (for the user with username)
post a summary in a specific ms teams channel
I got Step 4 already working fine.
Step 2, I think I've figured out aswell, but with regard to my following problem at Step 1:
There is the template flow: Get calendar, which returns (all?) available calendars. And there is another flow template for creating entries in a specific calendar(Step 2 with option full-day entry), which needs the calendar ID to work.
My big problem is, how am I supposed to get the calendar ID of a specific user?
Is there a way to get the specific calendarID for a username or a userid?
And then what can I do about Step 3?
Thank you a lot for your help.
greets Vulnin
Using Graph API you can get User Calendar ID GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendar
Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The output of GET command in http returns raw JSON so, you have to parse JSON to use values.
For point 3 Only the organizer can cancel the meeting. Please refer to this document.
You can decline a meeting using Graph API request with POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline request.

Get list of emails and statuses of Campaigns

I'm using the node-mailjet api, and I'm trying to use it to get a list of email statuses for each marketing campaign.
If you go on a sent marketing campaign in Mailjet itself, there's a place where you can download a csv, the list of all contacts the campaign was sent to, and the status of each email ( delivered/opened/clicked/bounce/spam/ etc.)
So, using the API, I'm currently able to get a list of all the marketing campaigns, but I don't see a way of getting the same data as the csv I described above.
I've been looking at the documentation here, no luck so far.
You would have to use the /message resource in this case with a combination of some filters like the CampaignID one were you would give the Campaign for which you would like to check all the messages within.
That would give you an digest stats for all the messages generated by the Campaign. Within the response you would be able to see the Contact as well as the Status of the message, exactly like the CSV that you would download from front-end. You could also filter upon Status as well using the /message resource.
Here is the Reference to the resource along with all the available filters.

Externally hosted form and NetSuite Data

I have a page hosted on an external site and I would like to create a form on that page. The use of the form would be to collect data to create SO in Netsuite.
In the form itself, I would like to have an autopopulate functionality so that for e.g. when I put in "Kat" in End User contact, I see all contacts starting with "Kat". This will enable me to select a correct contact and also help prevent duplication of data. Can you please guide me on how to structure this flow. What Netsuite components should i be using? For the external site, it will use Django.
Thanks
You need to create a couple of RESTlets in NetSuite. One to perform a search to get the contacts and return them in the payload, and one to create sales order in NetSuite and populate it with the values provided in the payload.
How are you solving the issue with CORS?

How to access more than 10 products in Amazon mws via ListMatchingProducts API using node.js

I am using node.js(Meteor) for calling Amazon MWS ListMatchingProducts API for getting all products of my seller account . Its running sucessfully and i am getting the response , but as the documentation said that only ten(10) products are returned at one time. So i just want to know how we get products more than 10 . In the doc Amazon also said that you can submit NextToken with a "ByNextToken" operation to request additional pages.But i am not getting any nextToken or related to that nextToken field on my response.So how do i get the nextToken from there side or how can i get more than 10 products from that API. As i also check on one post they said that we need to use Reports for that but i want to use ListMatchingProducts API for that and want result more than 10.
Please provide me any suggestion or guidance how can i achieve that.
Any help would be appriciated
Thanks
You want to call the Reports API using the Inventory Report report type or one of the other Listing Report types. That is the way to go. The ListMatchingProductsoperation of the Products API is meant to be a search, based on a query. Yes, it only lists ten products but it does not give you a NextToken like some of the other operations. Knowing your Report Type and Marketplace ID, you can submit those to the Reports API with your credentials and get back all of your products all at once and there is no searching involved.
What I would also suggest is to use the Amazon Scratchpad to play around with your operations to make sure you get what you expect, then plug it into your node.js project.

Resources