E-commerce Platforms

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

Get Merchant Registration Info – SOAP

Summary

Name: Get Merchant Registration Info
Reason to Call: Called by the e-commerce platform after the merchant has completed the Canada Post sign-up process. This call returns merchant data such as customer number and merchant username and password. This information is necessary for the platform to perform web service shipping transactions for the merchant.
Input: registration token identification number (token-id)
Output: merchant customer number, the merchant API key (username and password) and the merchant contract (if it exists).
Error Examples: Invalid token-id
Typical Prior Call: Get Merchant Registration Token
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: GetMerchantRegistrationInfo
SOAP Body

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

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

Get-merchant-registration-info-request

complex

required

The top level XML element for the request input information.

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.

token-id

simple

required

40-digit numeric

This is the Canada Post assigned unique token identification number for the merchant.

The platform must have retrieved this token-id number using the Get Merchant Registration Token web service and must also have launched the merchant sign-up process using this token-id.

Request – XML Diagram

Get Merchant Registration Info – Structure of the XML Request

Get Merchant Registration Info – 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 Info – Response Elements
Element Name Type Description

Get-merchant-registration- info-response

Complex

The top level XML element for the response structure.

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

merchant-info

Complex

The XML structure that contains the information about the merchant.

Note: In the sandbox environment, the information for the generic test customer is returned. To test Developer Program services using a specific merchant, use their production environment merchant API key in the sandbox environment. It is valid in both environments.

customer-number

Simple

The customer number of the merchant.

Customer numbers are 10 digits. If the number provided is less than 10 digits, the system will add leading zeros.

contract-number

Simple

The contract number of the merchant if the merchant has a single contract. If the merchant does not have a contract, or has multiple contracts, no contract number will be returned.

Contract numbers are 10 digits. If the number provided is less than 10 digits, the system will add leading zeros.

merchant-username

Simple

The username portion of the merchant API key

merchant-password

Simple

The password portion of the merchant API key

has-default-credit-card

Simple

{true,false}

Indicates whether the merchant has a default credit card on file with Canada Post that can be used for shipping transactions.

If the value is true, the merchant can perform shipping transactions without a contract and charge shipments to the credit card.

If this value and has-supplier-account are false, the merchant cannot perform shipping transactions without a contract.

has-default-supplier-account

Simple

{true,false}

Indicates whether the merchant has a default Supplier Account on file with Canada Post that can be used for shipping transactions.

If the value is true, the merchant can perform shipping transactions using that method of payment.

If this value and has-default-credit-card are false, the merchant cannot perform shipping transactions without a contract.

Note: Supplier Account as a method of payment is only available to suppliers.

Response – XML Diagram

Get Merchant Registration Info – Structure of the XML Response

Get Merchant Registration Info – 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.

SOAP Faults

Possible SOAP faults 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.

Application Error Message

A possible application error message is as follows:

<messages>
    <message>
        <code>9174</code>
        <description> The specified token-id is either invalid or has expired.</description>
    </message>
</messages>

Note: If a merchant failed to complete the registration process, but the token-id was valid, the merchant-username and merchant-password would be empty but no error would be returned.

Examples

Sample SOAP XML Request – Get Merchant Registration Info

<get-merchant-registration-info-request>
    <locale>EN</locale>
    <token-id>520d5199226ebf93bccaa4</token-id>
</get-merchant-registration-info-request>

Sample SOAP XML Response – Get Merchant Registration Info

<get-merchant-registration-info-response>
    <merchant-info>
        <customer-number>0001234567</customer-number>
        <contract-number>0040665287</contract-number>
        <merchant-username>5394dfee1391b1ba</merchant-username>
        <merchant-password>01b34a66d8bf0a13730a4e</merchant-password>
        <has-default-credit-card>true</has-default-credit-card>
<has-default-supplier-account>true</has-default-supplier-account>
    </merchant-info>
</get-merchant-registration-info-response>