Contract Shipping

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

Get Customer Information – SOAP

Summary

Name:

Get Customer Information

Reason to Call:

To retrieve details on allowed payers, methods of payment and other information about a customer to determine the proper customer number for charging shipping costs.

Input:

The customer number for which customer information is desired.

Output:

Contract numbers, authorized payers, allowed methods of payment and other "mailed on behalf of" customers previously mailed for (if any).

Error Examples:

Customer number not valid

Possible Next Calls: Get MOBO Customer Information, Create Shipment
Version history: Release notes

Overview of Get Customer Information

Customer Information - Summary of Service

Get Customer Information - Summary of Service

Call Details

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

SOAP Body

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

Get Customer Information – Request Elements
Element Name Type Required / Optional Description

get-customer-information-request

complex

required

The top level XML element for the request input information.

customer-number

simple

required

(1-10 digit numeric)

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

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 Customer Information – Structure of the XML Request

Get Customer Information – Structure of the XML Request

Response Details

Response – Elements

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

Get Customer Information – Response Elements
Field Name Type Description

get-customer-information-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.

customer

complex

Contains all of the requested information about the customer.

customer-number

simple

Mailed-by customer number

contracts

complex

Contains the contracts that the customer owns or is authorized to use. Only contracts effective as of the date of the request are listed.

contract-id

simple

Contract number (also called agreement number).

authorized-payers

complex

Contains allowable paid-by customer numbers and methods of payment.

payer

complex

The customer number of an authorized payer.

payer-number

simple

Customer number of a payer which could be used for the mailed-by customer (where the mailed-by and behalf-of numbers are the same)

methods-of-payment

complex

Structure that contains the methods of payment this payer can use.

method-of-payment

simple

Can contain:

  • account
  • creditCard

Note that if a payer has no method of payment, the payer can’t be used to ship.

mobos

complex

Contains information about the mailed-on-behalf-of customers that are associated with the requested customer number.

mobo

simple

The customer number of a specific mobo.

Response – XML Diagram

Get Customer Information – Structure of the XML Response
Get Customer Information – 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 Customer Information

<get-customer-information-request>
<customer-number>1111111</customer-number>
</get-customer-information-request>

Sample SOAP XML Response – Get Customer Information

<get-customer-information-response>
<customer>
<customer-number>0001111111</customer-number>
<contracts>
<contract-id>0012345678</contract-id>
</contracts>
<authorized-payers>
<payer>
<payer-number>0001111111</payer-number>
<methods-of-payment>
<method-of-payment>account</method-of-payment>
<method-of-payment>creditCard</method-of-payment>
</methods-of-payment>
</payer>
</authorized-payers>
</customer>
</get-customer-information-response>