click-and-drop-api
Import your orders, retrieve your orders and generate labels.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.26.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.10+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
(you may need to runpip with root permission: sudo pip install git+https://https://github.com/niccokunzmann/python-royal-mail-click-and-drop-api.git)
Then import the package:
Setuptools
Install via Setuptools.
(orsudo python setup.py install to install the package for all users)
Then import the package:
Tests
Execute pytest to run the tests.
Getting Started
Please follow the [installation procedure] and then run the following:
import click_and_drop_api
from click_and_drop_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://api.parcel.royalmail.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = click_and_drop_api.Configuration(
host = "http://api.parcel.royalmail.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'
# Enter a context with an instance of the API client
with click_and_drop_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = click_and_drop_api.CarriersApi(api_client)
try:
# Retrieve list of carriers for the account
api_response = api_instance.get_carriers_async()
print("The response of CarriersApi->get_carriers_async:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling CarriersApi->get_carriers_async: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://api.parcel.royalmail.com/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| CarriersApi | get_carriers_async | GET /carriers | Retrieve list of carriers for the account |
| LabelsApi | get_orders_label_async | GET /orders/{orderIdentifiers}/label | Return a single PDF file with generated label and/or associated document(s) |
| ManifestsApi | get_manifest_async | GET /manifests/{manifestIdentifier} | Get manifest |
| ManifestsApi | manifest_eligible_async | POST /manifests | Manifest eligible orders |
| ManifestsApi | retry_manifest_async | POST /manifests/retry/{manifestIdentifier} | Retry manifest |
| OrdersApi | create_orders_async | POST /orders | Create orders |
| OrdersApi | delete_orders_async | DELETE /orders/{orderIdentifiers} | Delete orders |
| OrdersApi | get_orders_async | GET /orders | Retrieve pageable list of orders |
| OrdersApi | get_orders_with_details_async | GET /orders/full | Retrieve pageable list of orders with details |
| OrdersApi | get_specific_orders_async | GET /orders/{orderIdentifiers} | Retrieve specific orders |
| OrdersApi | get_specific_orders_with_details_async | GET /orders/{orderIdentifiers}/full | Retrieve details of the specific orders |
| OrdersApi | update_orders_status_async | PUT /orders/status | Set order status |
| ReturnsApi | returns_post | POST /returns | Create a return shipment |
| ReturnsApi | returns_services_get | GET /returns/services | List available return services |
| VersionApi | get_version_async | GET /version | Get API version details. |
Documentation For Models
- Address
- AddressRequest
- BillingDetailsRequest
- CreateOrderErrorResponse
- CreateOrderLabelErrorResponse
- CreateOrderRequest
- CreateOrderResponse
- CreateOrdersRequest
- CreateOrdersResponse
- CreatePackagesResponse
- CreateReturnRequest
- CreateReturnResponse
- CreateReturnResponseShipment
- CustomerReference
- DeleteOrdersResource
- DeletedOrderInfo
- DimensionsRequest
- ErrorResponse
- FailedOrderResponse
- GetCarrierResource
- GetOrderDetailsResource
- GetOrderInfoResource
- GetOrderLineResult
- GetOrdersDetailsResponse
- GetOrdersResponse
- GetPostalDetailsResult
- GetServicesResponse
- GetShippingDetailsResult
- GetTagDetailsResult
- GetVersionResource
- Importer
- LabelGenerationRequest
- ManifestDetailsResponse
- ManifestEligibleOrdersRequest
- ManifestErrorsErrorDetailsResponse
- ManifestErrorsResponse
- ManifestOrdersResponse
- OrderErrorInfo
- OrderErrorResponse
- OrderFieldResponse
- OrderUpdateError
- PostageDetailsRequest
- ProductItemRequest
- RecipientDetailsRequest
- SenderDetailsRequest
- ServiceCode
- ServiceItem
- Shipment
- ShipmentPackageRequest
- TagRequest
- UpdateOrderStatusRequest
- UpdateOrderStatusResponse
- UpdateOrdersStatusRequest
- UpdatedOrderInfo
Documentation For Authorization
Authentication schemes defined for the API:
Bearer
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header