Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎2 - Consumer Related‎ > ‎

Link Orders

Link orders is the second step in a two step process in which a user's previous purchases are linked to his new profile.  See the first step, Linkable Orders, for more information.

Link orders links every order with an order id in the request to the account with the user key provided in the request.  The confirmation token provided must match the token returned by the initial Linkable Orders call. Only orders with order ids returned by the initial Linkable Orders call can be linked.  This is not a reversible action.

Only orders associated with consumers with consumer type Visitor or Unknown may be linked to a new account, and only consumers with consumer type Account are eligible to have orders linked to them.

Note: When linking an order to a new profile, any consumer credits associated with the consumer who originally purchased the order will be lost.

Method: POST /api/v3/publisher/consumer/{userKey}/linkableOrders/{confirmationToken}

Authentication: oauth
userKey - the userKey of the account to link the orders to
confirmationToken - the unique token returned by the initial Linkable Orders call

Required Form Name Data Type Explanation
A list of the order ids of the orders to link to the account with the request's userKey

base response fields

Sample Request:

POST http://api.groupcommerce.com/api/v3/publisher/consumer/theuserkey/linkableOrders/thetoken

Form: OrderIds%5B0%5D=1&OrderIds%5B1%5D=2&OrderIds%5B2%5D=3

OAuth oauth_signature="FrP4jCKx8CTwhB2rvB7NG0p6tIc%3D", oauth_nonce="7519789", oauth_timestamp="1337033756", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"

Sample JSON Response:

    "lastPublished": "\/Date(1337033757548)\/",

Sample XML Response:

<linkOrdersResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">