Skip to content

click_and_drop_api.OrdersApi

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

Method HTTP request Description
create_orders_async POST /orders Create orders
delete_orders_async DELETE /orders/{orderIdentifiers} Delete orders
get_orders_async GET /orders Retrieve pageable list of orders
get_orders_with_details_async GET /orders/full Retrieve pageable list of orders with details
get_specific_orders_async GET /orders/{orderIdentifiers} Retrieve specific orders
get_specific_orders_with_details_async GET /orders/{orderIdentifiers}/full Retrieve details of the specific orders
update_orders_status_async PUT /orders/status Set order status

create_orders_async

CreateOrdersResponse create_orders_async(request)

Create orders

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.create_orders_request import CreateOrdersRequest
from click_and_drop_api.models.create_orders_response import CreateOrdersResponse
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.OrdersApi(api_client)
    request = click_and_drop_api.CreateOrdersRequest() # CreateOrdersRequest | 

    try:
        # Create orders
        api_response = api_instance.create_orders_async(request)
        print("The response of OrdersApi->create_orders_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->create_orders_async: %s\n" % e)

Parameters

Name Type Description Notes
request CreateOrdersRequest

Return type

CreateOrdersResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Request Processed Successfully -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_orders_async

DeleteOrdersResource delete_orders_async(order_identifiers)

Delete orders

Please be aware labels generated on orders which are deleted are no longer valid and must be destroyed.

Cancelled label information is automatically shared with Royal Mail Revenue Protection, and should a cancelled label be identified on an item in the Royal Mail Network, you will be charged on your account and an additional handling fee applied.

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.delete_orders_resource import DeleteOrdersResource
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.OrdersApi(api_client)
    order_identifiers = 'order_identifiers_example' # str | One or several Order Identifiers or Order References separated by semicolon. Order Identifiers are integer numbers. Order References are strings - each must be percent-encoded and surrounded by double quotation marks. The maximum number of identifiers is 100. E.g. /orders/\"ref\";1001;\"Reference%3BWith%3BSpecial%3BSymbols!\";2345/

    try:
        # Delete orders
        api_response = api_instance.delete_orders_async(order_identifiers)
        print("The response of OrdersApi->delete_orders_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->delete_orders_async: %s\n" % e)

Parameters

Name Type Description Notes
order_identifiers str One or several Order Identifiers or Order References separated by semicolon. Order Identifiers are integer numbers. Order References are strings - each must be percent-encoded and surrounded by double quotation marks. The maximum number of identifiers is 100. E.g. /orders/\"ref\";1001;\"Reference%3BWith%3BSpecial%3BSymbols!\";2345/

Return type

DeleteOrdersResource

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Provides a list of deleted orders references and ids and errors for orders that failed to delete -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
403 Forbidden (Feature not available) -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_orders_async

GetOrdersResponse get_orders_async(page_size=page_size, start_date_time=start_date_time, end_date_time=end_date_time, continuation_token=continuation_token)

Retrieve pageable list of orders

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.get_orders_response import GetOrdersResponse
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.OrdersApi(api_client)
    page_size = 25 # int | The number of items to return (optional) (default to 25)
    start_date_time = '2013-10-20T19:20:30+01:00' # datetime | Date and time lower bound for items filtering (optional)
    end_date_time = '2013-10-20T19:20:30+01:00' # datetime | Date and time upper bound for items filtering (optional)
    continuation_token = 'continuation_token_example' # str | The token for retrieving the next page of items (optional)

    try:
        # Retrieve pageable list of orders
        api_response = api_instance.get_orders_async(page_size=page_size, start_date_time=start_date_time, end_date_time=end_date_time, continuation_token=continuation_token)
        print("The response of OrdersApi->get_orders_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->get_orders_async: %s\n" % e)

Parameters

Name Type Description Notes
page_size int The number of items to return [optional] default to 25
start_date_time datetime Date and time lower bound for items filtering [optional]
end_date_time datetime Date and time upper bound for items filtering [optional]
continuation_token str The token for retrieving the next page of items [optional]

Return type

GetOrdersResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Return pageable list of orders -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_orders_with_details_async

GetOrdersDetailsResponse get_orders_with_details_async(page_size=page_size, start_date_time=start_date_time, end_date_time=end_date_time, continuation_token=continuation_token)

Retrieve pageable list of orders with details

Reserved for ChannelShipper customers only - please visit ChannelShipper.com for more information

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.get_orders_details_response import GetOrdersDetailsResponse
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.OrdersApi(api_client)
    page_size = 25 # int | The number of items to return (optional) (default to 25)
    start_date_time = '2013-10-20T19:20:30+01:00' # datetime | Date and time lower bound for items filtering (optional)
    end_date_time = '2013-10-20T19:20:30+01:00' # datetime | Date and time upper bound for items filtering (optional)
    continuation_token = 'continuation_token_example' # str | The token for retrieving the next page of items (optional)

    try:
        # Retrieve pageable list of orders with details
        api_response = api_instance.get_orders_with_details_async(page_size=page_size, start_date_time=start_date_time, end_date_time=end_date_time, continuation_token=continuation_token)
        print("The response of OrdersApi->get_orders_with_details_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->get_orders_with_details_async: %s\n" % e)

