> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/channel-manager-api/channel-manager-api/api-2.1/soap-2.1/reference/partner/set-partner.md).

# Set partner

Set the partner for the current shopping cart session. It's mandatory to set the partner for the current cart session to use all Channel Manager methods with the exception of **login**, **getPartnerByCode, getPartnerSingleSignOn** and **searchPartners**.

## Request parameters

<table><thead><tr><th width="139">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Session identifier, output of the <strong>Login</strong> method. An exception will be thrown if the values are incorrect.</td></tr><tr><td><code>partnerCode</code></td><td><strong>Required (string)</strong><br>Unique identifier that you need to specify when creating a partner in the Control Panel. You can find it under the <strong>General Information</strong> area when editing partner details.</td></tr></tbody></table>

### Request sample

```php
<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication

$partnerCode = 'YOUR_PARTNER_CODE'; // the partner code assigned to the partner account you want to set

try {
    $Partner= $client->setPartner($sessionID, $partnerCode);
} catch (SoapFault $e) {
    echo "Partner: " . $e->getMessage();
    exit;
}

var_dump ("Partner", $Partner);

?>
```

## Response parameters

<table><thead><tr><th width="122.199951171875">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>Result</code></td><td><strong>Boolean</strong><br>True or false</td></tr></tbody></table>

## Errors

<table><thead><tr><th width="184.60009765625">Error</th><th>Description</th></tr></thead><tbody><tr><td><strong>INVALID_PARTNER</strong></td><td>Partner code is mandatory.</td></tr><tr><td><strong>INVALID_PARTNER</strong></td><td>Provided partner code is not associated with an active partner account in the Avangate system.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.2checkout.com/channel-manager-api/channel-manager-api/api-2.1/soap-2.1/reference/partner/set-partner.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
