ClickAndDrop - the Ruby gem for the ChannelShipper & Royal Mail Public API
Import your orders, retrieve your orders and generate labels.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build click_and_drop.gemspec
Then either install the gem locally:
gem install ./click_and_drop-1.0.0.gem
(for development, run gem install --dev ./click_and_drop-1.0.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'click_and_drop', '~> 1.0.0'
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'click_and_drop', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'click_and_drop'
# Setup authorization
ClickAndDrop.configure do |config|
# Configure API key authorization: Bearer
config.api_key['Bearer'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Bearer'] = 'Bearer'
end
api_instance = ClickAndDrop::LabelsApi.new
order_identifiers = 'order_identifiers_example' # String | 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.
document_type = 'postageLabel' # 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\"
opts = {
include_returns_label: true, # Boolean | Include returns label. Required when documentType is set to 'postageLabel'
include_cn: true # Boolean | 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\"
}
begin
#Return a single PDF file with generated label and/or associated document(s)
result = api_instance.get_orders_label_async(order_identifiers, document_type, opts)
p result
rescue ClickAndDrop::ApiError => e
puts "Exception when calling LabelsApi->get_orders_label_async: #{e}"
end
All URIs are relative to /api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
ClickAndDrop::LabelsApi | get_orders_label_async | GET /orders/{orderIdentifiers}/label | Return a single PDF file with generated label and/or associated document(s) |
ClickAndDrop::OrdersApi | create_orders_async | POST /orders | Create orders |
ClickAndDrop::OrdersApi | delete_orders_async | DELETE /orders/{orderIdentifiers} | Delete orders |
ClickAndDrop::OrdersApi | get_orders_async | GET /orders/{orderIdentifiers} | Retrieve orders |
ClickAndDrop::OrdersApi | get_orders_with_details_async | GET /orders/{orderIdentifiers}/full | Retrieve orders details |
ClickAndDrop::OrdersApi | update_orders_status_async | PUT /orders/status | Set order status |
ClickAndDrop::VersionApi | get_version_async | GET /version | Get API version details. |
- ClickAndDrop::AddressRequest
- ClickAndDrop::BillingDetailsRequest
- ClickAndDrop::CreateOrderErrorResponse
- ClickAndDrop::CreateOrderLabelErrorResponse
- ClickAndDrop::CreateOrderRequest
- ClickAndDrop::CreateOrderResponse
- ClickAndDrop::CreateOrdersRequest
- ClickAndDrop::CreateOrdersResponse
- ClickAndDrop::DeleteOrdersResource
- ClickAndDrop::DeletedOrderInfo
- ClickAndDrop::DimensionsRequest
- ClickAndDrop::ErrorResponse
- ClickAndDrop::FailedOrderResponse
- ClickAndDrop::GetOrderDetailsResource
- ClickAndDrop::GetOrderInfoResource
- ClickAndDrop::GetOrderLineResult
- ClickAndDrop::GetPostalDetailsResult
- ClickAndDrop::GetShippingDetailsResult
- ClickAndDrop::GetTagDetailsResult
- ClickAndDrop::GetVersionResource
- ClickAndDrop::LabelGenerationRequest
- ClickAndDrop::OrderErrorInfo
- ClickAndDrop::OrderErrorResponse
- ClickAndDrop::OrderFieldResponse
- ClickAndDrop::OrderUpdateError
- ClickAndDrop::PostageDetailsRequest
- ClickAndDrop::ProductItemRequest
- ClickAndDrop::RecipientDetailsRequest
- ClickAndDrop::SenderDetailsRequest
- ClickAndDrop::ShipmentPackageRequest
- ClickAndDrop::TagRequest
- ClickAndDrop::UpdateOrderStatusRequest
- ClickAndDrop::UpdateOrderStatusResponse
- ClickAndDrop::UpdateOrdersStatusRequest
- ClickAndDrop::UpdatedOrderInfo
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header