E-commerce Platforms

Code Samples for E-commerce Platforms: Java (.zip) | PHP (.zip) | C# (.zip)

Get Merchant Registration Token – SOAP

Summary

Name: Get Merchant Registration Token
Reason to Call:

To get a unique registration token that is used to launch a merchant into the Canada Post sign-up process.

Note: You do not need to re-register a merchant in the Sandbox (development) environment; their production API key is valid in both environments. To test as a generic merchant, use customer number 2004381 with contract number 42708517.

Input: The preferred language for error messages.
Output: A token-id that is used to register a merchant with Canada Post.
Error Examples: Platform not authorized to call this web service.
Version history: Release notes

Call Details

WSDL: merchantregistration.wsdl
Endpoint (Development): https://ct.soa-gw.canadapost.ca/ot/soap/merchant/registration/v2
Endpoint (Production): https://soa-gw.canadapost.ca/ot/soap/merchant/registration/v2
Namespace: http://www.canadapost.ca/ws/soap/merchant/registration/v2
Operation: GetMerchantRegistrationToken
SOAP Body

This section describes the XML input elements to this service.

Get Merchant Registration Token – Request Elements
Element Name Type Required/Optional Description

get-merchant-registration-token-request

complex

required

The top level XML element for the request.

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.

Request - XML Diagram

Get Merchant Registration Token – Structure of the XML Request

Get Merchant Registration Token – Structure of the XML Request

Response Details

Response – Elements

The following table describes the XML elements in the response. For the hierarchy of the response, see the XML diagram.

Get Merchant Registration Token – Response Elements
Element Name Type Description

get-merchant-registration-token-response

Complex

The top level XML element for the response. It will either contain the results of a successful completion or the error message structure.

token

Complex

This structure contains the results of a successful completion of the service.

token-id

Simple

The unique token identification number used to launch a merchant into the Canada Post sign-up process.

The same stubbed value (1111111111111111) is always returned in the sandbox (development) environment.

Response – XML Diagram

Get Merchant Registration Token – Structure of the XML Response

Get Merchant Registration Token – 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 Error Handling in SOAP Fundamentals of Canada Post Web Services.

Possible error messages for this service include the following:

Code Name Description

AA007

Platform not active

You will receive this error if you have tried to use Get Merchant Registration Token while your application to become an approved e-commerce platform with Canada Post is still pending. You cannot use this service until Canada Post has approved your application.

AA008

Unauthorized Platform

You will receive this error if you are attempting to use Get Merchant Registration Token service but have not applied to become an e-commerce platform with Canada Post. To apply, sign in to the Developer Program home page and select Become a Platform.

Examples

Sample SOAP MXL Request – Get Merchant Registration Token

<get-merchant-registration-token-request>
    <locale>EN</locale>
</get-merchant-registration-token-request>

Sample SOAP XML Response – Get Merchant Registration Token

<get-merchant-registration-token-response>
    <token>
        <token-id>520d5199226ebf93bccaa4</token-id>
    </token>
</get-merchant-registration-token-response>