An open API service indexing awesome lists of open source software.

https://github.com/zvps/royal-mail-click-drop-rest-api-client

Royal Mail Click and Drop PHP REST API Client https://api.parcel.royalmail.com/
https://github.com/zvps/royal-mail-click-drop-rest-api-client

Last synced: about 1 year ago
JSON representation

Royal Mail Click and Drop PHP REST API Client https://api.parcel.royalmail.com/

Awesome Lists containing this project

README

          

# SwaggerClient-php
Import your orders, retrieve your orders and generate labels.

This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 1.0.0
- Build package: io.swagger.codegen.languages.PhpClientCodegen

## Requirements

PHP 5.5 and later

## Installation & Usage
### Composer

To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:

```
{
"repositories": [
{
"type": "git",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
```

Then run `composer install`

### Manual Installation

Download the files and include `autoload.php`:

```php
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
```

## Tests

To run the unit tests:

```
composer install
./vendor/bin/phpunit
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```php
setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RoyalMail\ClickAndDrop\Rest\Api\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new RoyalMail\ClickAndDrop\Rest\Api\LabelsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$orderIdentifiers = "orderIdentifiers_example"; // string | Order Identifier or several Order Identifiers separated by semicolon
$documentType = "documentType_example"; // string | Document generation mode. When documentType is set to \"postageLabel\" the additional parameters below must be used. These additional parameters will be ignored when documentType is not set to \"postageLabel\"
$includeReturnsLabel = true; // bool | Include returns label. Required when documentType is set to 'postageLabel'
$includeCN = true; // bool | Include CN22/CN23 with label. Optional parameter. If this parameter is used the setting will override the default account behaviour specified in the \"Label format\" setting \"Generate customs declarations with orders\"

try {
$result = $apiInstance->getOrdersLabelAsync($orderIdentifiers, $documentType, $includeReturnsLabel, $includeCN);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LabelsApi->getOrdersLabelAsync: ', $e->getMessage(), PHP_EOL;
}

?>
```

## Documentation for API Endpoints

All URIs are relative to *https://api.parcel.royalmail.com/api/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*LabelsApi* | [**getOrdersLabelAsync**](docs/Api/LabelsApi.md#getorderslabelasync) | **GET** /orders/{orderIdentifiers}/label | Return a single PDF file with generated label and/or associated document(s)
*OrdersApi* | [**createOrdersAsync**](docs/Api/OrdersApi.md#createordersasync) | **POST** /orders | Create orders
*OrdersApi* | [**getOrdersAsync**](docs/Api/OrdersApi.md#getordersasync) | **GET** /orders/{orderIdentifiers} | Retrieve orders
*OrdersApi* | [**getOrdersWithDetailsAsync**](docs/Api/OrdersApi.md#getorderswithdetailsasync) | **GET** /orders/{orderIdentifiers}/full | Retrieve orders details
*VersionApi* | [**getVersionAsync**](docs/Api/VersionApi.md#getversionasync) | **GET** /version | Get API version details.

## Documentation For Models

- [AddressRequest](docs/Model/AddressRequest.md)
- [BillingDetailsRequest](docs/Model/BillingDetailsRequest.md)
- [CreateOrderErrorResponse](docs/Model/CreateOrderErrorResponse.md)
- [CreateOrderRequest](docs/Model/CreateOrderRequest.md)
- [CreateOrderResponse](docs/Model/CreateOrderResponse.md)
- [CreateOrdersRequest](docs/Model/CreateOrdersRequest.md)
- [CreateOrdersResponse](docs/Model/CreateOrdersResponse.md)
- [DimensionsRequest](docs/Model/DimensionsRequest.md)
- [ErrorResponse](docs/Model/ErrorResponse.md)
- [FailedOrderResponse](docs/Model/FailedOrderResponse.md)
- [GetOrderDetailsResource](docs/Model/GetOrderDetailsResource.md)
- [GetOrderInfoResource](docs/Model/GetOrderInfoResource.md)
- [GetOrderLineResult](docs/Model/GetOrderLineResult.md)
- [GetPostalDetailsResult](docs/Model/GetPostalDetailsResult.md)
- [GetShippingDetailsResult](docs/Model/GetShippingDetailsResult.md)
- [GetTagDetailsResult](docs/Model/GetTagDetailsResult.md)
- [GetVersionResource](docs/Model/GetVersionResource.md)
- [LabelGenerationRequest](docs/Model/LabelGenerationRequest.md)
- [OrderFieldResponse](docs/Model/OrderFieldResponse.md)
- [PostageDetailsRequest](docs/Model/PostageDetailsRequest.md)
- [ProductItemRequest](docs/Model/ProductItemRequest.md)
- [RecipientDetailsRequest](docs/Model/RecipientDetailsRequest.md)
- [SenderDetailsRequest](docs/Model/SenderDetailsRequest.md)
- [ShipmentPackageRequest](docs/Model/ShipmentPackageRequest.md)
- [TagRequest](docs/Model/TagRequest.md)

## Documentation For Authorization

## Bearer

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header

## Author