> For the complete documentation index, see [llms.txt](https://doklado-mnojd9vj.documentationai.com/llms.txt).
> Use it to discover all available pages before exploring further.

# Upsert organization partners


<PlaygroundComponent />

<AuthParams schemes={["apiKey"]}>
<AuthType scheme="apiKey">
<ParamField header="api_key" param-type="string" required="true">
API Key for authentication. Provide your API key in the header.
</ParamField>
</AuthType>
</AuthParams>

<BodyParams contentTypes={["application/json"]} defaultType="application/json">
  <ContentType type="application/json">
<ParamField showLocation="false" body="data" param-type="object" required="false">

<Expandable title="Object Properties" default-open="false">

  <ParamField showLocation="false" body="organizationId" param-type="string" required="false">
  Organization ID (IČO)
  </ParamField>

  <ParamField showLocation="false" body="partners" param-type="array" required="false">

  <Expandable title="Array Items" default-open="false">

    <ParamField showLocation="false" body="name" param-type="string" required="true">
    Partner name
    </ParamField>

    <ParamField showLocation="false" body="accountingSoftwareInternalId" param-type="string" required="true">
    Unique identifier used as upsert key inside the organization
    </ParamField>

    <ParamField showLocation="false" body="partnerCountryCode" param-type="string" required="true">
    ISO 3166-2 country code (e.g. sk, cz) or other
    </ParamField>

    <ParamField showLocation="false" body="partnerType" param-type="string" required="true" enum="customer,supplier">

    </ParamField>

    <ParamField showLocation="false" body="ico" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="dic" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="icDph" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="vatPayer" param-type="boolean" required="false">

    </ParamField>

    <ParamField showLocation="false" body="streetName" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="propertyRegistrationNumber" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="postalCode" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="buildingNumber" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="municipality" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="country" param-type="string" required="false">

    </ParamField>

    <ParamField showLocation="false" body="nonCorporateEntity" param-type="boolean" required="false">

    </ParamField>

    <ParamField showLocation="false" body="orderNumberMandatory" param-type="boolean" required="false">

    </ParamField>

  </Expandable>
  </ParamField>

</Expandable>
</ParamField>
  </ContentType>
</BodyParams>

<Request tabs="curl,python,javascript,go,ruby">

```bash
curl -X POST "https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v3/organization/manage/partner/upsert" \
  -H "Content-Type: application/json" \
  -H "api_key: YOUR_API_KEY" \
  -d '{
  "data": {
    "organizationId": "example_string",
    "partners": [
      {
        "name": "John Doe",
        "accountingSoftwareInternalId": "example_string",
        "partnerCountryCode": "USA",
        "partnerType": "customer",
        "ico": "example_string",
        "dic": "example_string",
        "icDph": "example_string",
        "vatPayer": true,
        "streetName": "John Doe",
        "propertyRegistrationNumber": "example_string",
        "postalCode": "example_string",
        "buildingNumber": "example_string",
        "municipality": "example_string",
        "country": "USA",
        "nonCorporateEntity": true,
        "orderNumberMandatory": true
      }
    ]
  }
}'
```

```python
import requests
import json

url = "https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v3/organization/manage/partner/upsert"
headers = {
  "Content-Type": "application/json",
  "api_key": "YOUR_API_KEY"
}
data = {
  "data": {
    "organizationId": "example_string",
    "partners": [
      {
        "name": "John Doe",
        "accountingSoftwareInternalId": "example_string",
        "partnerCountryCode": "USA",
        "partnerType": "customer",
        "ico": "example_string",
        "dic": "example_string",
        "icDph": "example_string",
        "vatPayer": true,
        "streetName": "John Doe",
        "propertyRegistrationNumber": "example_string",
        "postalCode": "example_string",
        "buildingNumber": "example_string",
        "municipality": "example_string",
        "country": "USA",
        "nonCorporateEntity": true,
        "orderNumberMandatory": true
      }
    ]
  }
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
```

```javascript
const response = await fetch("https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v3/organization/manage/partner/upsert", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "api_key": "YOUR_API_KEY"
},
  body: JSON.stringify({
  "data": {
    "organizationId": "example_string",
    "partners": [
      {
        "name": "John Doe",
        "accountingSoftwareInternalId": "example_string",
        "partnerCountryCode": "USA",
        "partnerType": "customer",
        "ico": "example_string",
        "dic": "example_string",
        "icDph": "example_string",
        "vatPayer": true,
        "streetName": "John Doe",
        "propertyRegistrationNumber": "example_string",
        "postalCode": "example_string",
        "buildingNumber": "example_string",
        "municipality": "example_string",
        "country": "USA",
        "nonCorporateEntity": true,
        "orderNumberMandatory": true
      }
    ]
  }
})
});

const data = await response.json();
console.log(data);
```

```go
package main

import (
    "fmt"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    data := []byte(`{
  "data": {
    "organizationId": "example_string",
    "partners": [
      {
        "name": "John Doe",
        "accountingSoftwareInternalId": "example_string",
        "partnerCountryCode": "USA",
        "partnerType": "customer",
        "ico": "example_string",
        "dic": "example_string",
        "icDph": "example_string",
        "vatPayer": true,
        "streetName": "John Doe",
        "propertyRegistrationNumber": "example_string",
        "postalCode": "example_string",
        "buildingNumber": "example_string",
        "municipality": "example_string",
        "country": "USA",
        "nonCorporateEntity": true,
        "orderNumberMandatory": true
      }
    ]
  }
}`)

    req, err := http.NewRequest("POST", "https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v3/organization/manage/partner/upsert", bytes.NewBuffer(data))
    if err != nil {
        panic(err)
    }

    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("api_key", "YOUR_API_KEY")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Println("Response Status:", resp.Status)
}
```

```ruby
require 'net/http'
require 'json'

uri = URI('https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v3/organization/manage/partner/upsert')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['api_key'] = 'YOUR_API_KEY'
request.body = '{
  "data": {
    "organizationId": "example_string",
    "partners": [
      {
        "name": "John Doe",
        "accountingSoftwareInternalId": "example_string",
        "partnerCountryCode": "USA",
        "partnerType": "customer",
        "ico": "example_string",
        "dic": "example_string",
        "icDph": "example_string",
        "vatPayer": true,
        "streetName": "John Doe",
        "propertyRegistrationNumber": "example_string",
        "postalCode": "example_string",
        "buildingNumber": "example_string",
        "municipality": "example_string",
        "country": "USA",
        "nonCorporateEntity": true,
        "orderNumberMandatory": true
      }
    ]
  }
}'

response = http.request(request)
puts response.body
```

</Request>

### Responses

<div data-component="ResponsesCollection"><Expandable title="200 - Successful operation" default-open="true">

<ResponseField name="data" field-type="object" required="false">

<Expandable title="Object Properties" default-open="false">

<ResponseField name="partners" field-type="array" required="false">

<Expandable title="Array Items" default-open="false">

<ResponseField name="accountingSoftId" field-type="string" required="false">
Provided accountingSoftwareInternalId
</ResponseField>

<ResponseField name="success" field-type="boolean" required="false">
true for created partner, false with code DOCUMENT\_ALREADY\_EXISTS if accountingSoftwareInternalId already exists in the organization
</ResponseField>

</Expandable>
</ResponseField>

</Expandable>
</ResponseField>

<ResponseField name="success" field-type="boolean" required="false">

</ResponseField>

<ResponseField name="message" field-type="string" required="false">
optional message to help user understand error code
</ResponseField>

<ResponseField name="code" field-type="string" required="false" enum="APP_UNAUTHENTICATED,APP_INCORRECT_INPUT_DATA,SAVE_DATA_ERROR_CODE">

</ResponseField>

</Expandable>

<Expandable title="403 - Not authorized" default-open="false">

*Not authorized*

</Expandable>

<Expandable title="404 - Not found" default-open="false">

*Not found*

</Expandable>

<Expandable title="500 - Server invocation error" default-open="false">

*Server invocation error*

</Expandable>

</div>

<Response tabs={["200","403","404","500"]} dropdown="true">

```json
{
  "data": {
    "partners": [
      {
        "accountingSoftId": "example_string",
        "success": true
      }
    ]
  },
  "success": true,
  "message": "example_string",
  "code": "APP_UNAUTHENTICATED"
}
```

```json
{
  "error": "Forbidden",
  "message": "You don't have permission to access this resource",
  "code": 403
}
```

```json
{
  "error": "Not Found",
  "message": "The requested resource was not found",
  "code": 404
}
```

```json
{
  "error": "Internal Server Error",
  "message": "An unexpected error occurred on the server",
  "code": 500,
  "requestId": "req_1234567890"
}
```

</Response>

