src/Shipment.php
public function transmitShipments(
        array $manifest_address,
        array $group_ids,
        array $options = []
    ) {
        $this->formatPostalCode($manifest_address['address-details']['postal-zip-code']);
        $content = [
            'group-ids' => [
                'group-id' => $group_ids,
            ],
            'requested-shipping-point' => $manifest_address['address-details']['postal-zip-code'],
            'cpc-pickup-indicator' => true,
            'detailed-manifests' => true,
            'manifest-address' => $manifest_address,
        ];

        if (!empty($options['option_codes'])) {
            $content['options']['option'] = $this->parseOptionCodes($options);
        }

        $xml = Array2XML::createXML('transmit-set', $content);
        $envelope = $xml->documentElement;
        $envelope->setAttribute(
            'xmlns',
            'http://www.canadapost.ca/ws/manifest-v8'
        );
        $payload = $xml->saveXML();

        $response = $this->post(
            "rs/{$this->customerNumber}/{$this->customerNumber}/shipment",
            [
                'Accept' => 'application/vnd.cpc.manifest-v8+xml',
                'Content-Type' => 'application/vnd.cpc.manifest-v8+xml',
            ],
            $payload,
            $options
        );
        return $response;
    }
public function transmitShipments(
        array $manifest_address,
        array $group_ids,
        array $options = []
    ) {
        $this->formatPostalCode($manifest_address['address-details']['postal-zip-code']);
        $content = [
            'group-ids' => [
                'group-id' => $group_ids,
            ],
            'requested-shipping-point' => $manifest_address['address-details']['postal-zip-code'],
            'cpc-pickup-indicator' => true,
            'detailed-manifests' => true,
            'manifest-address' => $manifest_address,
        ];

        if (!empty($options['option_codes'])) {
            $content['options']['option'] = $this->parseOptionCodes($options);
        }

        $xml = Array2XML::createXML('transmit-set', $content);
        $envelope = $xml->documentElement;
        $envelope->setAttribute(
            'xmlns',
            'http://www.canadapost.ca/ws/manifest-v8'
        );
        $payload = $xml->saveXML();

        $response = $this->post(
            "rs/{$this->customerNumber}/{$this->customerNumber}/shipment",
            [
                'Accept' => 'application/vnd.cpc.manifest-v8+xml',
                'Content-Type' => 'application/vnd.cpc.manifest-v8+xml',
            ],
            $payload,
            $options
        );
        return $response;
    }
public function transmitShipments ( array $ manifest_address , array $ group_ids , array $ options = [ ] ) { $ this -> formatPostalCode ( $ manifest_address [ 'address-details' ] [ 'postal-zip-code' ] ) ; $ content = [ 'group-ids' => [ 'group-id' => $ group_ids , ] , 'requested-shipping-point' => $ manifest_address [ 'address-details' ] [ 'postal-zip-code' ] , 'cpc-pickup-indicator' => true , 'detailed-manifests' => true , 'manifest-address' => $ manifest_address , ] ; if ( ! empty ( $ options [ 'option_codes' ] ) ) { $ content [ 'options' ] [ 'option' ] = $ this -> parseOptionCodes ( $ options ) ; } $ xml = Array2XML :: createXML ( 'transmit-set' , $ content ) ; $ envelope = $ xml -> documentElement ; $ envelope -> setAttribute ( 'xmlns' , 'http://www.canadapost.ca/ws/manifest-v8' ) ; $ payload = $ xml -> saveXML ( ) ; $ response = $ this -> post ( "rs/{$this->customerNumber}/{$this->customerNumber}/shipment" , [ 'Accept' => 'application/vnd.cpc.manifest-v8+xml' , 'Content-Type' => 'application/vnd.cpc.manifest-v8+xml' , ] , $ payload , $ options ) ; return $ response ; }
Transmit shipments for pickup by Canada Post.

@param array $manifest_address
The destination info.
<code>
$manifest_address = [
'manifest-company' => 'ACME Inc.',
'phone-number'     => '778 867 5309',
'address-details'  => [
'address-line-1'  => '123 Main St',
'city'            => 'Kelowna',
'prov-state'      => 'BC',
'country-code'    => 'CA',
'postal-zip-code' => 'V1X 1M2',
],
]
</code>
@param array $group_ids
The group IDs. The Transmit Shipments service will create a manifest
for each group. The manifest will list the shipments included in the
group.
@param array $options
The options to pass along to the Guzzle Client.

@see https://www.canadapost.ca/cpo/mc/business/productsservices/developers/services/shippingmanifest/transmitshipments.jsf
for all available options for the sender,destination and parcel params.
@return \DOMDocument
@throws \GuzzleHttp\Exception\GuzzleException
Transmit shipments for pickup by Canada Post .