### Search Shipments Example (GET Request)
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
Demonstrates how to search for shipments using query parameters like 'q' for general search and 'status' for filtering by shipment status. Includes example request headers and a sample JSON response.
```HTTP
GET https://api.myparcel.nl/shipments?q=Niels&status=1
User-Agent: CustomApiCall/2
Authorization: basic eUVJV1hFc3ZhMkxPeWRvVlM1bDVVZVJwamJNdVZQQXJSUGhFVkpCYw==
```
--------------------------------
### PickupOptionTime Object Example - JSON
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
Example JSON structure for a PickupOptionTime object, including start time, end time, price, and type. Demonstrates how to define a time slot for pickup options.
```json
{
"start": "08:00:00",
"end": "12:00:00",
"price": {
"currency": "EUR",
"amount": 1000
},
"price_comment": "morning",
"comment": "",
"type": 1
}
```
```json
{
"start": "16:00:00",
"type": 4,
"price": {
"amount": 0,
"currency": "EUR"
}
}
```
--------------------------------
### Retrieve Return Shipments (cURL - Command Line)
Source: https://github.com/myparcelnl/api/blob/gh-pages/interactive-examples/php/README.md
This example demonstrates how to retrieve a return shipment URL using cURL from the command line. It requires the cURL utility to be installed and configured on the system. The API key should be base64 encoded.
```bash
curl --request POST \
--url https://api.myparcel.nl/return_shipments \
--header 'Content-Type: application/json;charset=utf-8' \
--header 'Authorization: basic enter_your_base_64_encoded_api_key_here'
```
--------------------------------
### API Root Endpoint
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Example of a GET request to the API root, demonstrating a successful response.
```APIDOC
## GET /
### Description
Retrieves the API's status and title.
### Method
GET
### Endpoint
/
### Request Example
```
GET https://api.myparcel.nl/ HTTP/1.1
Host: api.myparcel.nl
User-Agent: CustomApiCall/2
Accept: application/json
```
### Response
#### Success Response (200)
- **title** (string) - The title of the API.
- **status** (string) - The status of the API (e.g., "OK").
#### Response Example
```json
{
"title":"MyParcel API",
"status":"OK"
}
```
```
--------------------------------
### DeliveryMoment Object Example
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
An example of the DeliveryMoment object, specifying the start and end date and time for a delivery window.
```json
{
"delivery_moment": {
"start": {
"date": "2019-02-19 17:15:00.000000",
"timezone_type": 3,
"timezone": "Europe/Amsterdam"
},
"end": {
"date": "2019-02-19 19:45:00.000000",
"timezone_type": 3,
"timezone": "Europe/Amsterdam"
}
}
}
```
--------------------------------
### Shipment Creation Examples
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Examples demonstrating various shipment configurations, including different service options and package types.
```APIDOC
## Shipment Creation Examples
### Description
This section provides examples of request bodies for creating shipments with different options.
### Method
POST
### Endpoint
/shipments
#### Request Body Examples
**Example a: Full options**
```json
{
"package_type": 1,
"only_recipient": 1,
"signature": 1,
"return": 1,
"insurance": {
"amount": 10000,
"currency": "EUR"
},
"large_format": 0,
"label_description": "My custom description",
"age_check":1
}
```
**Example b: Without age check and large format**
```json
{
"package_type": 1,
"only_recipient": 0,
"signature": 1,
"return": 0,
"insurance": {
"amount": 10000,
"currency": "EUR"
},
"label_description": "My custom description"
}
```
**Example c: Without label description and age check**
```json
{
"package_type": 1,
"only_recipient": 1,
"signature": 1,
"return": 1,
"insurance": {
"amount": 50000,
"currency": "EUR"
},
"large_format": 0
}
```
**Example d: Minimal options**
```json
{
"package_type": 1,
"only_recipient": 1,
"signature": 1,
"return": 1
}
```
**Example return shipment options**
```json
{
"package_type": 1,
"only_recipient": 0,
"signature": 1,
"return": 0,
"insurance": {
"amount": 10000,
"currency": "EUR"
}
}
```
**Example international shipment**
```json
{
"package_type": 1
}
```
**Example pickup**
```json
{
"package_type": 1,
"delivery_type": 4,
"delivery_date": "2017-01-12 16:30:00",
"only_recipient": 0,
"signature": 1,
"return": 0
}
```
```
--------------------------------
### MyParcel Full Return Page Example (HTML)
Source: https://github.com/myparcelnl/api/blob/gh-pages/interactive-examples/html/README.md
A complete, working HTML page example for creating a MyParcel return shipment button. Users need to insert their API key and can optionally customize button colors. This file can be directly uploaded to a webserver.
```html
MyParcel Return Shipment
Create Your Return Shipment
```
--------------------------------
### Address Examples
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Examples of address data structures for various countries and formats.
```APIDOC
## Address Data Examples
### Example a (NL)
```json
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"postal_code": "2132WT",
"person": "Mr. Parcel",
"phone": "0213030315",
"email": "parcel@myparcel.nl"
}
```
### Example b (NL with number suffix)
```json
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"number_suffix": "68",
"postal_code": "2132WT",
"person": "Mrs. Parcel",
"phone": "0213030315",
"email": "parcel@myparcel.nl"
}
```
### Example c (FR)
```json
{
"cc": "FR",
"region": "Seine",
"city": "Paris",
"street": "rue du Grenier-Saint-Lazare 22",
"person": "Claus Stuter",
"company": "Renault",
"email": "claus@paris.nl",
"postal_code": "75008",
"phone": "0033142723122"
}
```
### Example d (NL)
```json
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Zoetermeer",
"street": "Louiarmstrongrode",
"number": "18",
"postal_code": "2717NH",
"person": "Pato otap",
"phone": "0790880808",
"email": "pato@otap.nl"
}
```
### Example e (NL with company)
```json
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"person": "Jan Peter",
"company": "MyParcel B.V.",
"email": "janpeter@bedrijven.nl",
"phone": "0203030315"
}
```
### Example i (JP)
```json
{
"cc": "JP",
"region": "埼玉県",
"city": "さいたま市",
"street": "埼玉県さいたま市浦和区 常盤9-21-21",
"person": "Tanaka san",
"company": "さいたま国際キリスト教会",
"email": "saitamakyokai@gmail.com",
"phone": "0081-48-825-6637"
}
```
### Example CSV a
```json
{
"cc": "nl",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"person": "Claus Stuter",
"company": "MyParcel B.V.",
"email": "claus@stuter.nl",
"phone": "0203030315",
"postal_code": "124"
}
```
### Example CSV b
```json
{
"cc": "nl",
"postal_code": "2132WT",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"person": "Mrs. Parcel",
"company": "MyParcel",
"email": "parcel@myparcel.nl",
"phone": "0213030315"
}
```
### Example CSV c
```json
{
"cc": "nl",
"postal_code": "2132WT",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"person": "Arie Test",
"company": "MyParcel",
"email": "arie@myparcel.nl",
"phone": "0213030319"
}
```
```
--------------------------------
### DateTimeStartEnd Object Example
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
An example of the DateTimeStartEnd object, used for specifying date and timezone information.
```json
{
"date": "2019-02-19 17:15:00.000000",
"timezone_type": 3,
"timezone": "Europe/Amsterdam"
}
```
--------------------------------
### GET /example/national-shipment-a
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Retrieves an example national shipment's details, including sender and price information.
```APIDOC
## GET /example/national-shipment-a
### Description
This endpoint retrieves the details of an example national shipment, including recipient, sender, carrier, status, price, barcode, and timestamps.
### Method
GET
### Endpoint
/example/national-shipment-a
### Parameters
#### Query Parameters
- **reference_identifier** (string) - Optional - The reference identifier of the shipment to retrieve.
### Request Example
* (No request body or specific query parameters shown for this GET example, assume it's a simple GET request to the endpoint)*
### Response
#### Success Response (200)
- **reference_identifier** (string) - The reference identifier of the shipment.
- **recipient** (object) - Details of the shipment recipient.
- **cc** (string) - Country code.
- **region** (string) - Region or state.
- **city** (string) - City name.
- **street** (string) - Street name.
- **number** (string) - Street number.
- **postal_code** (string) - Postal code.
- **person** (string) - Name of the recipient person.
- **phone** (string) - Recipient's phone number.
- **email** (string) - Recipient's email address.
- **options** (object) - Shipping options.
- **package_type** (integer) - Type of package.
- **only_recipient** (integer) - Whether delivery is only to the recipient.
- **signature** (integer) - Whether a signature is required.
- **return** (integer) - Whether a return label is included.
- **insurance** (object) - Insurance details.
- **amount** (integer) - Insurance amount.
- **currency** (string) - Currency of the insurance amount.
- **large_format** (integer) - Whether it's a large format package.
- **sender** (object) - Details of the shipment sender.
- **cc** (string) - Country code.
- **region** (string) - Region or state.
- **city** (string) - City name.
- **street** (string) - Street name.
- **number** (string) - Street number.
- **postal_code** (string) - Postal code.
- **person** (string) - Name of the sender person.
- **phone** (string) - Sender's phone number.
- **email** (string) - Sender's email address.
- **carrier** (integer) - Identifier for the carrier.
- **status** (integer) - Status of the shipment.
- **price** (object) - Price information.
- **amount** (integer) - Price amount.
- **currency** (string) - Currency of the price.
- **barcode** (string) - The barcode of the shipment.
- **created** (string) - Timestamp when the shipment was created.
- **modified** (string) - Timestamp when the shipment was last modified.
#### Response Example
```json
{
"reference_identifier" : "FOO-222-BAR-42",
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"postal_code": "2132WT",
"person": "Mr. Parcel",
"phone": "0213030315",
"email": "testing@myparcel.nl"
},
"options": {
"package_type": 1,
"only_recipient": 1,
"signature": 1,
"return": 1,
"insurance": {
"amount": 50000,
"currency": "EUR"
},
"large_format": 0
},
"sender": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Amsterdam",
"street": "Dorpstraat",
"number": "123",
"postal_code": "1020BC",
"person": "Mrs. Parcel",
"phone": "02012343546",
"email": "info@myparcel.nl"
},
"carrier": 1,
"status": 1,
"price": {
"amount": 535,
"currency": "EUR"
},
"barcode": "3SMYPA77773333",
"created": "2017-01-31 08:00:00",
"modified": "2017-01-31 09:00:00"
}
```
```
--------------------------------
### Address Examples in JSON Format
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Multiple examples of address data in JSON format, showcasing different address structures including optional fields like number_suffix and company. These examples cover various countries and address formats.
```JSON
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"postal_code": "2132WT",
"person": "Mr. Parcel",
"phone": "0213030315",
"email": "parcel@myparcel.nl"
}
```
```JSON
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"number_suffix": "68",
"postal_code": "2132WT",
"person": "Mrs. Parcel",
"phone": "0213030315",
"email": "parcel@myparcel.nl"
}
```
```JSON
{
"cc": "FR",
"region": "Seine",
"city": "Paris",
"street": "rue du Grenier-Saint-Lazare 22",
"person": "Claus Stuter",
"company": "Renault",
"email": "claus@paris.nl",
"postal_code": "75008",
"phone": "0033142723122"
}
```
```JSON
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Zoetermeer",
"street": "Louiarmstrongrode",
"number": "18",
"postal_code": "2717NH",
"person": "Pato otap",
"phone": "0790880808",
"email": "pato@otap.nl"
}
```
```JSON
{
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"person": "Jan Peter",
"company": "MyParcel B.V.",
"email": "janpeter@bedrijven.nl",
"phone": "0203030315"
}
```
```JSON
{
"cc": "JP",
"region": "埼玉県",
"city": "さいたま市",
"street": "埼玉県さいたま市浦和区 常盤9-21-21",
"person": "Tanaka san",
"company": "さいたま国際キリスト教会",
"email": "saitamakyokai@gmail.com",
"phone": "0081-48-825-6637"
}
```
--------------------------------
### PickupOptions Object Example (JSON)
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
An example of the PickupOptions object, representing a PostNL pickup location with its address, opening hours, and geographical coordinates.
```json
{
"date": "2017-07-29",
"time": [
{
"start": "16:00:00",
"type": 4,
"price": {
"amount": 0,
"currency": "EUR"
}
}
],
"location": "KARIBOO C'EST LE BOUQUET",
"street": "RUE EMILE CLAUS",
"number": "58",
"postal_code": "1180",
"city": "UCCLE",
"cc": "BE",
"start_time": "16:00:00",
"price": 0,
"price_comment": "retail",
"comment": "",
"phone_number": "",
"opening_hours": {
"monday": [
"13:00-18:00"
],
"tuesday": [
[
"09:00-12:00",
"12:00-19:00"
]
],
"wednesday": [
[
"09:00-12:00",
"12:00-19:00"
]
],
"thursday": [
[
"09:00-12:00",
"12:00-19:00"
]
],
"friday": [
[
"09:00-12:00",
"12:00-20:00"
]
],
"saturday": [
[
"09:00-12:00",
"12:00-20:00"
]
],
"sunday": [
"10:00-16:00"
]
},
"distance": "983",
"latitude": "50.815598",
"longitude": "4.367427",
"location_code": "BE0T57",
"retail_network_id": "LD-01"
}
```
--------------------------------
### Address Examples in CSV Format
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Examples of address data in CSV format, demonstrating different structures including optional fields and variations in column order. These examples are useful for bulk address processing.
```CSV
{
"cc",
"city",
"street",
"number",
"person",
"company",
"email",
"phone",
"groups""124",
"nl",
"Hoofddorp",
"Siriusdreef",
"66",
"Claus Stuter",
"MyParcel B.V.",
"claus@stuter.nl",
"0203030315",
}
```
```CSV
{
"cc",
"postalcode",
"city",
"street",
"number",
"person",
"company",
"email",
"phone""nl",
"2132WT",
"Hoofddorp",
"Siriusdreef",
"66",
"Mrs. Parcel",
"MyParcel",
"parcel@myparcel.nl",
"0213030315"
}
```
```CSV
{
"nl",
"2132WT",
"Hoofddorp",
"Siriusdreef",
"66",
"Arie Test",
"MyParcel",
"arie@myparcel.nl",
"0213030319"
}
```
--------------------------------
### Shipment Search Response Example (JSON)
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
Provides an example of a successful JSON response when searching for shipments. It includes details of the shipment data, pagination information, and search result counts.
```JSON
{
"data": {
"search_results": {
"shipments": [
{
"id": 12345,
"reference_identifier": "FOO-222-BAR-42",
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Antareslaan",
"number": "31",
"postal_code": "2132JE",
"person": "Mr. Parcel",
"phone": "0233030315",
"email": "testing@myparcel.nl"
},
"options": {
"package_type": 1,
"only_recipient": 1,
"signature": 1,
"return": 1,
"insurance": {
"amount": 50000,
"currency": "EUR"
},
"large_format": 0
},
"sender": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Amsterdam",
"street": "Dorpstraat",
"number": "123",
"postal_code": "1020BC",
"person": "Mrs. Parcel",
"phone": "02012343546",
"email": "info@myparcel.nl"
},
"carrier_id": 1,
"status": 1,
"price": {
"amount": 535,
"currency": "EUR"
},
"barcode": "3SMYPA77773333",
"secondary_shipments": null,
"multi_collo_main_shipment_id": null,
"created": "2017-01-31 08:00:00",
"modified": "2017-01-31 09:00:00"
}
],
"page": 1,
"size": 30,
"results": 50
}
}
}
```
--------------------------------
### TrackTrace Object GET Example
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Example of a GET request for tracktrace information. It includes shipment details, recipient and sender addresses, package options, and delivery status.
```json
{
"data": {
"tracktraces": [
{
"shipment_id": 43393092,
"code": "I01",
"description": "Zending bezorgd",
"time": "2019-02-16 15:09:53",
"link_consumer_portal": "https://yoursubomain.myparcel.me/track-trace/3SMYPA126329191/2182KD/NL",
"link_tracktrace": "https://postnl.nl/tracktrace/?B=3SMYPA126329190&P=2182KD&D=NL&T=C&L=NL",
"recipient": {
"cc": "NL",
"postal_code": "2231je",
"city": "Hillegom",
"street": "Brouwerlaan",
"number": "12",
"number_suffix": "",
"person": "Elma Koen"
},
"sender": {
"cc": "NL",
"postal_code": "4337WV",
"city": "Middelburg",
"street": "Podium",
"number": "3",
"person": "Tamara Bosman",
"company": "Skin Jewelry",
"email": "tamluca@zeelandnet.nl",
"phone": "0118418888"
},
"options": {
"package_type": 1,
"only_recipient": 0,
"signature": 0,
"return": 0,
"insurance": {
"amount": 0,
"currency": "EUR"
},
"large_format": 0,
"cooled_delivery": 0,
"age_check": 0
},
"pickup": null,
"status": {
"current": 7,
"main": "delivered",
"final": true
},
"history": [],
"delivery_moment_type": "estimated",
"delivery_moment": {
"start": {
"date": "2019-02-19 17:15:00.000000",
"timezone_type": 3,
"timezone": "Europe/Amsterdam"
},
"end": {
"date": "2019-02-19 19:45:00.000000",
"timezone_type": 3,
"timezone": "Europe/Amsterdam"
}
}
}
]
}
}
```
--------------------------------
### GET National Shipment Example A (MyParcel API)
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
Example GET request response for a national shipment. It includes full shipment details such as recipient, sender, carrier, status, price, barcode, and timestamps for creation and modification.
```json
{
"reference_identifier": "FOO-222-BAR-42",
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Antareslaan",
"number": "31",
"postal_code": "2132JE",
"person": "Mr. Parcel",
"phone": "0233030315",
"email": "testing@myparcel.nl"
},
"options": {
"package_type": 1,
"only_recipient": 1,
"signature": 1,
"return": 1,
"insurance": {
"amount": 50000,
"currency": "EUR"
},
"large_format": 0
},
"sender": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Amsterdam",
"street": "Dorpstraat",
"number": "123",
"postal_code": "1020BC",
"person": "Mrs. Parcel",
"phone": "02012343546",
"email": "info@myparcel.nl"
},
"carrier": 1,
"status": 1,
"price": {
"amount": 535,
"currency": "EUR"
},
"barcode": "3SMYPA77773333",
"created": "2017-01-31 08:00:00",
"modified": "2017-01-31 09:00:00"
}
```
--------------------------------
### Create Return URL Usage Example (PHP)
Source: https://context7.com/myparcelnl/api/llms.txt
Demonstrates the creation of a return URL using the MyParcel integration. This method simplifies the process of generating a URL for initiating a return shipment. No specific parameters are required for this operation.
```php
// Create return URL
$returnUrl = $myparcel->createReturnUrl();
echo "Return URL: {$returnUrl}\n";
```
--------------------------------
### Get Webhook Subscription - HTTP Request
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
Example HTTP GET request to fetch active webhook subscriptions. Includes headers and URI parameters.
```http
GET https://api.myparcel.nl/webhook_subscriptions/12 HTTP/1.1
User-Agent: CustomApiCall/2
Authorization: basic eUVJV1hFc3ZhMkxPeWRvVlM1bDVVZVJwamJNdVZQQXJSUGhFVkpCYw==
```
--------------------------------
### MyParcel API - Introduction
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
General information about the MyParcel API, including its purpose, supported platforms, SDKs, sandbox, and test environment details.
```APIDOC
## MyParcel API Documentation
### Description
This document provides the API reference for MyParcel.nl, Flespakket, and SendMyParcel.be. The API is built to handle bulk operations efficiently and generally follows REST principles, using JSON for data exchange over HTTPS.
### Supported Platforms
- MyParcel.nl
- Flespakket
- SendMyParcel.be
### SDKs
For developers using PHP, C#, or Ruby, SDKs are available:
- PHP: [https://github.com/myparcelnl/sdk](https://github.com/myparcelnl/sdk)
- C#/.net: [https://github.com/janssenr/MyParcelApi.Net](https://github.com/janssenr/MyParcelApi.Net)
- Ruby: [https://github.com/paypronl/myparcel](https://github.com/paypronl/myparcel)
### Sandbox
A JavaScript checkout code is available for demonstrating delivery options to customers. A sandbox environment is provided for examples and easier integration: [https://myparcelnl.github.io/delivery-options/](https://myparcelnl.github.io/delivery-options/)
### Test Environment
Currently, there is no dedicated test environment. You can create an account to print labels, which will only be invoiced if actually sent. Note that 'Digital stamps/Digitale postzegel' (package_type 4) are charged immediately.
### Support
For help or to stay informed about new functionalities, join the Slack channel: [https://join.slack.com/t/myparcel-dev/shared_invite/enQtNDkyNTg3NzA1MjM4LWQ5MWE5MTQ3MDg4YjU5NzdjYjk0OTY1ZDJiYjU5YzJjNzk3Yzk3NGY0OWFkZDU4MDYwZDEyZDlhZTgzOWM1MjI
### Status
View current malfunctions or system status at: [status.myparcel.nl](https://status.myparcel.nl/)
### Last Adjustments
View recent changes: [https://github.com/myparcelnl/api/commits/](https://github.com/myparcelnl/api/commits/)
```
--------------------------------
### GET National Shipment Example B (MyParcel API - Partial Response)
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
Partial JSON response for a GET request of a national shipment. This snippet shows the 'recipient' object, which is a core part of shipment data retrieval.
```json
{
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Amsterdam",
"street": "Dorpstraat",
"number": "123",
"postal_code": "1020BC",
```
--------------------------------
### GET Example National Multi Collo Shipment
Source: https://github.com/myparcelnl/api/blob/gh-pages/index.html
This JSON object demonstrates a GET request for a national multi-collo shipment. It includes details for the main shipment and a secondary shipment, linked by 'multi_collo_main_shipment_id'. The structure shows nested recipient and sender information for both.
```json
{
"id": 12345,
"account_id": 1,
"shop_id": 1,
"shipment_type": 3,
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Antareslaan",
"number": "31",
"postal_code": "2132JE",
"person": "Mr. Parcel",
"phone": "0233030315",
"email": "testing@myparcel.nl"
},
"sender": {
"cc": "NL",
"postal_code": "2132JE",
"city": "Hoofddorp",
"street": "Antareslaan",
"number": "31",
"person": "Mrs. Parcel",
"company": "MyParcel",
"email": "testing@myparcel.nl",
"phone": "12345678"
},
"status": 1,
"options": {
"package_type": 1,
"label_description": "My custom description"
},
"reference_identifier": "FOO-222-BAR-42",
"transaction_status": "unpaid",
"barcode": null,
"price": {
"amount": 595,
"currency": "EUR"
},
"region": "NL",
"payment_status": "unpaid",
"carrier_id": 1,
"secondary_shipments": [
{
"id": 12346,
"account_id": 1,
"shop_id": 1,
"shipment_type": 3,
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Antareslaan",
"number": "31",
"postal_code": "2132JE",
"person": "Mr. Parcel"
},
"sender": {
"cc": "NL",
"postal_code": "",
"city": "Hoofddorp",
"street": "Antareslaan",
"number": "2132JE",
"person": "Frisby Test",
"company": "Test1",
"email": "test1@test.nl",
"phone": "12345678"
},
"status": 1,
"options": {
"package_type": 1,
"label_description": "My custom description"
},
"reference_identifier": null,
"transaction_status": "unpaid",
"price": {
"amount": 595,
"currency": "EUR"
},
"barcode": "",
"region": "NL",
"payment_status": "unpaid",
"carrier_id": 1,
"multi_collo_main_shipment_id": 12345
}
],
"multi_collo_main_shipment_id": 12345
}
```
--------------------------------
### POST /return_shipments - Create Return Shipment (Plain PHP)
Source: https://github.com/myparcelnl/api/blob/gh-pages/interactive-examples/php/README.md
This example shows how to create a return shipment using plain PHP without requiring the cURL extension. It utilizes `file_get_contents` and stream contexts.
```APIDOC
## POST /return_shipments (Plain PHP)
### Description
Creates a return shipment using plain PHP without the cURL extension. This method uses `file_get_contents` to send the POST request.
### Method
POST
### Endpoint
https://api.myparcel.nl/return_shipments
### Parameters
#### Headers
- **Authorization** (string) - Required - `basic `
- **Content-Type** (string) - Required - `application/json;charset=utf-8`
### Request Example
```php
array(
'header' => "Content-type: application/json;charset=utf-8\r\nAuthorization: basic enter_your_base_64_encoded_api_key_in==",
'method' => 'POST',
'content' => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo "";
var_dump($result);
echo "
";
?>
```
### Response
#### Success Response (200)
- **data** (object) - Contains shipment details.
- **download_url** (object) - Contains the URL for the return label.
- **link** (string) - The URL to the return label page.
#### Response Example
```json
{
"data": {
"download_url": {
"link": "https:\/\/backoffice.myparcel.nl\/retour\/8005ebb27d55425c5eaf2dff2fa41147"
}
}
}
```
```
--------------------------------
### POST /example/pickup-location
Source: https://github.com/myparcelnl/api/blob/gh-pages/1.0/index.html
Creates an example shipment with a specified pickup location.
```APIDOC
## POST /example/pickup-location
### Description
This endpoint creates an example shipment where the delivery is directed to a specific pickup location.
### Method
POST
### Endpoint
/example/pickup-location
### Parameters
#### Request Body
- **data** (object) - Required - Contains shipment data.
- **shipments** (array) - Required - An array of shipment objects.
- **recipient** (object) - Required - Details of the shipment recipient.
- **cc** (string) - Required - Country code.
- **region** (string) - Required - Region or state.
- **city** (string) - Required - City name.
- **street** (string) - Required - Street name.
- **number** (string) - Required - Street number.
- **postal_code** (string) - Required - Postal code.
- **person** (string) - Required - Name of the recipient person.
- **phone** (string) - Optional - Recipient's phone number.
- **email** (string) - Optional - Recipient's email address.
- **options** (object) - Optional - Shipping options.
- **package_type** (integer) - Optional - Type of package (e.g., 1 for standard).
- **delivery_type** (integer) - Required for pickup - Type of delivery (e.g., 4 for pickup).
- **delivery_date** (string) - Optional - Desired delivery date in 'YYYY-MM-DD HH:MM:SS' format.
- **only_recipient** (integer) - Optional - Whether delivery is only to the recipient (1 for yes, 0 for no).
- **signature** (integer) - Optional - Whether a signature is required upon delivery (1 for yes, 0 for no).
- **return** (integer) - Optional - Whether a return label is included (1 for yes, 0 for no).
- **pickup** (object) - Required for pickup shipments - Details of the pickup location.
- **postal_code** (string) - Required - Postal code of the pickup location.
- **street** (string) - Required - Street name of the pickup location.
- **city** (string) - Required - City of the pickup location.
- **number** (string) - Required - Street number of the pickup location.
- **location_name** (string) - Required - Name of the pickup location.
- **carrier** (integer) - Required - Identifier for the carrier.
### Request Example
```json
{
"data": {
"shipments": [
{
"recipient": {
"cc": "NL",
"region": "Zuid-Holland",
"city": "Hoofddorp",
"street": "Siriusdreef",
"number": "66",
"postal_code": "2132WT",
"person": "Mr. Parcel",
"phone": "0213030315",
"email": "testing@myparcel.nl"
},
"options": {
"package_type": 1,
"delivery_type": 4,
"delivery_date": "2015-07-12 00:00:00",
"only_recipient": 0,
"signature": 1,
"return": 0
},
"pickup": {
"postal_code": "2132BH",
"street": "Burgemeester van Stamplein",
"city": "Hoofddorp",
"number": "270",
"location_name": "Albert Heijn"
},
"carrier": 1
}
]
}
}
```
### Response
#### Success Response (200)
* **[Fields will vary based on API response, typically includes shipment ID or confirmation]**
#### Response Example
* (Example response not provided in source text)*
```