From 682eb4f2ef21cb00d8d98790981831b6cf44379e Mon Sep 17 00:00:00 2001 From: markernst97 Date: Wed, 30 Aug 2023 16:00:47 +0200 Subject: [PATCH 1/4] feat(sdk): add documentation for order notes --- src/documentation/50.php-sdk.md | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/documentation/50.php-sdk.md b/src/documentation/50.php-sdk.md index 873da9fc..65f8ebb7 100644 --- a/src/documentation/50.php-sdk.md +++ b/src/documentation/50.php-sdk.md @@ -643,6 +643,41 @@ $orderCollection->push($order); $savedOrderCollection = $orderCollection->save(); ``` +### Adding order notes to an order + +It is possible to add notes to an order. These notes are visible in the backoffice. +A note can be either a customer note or a webshop note. A customer note is +always created in the checkout process and a webshop note can be created in the +admin panel of an e-commerce platform. + +To add a note to an order, simply create +an `OrderNote` and add it to an `OrderNoteCollection`. Then, save the collection +to our API. + +```php +use MyParcelNL\Sdk\src\Model\Fulfilment\OrderNote; +use MyParcelNL\Sdk\src\Collection\Fulfilment\OrderNoteCollection; + +$orderNoteCollection = new OrderNoteCollection(); +$orderNote = new OrderNote([ + 'orderUuid' => 'uuid_of_order', // You need the uuid generated by our API. + 'note' => 'This is a note', + 'author' => 'webshop', // This can be either 'webshop' or 'customer'. +]) + +$orderNoteCollection->push($orderNote); + +// This will send the order note to our API. Thanks to the uuid, the note will +// be placed in the correct order. +$savedOrderNoteCollection = $orderNoteCollection->save(); +``` + +::: note +Note: The uuid of an order can be found in the response of the `save` method of +the `OrderCollection`. Therefore, you need to save the order first before you +can add notes to it. +::: + ### Setting up webhooks You can use our webhooks to keep track of changes in shipments, labels and your From d7f26efcc4a198e88ca0044ed981a05386e2f5fa Mon Sep 17 00:00:00 2001 From: markernst97 Date: Wed, 30 Aug 2023 21:21:32 +0200 Subject: [PATCH 2/4] feat(sdk): add documentation for order notes --- src/documentation/50.php-sdk.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/documentation/50.php-sdk.md b/src/documentation/50.php-sdk.md index 65f8ebb7..2ee7a88f 100644 --- a/src/documentation/50.php-sdk.md +++ b/src/documentation/50.php-sdk.md @@ -646,8 +646,7 @@ $savedOrderCollection = $orderCollection->save(); ### Adding order notes to an order It is possible to add notes to an order. These notes are visible in the backoffice. -A note can be either a customer note or a webshop note. A customer note is -always created in the checkout process and a webshop note can be created in the +A note can be either a customer note or a webshop note. A webshop note can be created in the admin panel of an e-commerce platform. To add a note to an order, simply create From 16370c9f70f20b3e8f61d69f2d97dda1a4605526 Mon Sep 17 00:00:00 2001 From: markernst97 Date: Thu, 31 Aug 2023 11:12:09 +0200 Subject: [PATCH 3/4] refactor: line length --- src/documentation/50.php-sdk.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/documentation/50.php-sdk.md b/src/documentation/50.php-sdk.md index 2ee7a88f..317bd737 100644 --- a/src/documentation/50.php-sdk.md +++ b/src/documentation/50.php-sdk.md @@ -645,9 +645,9 @@ $savedOrderCollection = $orderCollection->save(); ### Adding order notes to an order -It is possible to add notes to an order. These notes are visible in the backoffice. -A note can be either a customer note or a webshop note. A webshop note can be created in the -admin panel of an e-commerce platform. +It is possible to add notes to an order. These notes are visible in the +backoffice. A note can be either a customer note or a webshop note. A webshop +note can be created in the admin panel of an e-commerce platform. To add a note to an order, simply create an `OrderNote` and add it to an `OrderNoteCollection`. Then, save the collection From e0e9b3f144bc7fbca422bd417d46298223e360bd Mon Sep 17 00:00:00 2001 From: markernst97 Date: Thu, 31 Aug 2023 16:29:11 +0200 Subject: [PATCH 4/4] fix: feedback --- src/documentation/50.php-sdk.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/documentation/50.php-sdk.md b/src/documentation/50.php-sdk.md index 317bd737..9702eaf0 100644 --- a/src/documentation/50.php-sdk.md +++ b/src/documentation/50.php-sdk.md @@ -645,13 +645,9 @@ $savedOrderCollection = $orderCollection->save(); ### Adding order notes to an order -It is possible to add notes to an order. These notes are visible in the -backoffice. A note can be either a customer note or a webshop note. A webshop -note can be created in the admin panel of an e-commerce platform. +It is possible to add notes to an order. These notes are visible in the backoffice. A note can be either a customer note or a webshop note. A webshop note can be created in the admin panel of an e-commerce platform. -To add a note to an order, simply create -an `OrderNote` and add it to an `OrderNoteCollection`. Then, save the collection -to our API. +To add a note to an order, simply create an `OrderNote` and add it to an `OrderNoteCollection`. Then, save the collection to our API. ```php use MyParcelNL\Sdk\src\Model\Fulfilment\OrderNote; @@ -672,9 +668,7 @@ $savedOrderNoteCollection = $orderNoteCollection->save(); ``` ::: note -Note: The uuid of an order can be found in the response of the `save` method of -the `OrderCollection`. Therefore, you need to save the order first before you -can add notes to it. +Note: The uuid of an order can be found in the response of the `save` method of the `OrderCollection`. Therefore, you need to save the order first before you can add notes to it. ::: ### Setting up webhooks