Returns

Code Samples for Returns: Java (.zip) | PHP (.zip) | C# (.zip)

Get Open Return Templates – SOAP

Summary

Name: Get Open Return Templates
Reason to Call:

Used to retrieve a list of all active open return templates associated with your application (by mailed-by and mailed-on-behalf of (MOBO) customer numbers).

Note: As your application should maintain the list of active open return templates, this service is not typically called during routine operation. Rather, it is used to recover from a communications or other error.

Input:

From and to dates and times that represent the period over which all active open return templates are to be retrieved.

Output: A list of template-ids for all active open return templates within the specified time period.
Typical Next Call: Get Open Return Template to access a specific open return template on the list.
Version history: Release notes
Get Open Return Templates – Summary of Service

Get Open Return Templates – Summary of Service

Call Details

WSDL: openreturn.wsdl
Endpoint (Development): https://ct.soa-gw.canadapost.ca/rs/soap/return
Endpoint (Production): https://soa-gw.canadapost.ca/rs/soap/return
Namespace: http://www.canadapost.ca/ws/soap/return
Operation: GetOpenReturnTemplates

SOAP Body

This section describes the XML input elements to this service. For the hierarchical structure, see the XML diagram.

Get Open Return Templates – Request Elements
Element Name Type Required / Optional Description

get-open-return-templates-request

complex

required

The top level element for the request.

mailed-by

simple

required

(1-10 digit numeric)

The 10-digit customer number of the mailed-by customer.

If the number provided has fewer than 10 digits, the system will add leading zeros.

mobo

simple

optional

(1-10 digit numeric)

The 10-digit customer number of the mailed-on-behalf-of customer.

If this element is missing, it will default to the mailed-by customer number.

If the number provided has fewer than 10 digits, the system will add leading zeros.

locale

simple

optional

Indicates your language preference for receiving error messages.

EN = English
FR = French

If no value is provided, the default language is English.

from

simple

optional

The starting date of the range for which active open return templates will be returned.

The date is specified in the form YYYY-MM-DD.

All dates are for the Eastern Time Zone

If the "from" date is missing, all active open return templates prior to the "to" date are returned.

to

simple

optional

The end date of the range for which active open return templates will be returned.

The date is specified in the form YYYY-MM-DD.

All dates are for the Eastern Time Zone

If the "to" date is missing, the end date is assumed to be the current date.

If both the "from" and "to" dates are missing, all open return templates are returned.

Request – XML Diagram

Get Open Return Templates – Structure of the XML Request

Get Open Return Templates – Structure of the XML Request

Response Details

Response – Elements

The following table describes the XML elements in the response to Get Open Return Templates. For the hierarchy of the response, see the XML diagram.

Get Open Return Templates – Response Elements
Element Name Type Description

get-open-return-templates-response

complex

The top level XML structure of the response.

It will either contain the results of a successful completion or the error message structure.

templates

complex

The XML structure that contains the list of templates.

template-id

simple

May occur 1 .. N times

A unique identifier for the template. It can be used to call any of the following:

  • Get Open Return Template
  • Get Open Return Template Details
  • Delete Open Return Template

Response – XML Diagram

Get Open Return Templates – Structure of the XML Response

Get Open Return Templates – Structure of the XML Response

Response – Possible Error Responses

The response to error conditions for this web service follows the standard SOAP error response approach used for all Canada Post web services. For more information, see SOAP Fundamentals of Canada Post Web Services.

Examples

Sample SOAP XML Request – Get Open Return Templates

<get-open-return-templates-request>
<mailed-by>1111111</mailed-by>
<locale>EN</locale>
<from>2011-01-04-06:00</from>
<to>2012-02-03+06:00</to>
</get-open-return-templates-request>

Sample SOAP XML Response – Get Open Return Templates

<get-open-return-templates-response>
<templates>
<template-id>349641323786705649</template-id>
</templates>
</get-open-return-templates-response>