Parameters

Name Type Description Notes
page_size int The number of items to return [optional] default to 25
start_date_time datetime Date and time lower bound for items filtering [optional]
end_date_time datetime Date and time upper bound for items filtering [optional]
continuation_token str The token for retrieving the next page of items [optional]

Return type

GetOrdersDetailsResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Return a pageable list of orders with details -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
403 Forbidden (Feature not available) -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_specific_orders_async

List[GetOrderInfoResource] get_specific_orders_async(order_identifiers)

Retrieve specific orders

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.get_order_info_resource import GetOrderInfoResource
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.OrdersApi(api_client)
    order_identifiers = 'order_identifiers_example' # str | One or several Order Identifiers or Order References separated by semicolon. Order Identifiers are integer numbers. Order References are strings - each must be percent-encoded and surrounded by double quotation marks. The maximum number of identifiers is 100. E.g. /orders/\"ref\";1001;\"Reference%3BWith%3BSpecial%3BSymbols!\";2345/

    try:
        # Retrieve specific orders
        api_response = api_instance.get_specific_orders_async(order_identifiers)
        print("The response of OrdersApi->get_specific_orders_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->get_specific_orders_async: %s\n" % e)

Parameters

Name Type Description Notes
order_identifiers str One or several Order Identifiers or Order References separated by semicolon. Order Identifiers are integer numbers. Order References are strings - each must be percent-encoded and surrounded by double quotation marks. The maximum number of identifiers is 100. E.g. /orders/\"ref\";1001;\"Reference%3BWith%3BSpecial%3BSymbols!\";2345/

Return type

List[GetOrderInfoResource]

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Return list of specific orders -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_specific_orders_with_details_async

List[GetOrderDetailsResource] get_specific_orders_with_details_async(order_identifiers)

Retrieve details of the specific orders

Reserved for ChannelShipper customers only - please visit ChannelShipper.com for more information

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.get_order_details_resource import GetOrderDetailsResource
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.OrdersApi(api_client)
    order_identifiers = 'order_identifiers_example' # str | One or several Order Identifiers or Order References separated by semicolon. Order Identifiers are integer numbers. Order References are strings - each must be percent-encoded and surrounded by double quotation marks. The maximum number of identifiers is 100. E.g. /orders/\"ref\";1001;\"Reference%3BWith%3BSpecial%3BSymbols!\";2345/

    try:
        # Retrieve details of the specific orders
        api_response = api_instance.get_specific_orders_with_details_async(order_identifiers)
        print("The response of OrdersApi->get_specific_orders_with_details_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->get_specific_orders_with_details_async: %s\n" % e)

Parameters

Name Type Description Notes
order_identifiers str One or several Order Identifiers or Order References separated by semicolon. Order Identifiers are integer numbers. Order References are strings - each must be percent-encoded and surrounded by double quotation marks. The maximum number of identifiers is 100. E.g. /orders/\"ref\";1001;\"Reference%3BWith%3BSpecial%3BSymbols!\";2345/

Return type

List[GetOrderDetailsResource]

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Return detailed information about the orders -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
403 Forbidden (Feature not available) -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_orders_status_async

UpdateOrderStatusResponse update_orders_status_async(request)

Set order status

Example

  • Api Key Authentication (Bearer):
import click_and_drop_api
from click_and_drop_api.models.update_order_status_response import UpdateOrderStatusResponse
from click_and_drop_api.models.update_orders_status_request import UpdateOrdersStatusRequest
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.OrdersApi(api_client)
    request = click_and_drop_api.UpdateOrdersStatusRequest() # UpdateOrdersStatusRequest | At least one of 'orderIdentifier' and 'orderReference' is required. Providing both is disallowed to avoid ambiguity.  When the status is set to 'despatchedByOtherCourier', if the optional parameter 'trackingNumber' is provided then the parameters 'despatchDate', 'shippingCarrier' and 'shippingService' are also required. The maximum collection length is 100. 

    try:
        # Set order status
        api_response = api_instance.update_orders_status_async(request)
        print("The response of OrdersApi->update_orders_status_async:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OrdersApi->update_orders_status_async: %s\n" % e)

Parameters

Name Type Description Notes
request UpdateOrdersStatusRequest At least one of 'orderIdentifier' and 'orderReference' is required. Providing both is disallowed to avoid ambiguity. When the status is set to 'despatchedByOtherCourier', if the optional parameter 'trackingNumber' is provided then the parameters 'despatchDate', 'shippingCarrier' and 'shippingService' are also required. The maximum collection length is 100.

Return type

UpdateOrderStatusResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Provides a list of orders -
400 Bad Request (Request has missing or invalid parameters and cannot be parsed) -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]