diff --git a/src/documentation/50.php-sdk.md b/src/documentation/50.php-sdk.md index 40d8bb5c..943860b7 100644 --- a/src/documentation/50.php-sdk.md +++ b/src/documentation/50.php-sdk.md @@ -42,7 +42,7 @@ This example uses only the required methods to create a shipment and download its label. ```php -$consignment = (ConsignmentFactory::createByCarrierId(PostNLConsignment::CARRIER_ID)) +$consignment = (ConsignmentFactory::createByCarrierId(CarrierPostNL::ID)) ->setApiKey('api_key_from_backoffice') ->setReferenceIdentifier('order-146') ->setCountry('NL') @@ -66,13 +66,13 @@ $consignments->downloadPdfOfLabels(); It is possible to use multiple carriers. The following carriers are supported: -| ID | Name | Carrier class | Consignment class | -| --- | ------ | ----------------------------- | ------------------------------------- | -| 1 | PostNL | `Model\Carrier\CarrierPostNL` | `Model\Consignment\PostNLConsignment` | -| 2 | Bpost | `Model\Carrier\CarrierBpost` | `Model\Consignment\BpostConsignment` | -| 3 | DPD | `Model\Carrier\CarrierDPD` | `Model\Consignment\DPDConsignment` | -| 12 | UPS Standard | `Model\Carrier\CarrierUPSStandard` | `Model\Consignment\UPSStandardConsignment` | -| 13 | UPS Express Saver | `Model\Carrier\CarrierUPSExpressSaver` | `Model\Consignment\UPSExpressConsignment` | +| ID | Name | Carrier class | Consignment class | +| --- | ----------------- | -------------------------------------- | ------------------------------------------ | +| 1 | PostNL | `Model\Carrier\CarrierPostNL` | `Model\Consignment\PostNLConsignment` | +| 2 | Bpost | `Model\Carrier\CarrierBpost` | `Model\Consignment\BpostConsignment` | +| 3 | DPD | `Model\Carrier\CarrierDPD` | `Model\Consignment\DPDConsignment` | +| 12 | UPS Standard | `Model\Carrier\CarrierUPSStandard` | `Model\Consignment\UPSStandardConsignment` | +| 13 | UPS Express Saver | `Model\Carrier\CarrierUPSExpressSaver` | `Model\Consignment\UPSExpressConsignment` | You can query which carriers are available like this: @@ -308,7 +308,7 @@ Available options: and `signature`. - Set: `setInsurance(250)` (amount in EUR) - Get: `getInsurance()` -- `receipt code`: This option allows you to add the receipt code to a shipment. +- `receipt code`: This option allows you to add the receipt code to a shipment. This option is only available for NL shipments. The only option that is compatible with this option is `insurance`. - Set: `setReceiptCode(true)` - Get: `hasReceiptCode()` @@ -436,11 +436,13 @@ and `getLinkOfLabels()`, **or after** `fetchTrackTraceData()` on the collection $consignment = (new \MyParcelNL\Sdk\src\Model\Consignment\PostNLConsignment()); echo $consignment->getBarcodeURL('3SMYPA123456789', '2231JE', 'NL'); // Barcode , Postal code, Country ``` -##### Get Track & Trace history & URL + +##### Get Track & Trace history & URL The Track & Trace history and link become available **after calling** `fetchTrackTraceData()` on the `MyParcelCollection`. One shop: + ```php $consignments = MyParcelCollection::findMany([123456, 123457], 'API_KEY_SHOP1') ->fetchTrackTraceData(); // history + link now set @@ -452,6 +454,7 @@ foreach ($consignments as $consignment) { ``` Multiple shops: + ```php $consignments = (new MyParcelCollection()) ->merge(MyParcelCollection::findMany([111, 112], 'API_KEY_SHOP1')) @@ -506,7 +509,6 @@ use `findManyByReferenceIdentifier()`, `find()` or `findMany()`. For more information, see . - ### Create and save orders Start by creating an `OrderCollection` and setting your API key: @@ -1000,8 +1002,8 @@ $consignment // Track & Trace // History and link become available after fetchTrackTraceData() - ->getHistory() - ->getTrackTraceUrl() + ->getHistory() + ->getTrackTraceUrl() // Physical properties (digital stamps or non-EU shipments) ->getPhysicalProperties()