magento2 – How to modifiy order response Rest API magento 2

How i can modify order response only needed fields

Request url



    "items": [
            "adjustment_negative": 0,
            "adjustment_positive": 0,
            "base_adjustment_negative": 0,
            "base_adjustment_positive": 0,
            "base_currency_code": "USD",
            "base_discount_amount": 0,
            "base_discount_invoiced": 0,
            "base_discount_refunded": 0,
            "base_grand_total": 78.61,
            "base_discount_tax_compensation_amount": 0,
            "base_discount_tax_compensation_invoiced": 0,
            "base_discount_tax_compensation_refunded": 0,
            "base_shipping_amount": 5,
            "base_shipping_discount_amount": 0,
            "base_shipping_discount_tax_compensation_amnt": 0,
            "base_shipping_incl_tax": 5,
            "base_shipping_invoiced": 5,
            "base_shipping_refunded": 5,
            "base_shipping_tax_amount": 0,
            "base_shipping_tax_refunded": 0,
            "base_subtotal": 68,
            "base_subtotal_incl_tax": 73.61,
            "base_subtotal_invoiced": 68,
            "base_subtotal_refunded": 68,
            "base_tax_amount": 5.61,
            "base_tax_invoiced": 5.61,
            "base_tax_refunded": 5.61,
            "base_total_due": 0,
            "base_total_invoiced": 78.61,
            "base_total_invoiced_cost": 0,
            "base_total_offline_refunded": 78.61,
            "base_total_paid": 78.61,
            "base_total_refunded": 78.61,
            "base_to_global_rate": 1,
            "base_to_order_rate": 1,
            "billing_address_id": 2,
            "created_at": "2020-02-04 07:26:46",
            "customer_dob": "1973-12-15 00:00:00",
            "customer_email": "",
            "customer_firstname": "Veronica",
            "customer_gender": 2,
            "customer_group_id": 1,
            "customer_id": 1,
            "customer_is_guest": 0,
            "customer_lastname": "Costello",
            "customer_note_notify": 1,
            "discount_amount": 0,
            "discount_invoiced": 0,
            "discount_refunded": 0,
            "entity_id": 1,
            "global_currency_code": "USD",
            "grand_total": 78.61,
            "discount_tax_compensation_amount": 0,
            "discount_tax_compensation_invoiced": 0,
            "discount_tax_compensation_refunded": 0,
            "increment_id": "000000001",
            "is_virtual": 0,
            "order_currency_code": "USD",
            "protect_code": "c5830155c66b416658dada71ad825ede",
            "quote_id": 1,
            "shipping_amount": 5,
            "shipping_description": "Flat Rate - Fixed",
            "shipping_discount_amount": 0,
            "shipping_discount_tax_compensation_amount": 0,
            "shipping_incl_tax": 5,
            "shipping_invoiced": 5,
            "shipping_refunded": 5,
            "shipping_tax_amount": 0,
            "shipping_tax_refunded": 0,
            "state": "closed",
            "status": "closed",
            "store_currency_code": "USD",
            "store_id": 1,
            "store_name": "Main WebsitenMain Website StorenDefault Store View",
            "store_to_base_rate": 0,
            "store_to_order_rate": 0,
            "subtotal": 68,
            "subtotal_incl_tax": 73.61,
            "subtotal_invoiced": 68,
            "subtotal_refunded": 68,
            "tax_amount": 5.61,
            "tax_invoiced": 5.61,
            "tax_refunded": 5.61,
            "total_due": 0,
            "total_invoiced": 78.61,
            "total_item_count": 1,
            "total_offline_refunded": 78.61,
            "total_paid": 78.61,
            "total_qty_ordered": 1,
            "total_refunded": 78.61,
            "updated_at": "2020-02-04 07:26:52",
            "weight": 1,
            "items": [
                    "amount_refunded": 68,
                    "base_amount_refunded": 68,
                    "base_discount_amount": 0,
                    "base_discount_invoiced": 0,
                    "base_discount_refunded": 0,
                    "base_discount_tax_compensation_amount": 0,
                    "base_discount_tax_compensation_invoiced": 0,
                    "base_discount_tax_compensation_refunded": 0,
                    "base_original_price": 68,
                    "base_price": 68,
                    "base_price_incl_tax": 73.61,
                    "base_row_invoiced": 68,
                    "base_row_total": 68,
                    "base_row_total_incl_tax": 73.61,
                    "base_tax_amount": 5.61,
                    "base_tax_invoiced": 5.61,
                    "base_tax_refunded": 5.61,
                    "created_at": "2020-02-04 07:26:46",
                    "discount_amount": 0,
                    "discount_invoiced": 0,
                    "discount_percent": 0,
                    "discount_refunded": 0,
                    "free_shipping": 0,
                    "discount_tax_compensation_amount": 0,
                    "discount_tax_compensation_invoiced": 0,
                    "discount_tax_compensation_refunded": 0,
                    "is_qty_decimal": 0,
                    "item_id": 1,
                    "name": "Valeria Two-Layer Tank",
                    "no_discount": 0,


<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="MagentoSalesApiOrderRepositoryInterface">
        <plugin name="order_rest_api_response_change" type="CustomExtendedSalesPluginApiOrderRepository" />

i wrote plugin but i how i can modify Response data to only needed
fields for me?

c# – How can a TCP server application handle reconnects in response to stale connections?

The main loop of basic server looks like this currently:

            ConcurrentDictionary<EndPoint,Connection> connections = new ConcurrentDictionary<EndPoint, Monitor>();

            tcpListener = new TcpListener(IPAddress.Any, config.Port);
            while (true)
                var client = await tcpListener.AcceptTcpClientAsync();

    private void HandleNewConnection(TcpClient client)
        var key = client.Client.RemoteEndPoint;
        var connection = new Connection(client);
        connections(key) = connection;
        //run the connection client/server stuff, basically just Reads in a loop
        _ = connection.MonitorAsync();

There are two specific cases I want to handle:

  1. The connection is lost. This seems fairly easy, doing something like _ = connection.MonitorAsync().ContinueWith( () => connections.Remove(key) ?
  2. A new connection comes in from an existing client. TCP connections are not great at detecting faults unless you write to them, so it’s quite plausible a client could try to send data, detect a problem, drop the connection, and reconnect – and my server thinks the connection is still valid. The first it knows is a new connection comes in from a client it thinks is already connected.

In 2. it is conceptually quite simple that we look-up the existing connection from the same client endpoint, terminate it and store a Connection into connections.

But now if I’m not careful my continuation from 1. will kick in after 2, and remove the new element from the dictionary.

There must be a neat pattern but I keep tying myself in knots trying to figure it out. Servers must handle this situation all the time and need to be accurate not to accrue a huge pile of dead connection objects. What would be a normal way to handle this, other than a more stateless approach where Connections doesn’t exist?

Why is Trump’s response to the reports of Russia and bounties on US Troops the same as his response to COVID-19? “I take no responsibility”?

So many lies in one question.

President Trump’s response to the false reporting about the Russian bounties is to deny all the lies contained in it.  Good people should always denounce lies.  Why don’t liberals denounce lies?

People who are honest and truthful know you are also LYING about that being Trump’s response to COVID-19.  That was Trump’s response to questions about the missteps by the CDC in the creation of test kits.  This is because it is the CDC and not the office of the president which creates test kits.

Isn’t it time you grew up and stopped lying?

webcam – App is obscuring a permission request settings can’t verify your response, can’t turn off Overlay

I need to use DroidCam in my phone and PC, it’s an app that lets you use your phone cam as a webcam in your PC. Other programs don’t work. Since my internet connection is really slow I have to use it via USB. Since my phone screen is mostly not responsive I have installed a pointer type overlay that “draw over other apps”.

Because I have that app running, when I try to run DroidCam, it gives me the error message: “Because an app is obscuring a permissions request, Settings cannot verify your response”.

But I can’t disable my overlay, my mouse pointer, because then I wouldn’t be able to use my phone or run that app.

Anyone comes up with a solution?

rest – RESTful Response when the POST request results in the creation of different kind of resources?

I have been working on designing an API that lets client create a product (think of product as something like website domain, something that comes into existence when client makes order for it to the service). Correspondingly with every purchase results in creation of the order object. Which means creation of two resources via a single POST request.

So afaik, the RFC standards recommends sending 201 on resource creation with URI for the resource in the Location header. But in the above scenario, we are creating two resources, domains and orders and I would want response to contain information related to both the resources.

Response would look something similar to this

POST /domains/
 body: {"domain_name": ""},

 Body: {"order_id": "1234"}

But does not look very RESTful. I was wondering if there was a RESTful way to do this?

Build a SAML response from a sharepoint page

We have an requirement to build a SAML response from an SharePoint page. We require a SSO configured after the user click on link (hyperlink) on the SP page which would then redirect him/her to a external site were the user would do a SSO. We already have an SSO Url provided by the external company.

Could please advise how we can setup this ?

plugins – REST API can’t get the response manually

I am new at this. I don’t know what is the problem here i want to get data from External REST Api endpoint but getting NO URL was found meanwhile when i use same URL with postman i get the response with no problem.

enter image description here

and this is my code to get the data manually.

$stidStore_name = 'Foulad Online';
$stidCustomer_name = 'Emraan Khan';
$stidPaymen_type = 'cod';
$stidAmount = 10;
$stidCustomer_country = 'BH';

$requestUrl = ''.$stidStore_name.'&customer_name='.$stidCustomer_name.'&payment_type='.$stidPaymen_type.'&amount='.$stidAmount.'&customer_address='.$stidCustomer_country;
$request = new WP_REST_Request( 'POST', $requestUrl );

architecture – What’s the proper way to define response model for synchronization purpose when using microservices

I’m using a microservice architecture. when something went in one microservice I want to catch it in another microservice. To say briefly I have synchronization. But there I have one problem, I have a domain model with its own attributes and behavior, I would like to get that data in another microservice. Basically I’m just sending a request from one Microservice to another and I’m pulling some data, but to get this data I need to have the same model in both microservice.

I got two possible choices:

  1. To have two model one for Domain model and another for response a.k.a “DTO”. (Disadvantage: If I update something in the domain model I should update it in the DTO model.)
  2. To have a lot of atomic models for specific tasks. (Disadvantage: hard to maintain all of the models)

I’m looking for best practices for this specific decision.

response time – Dynamic Hosted vs. Statically Hosted Web’s Performance Metrics

As most of you might not get heard the term JAMstack, it’s getting common as it makes the development phase simpler. It makes a light paradigm shift for the platorms like WordPress to the headless CMS, so that allows their users to build their interfaces, independent from any backend architecture or relying on any backend framework.

Aside from it’s implementation with it’s technical considerations, has
any of you ever tested performances or any aspects on user experience
of the same sites while both statically and dynamically hosted?

It should be a rare situation to create exact same sites in most cases but apart from any specific technology, I’d learn if serving a static website has any advantages/disadvantages against dynamically hosted websites in terms of performance metrics?

rest api – Remove unwanted fields from WP API response

I am making a mobile app that links to a WordPress site. There are a lot of unwanted data from the API response and it would be great if I could remove it.
How could I do that without touching the PHP (I know nothing of it)? I am using React Native in the front end.

Is there a good plugin or query params in the URL to solve this?