PHP, adding a key to an array to form a correct SOAP request

  arrays, php, request, soap

I’m trying to make a soap request.
As you can see from the example request, the tag CustomerReferences is reported twice.
In my original PHP request (that works) it’s present only the first tag with the type "CUSTOMER_REFERENCES"

I want to add the second one with the type P_O_NUMBER to an already existing array.

enter image description here

       $parcelinfo = array();
        $parcelinfo["1"] = array(
            'SequenceNumber' => 1 + 1,
            'GroupPackageCount' => 1,
            'Weight' => array(
                'Value' => 10,
                'Units' => 20
            ),
            'CustomerReferences' => array(
                'CustomerReferenceType' => 'CUSTOMER_REFERENCE',
                'Value' => 12345
            )
        );

Given this original array, if i do:

        $parcelinfo["1"][] = array(
            'CustomerReferences' => array(
                'CustomerReferenceType' => 'P_O_NUMBER',
                'Value' => "TESTSKU"
            )
        );

I get the picture below

enter image description here

How do i add that key to the existing account to comply to the example request?

Source: Ask PHP

LEAVE A COMMENT