Skip to content

Commit

Permalink
Merge pull request #5 from jorisatabix/feature/ers
Browse files Browse the repository at this point in the history
Add ERS (Easy Return Service) support
  • Loading branch information
Soneritics authored Jul 28, 2020
2 parents 0653d7a + c836daf commit bea716b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Create an issue if you need help, or need more services than the ones provided.
| **Send & Track** |||
| Barcode webservice || 1_1 |
| Confirming webservice || 1_10 |
| Labelling webservice || 2_1 |
| Labelling webservice || 2_2* |
| Shippingstatus webservice || v2 |
| **Delivery options** |||
| Deliverydate webservice | X | N/A |
Expand All @@ -42,6 +42,8 @@ Create an issue if you need help, or need more services than the ones provided.
| **Checkout** |||
| Postalcode Check || 1 |

> *`v2_2` supports ERS labels
### Code example: Creating the API
Always start with creating the API object.
```php
Expand Down Expand Up @@ -256,3 +258,17 @@ $voormelding->addPakket($pakket);
$voormeldContents = $voormelding->genereerInhoud()
```

---
## ERS

### Using ERS

The product code for ERS labels is `4910`.

PostNL does not have documentation available for this product code, but you can use the documentation from product code `3085 Return label in the box` as a base.
There are additional things required for using ERS:
- The `CustomerCode` (4 letters) should have ERS enabled, or be ERS specific. Contact PostNL support for this.
- The `Addressses` of the `Customer` and `Shipment` all need to have a `name` filled in.
- The `ReturnBarcode` should be set.


2 changes: 1 addition & 1 deletion Soneritics/PostNL/Endpoints/Production.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Production extends Endpoints
{
public $Barcode = 'https://api.postnl.nl/shipment/v1_1';
public $Confirm = 'https://api.postnl.nl/shipment/v1_10';
public $Labelling = 'https://api.postnl.nl/shipment/v2_1';
public $Labelling = 'https://api.postnl.nl/shipment/v2_2';
public $Timeframe = 'https://api.postnl.nl/shipment/v2_1';
public $Locations = 'https://api.postnl.nl/shipment/v2_1/locations';
public $PostalCode = 'https://api.postnl.nl/shipment/checkout/v1';
Expand Down
6 changes: 4 additions & 2 deletions Soneritics/PostNL/Endpoints/Sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

namespace PostNL\Endpoints;

/**
* Sandbox endpoints
* Sandbox endpoints.
*
* @author Jordi Jolink <[email protected]>
*
* @since 27-5-2018
*/
class Sandbox extends Endpoints
{
public $Barcode = 'https://api-sandbox.postnl.nl/shipment/v1_1';
public $Confirm = 'https://api-sandbox.postnl.nl/shipment/v1_10';
public $Labelling = 'https://api-sandbox.postnl.nl/shipment/v2_1';
public $Labelling = 'https://api-sandbox.postnl.nl/shipment/v2_2';
public $Timeframe = 'https://api-sandbox.postnl.nl/shipment/v2_1';
public $Locations = 'https://api-sandbox.postnl.nl/shipment/v2_1/locations';
public $PostalCode = 'https://api-sandbox.postnl.nl/shipment/checkout/v1';
Expand Down

0 comments on commit bea716b

Please sign in to comment.