# Create a sourcing partner

`POST /lokta-lms/api/v1/sourcing-partners`

Creates a sourcing partner in the pending state.

Creates the partner in `pending`. It cannot be attributed until it is activated, and activation requires an agreement on file; onboarding is a sequence, not a form.

`details` and `contacts` may ride this call so onboarding is one request; afterwards each is maintained through its own sub-resource. If contacts are supplied and none is marked primary, the first becomes primary, because every screen downstream assumes a partner has a point of contact.

Requires an `Idempotency-Key`. Reusing a key with a different body is a `409` rather than a silent replay of the first response.

## When to use it

This starts onboarding. The partner is created as pending. Add an agreement and then activate it, because a partner cannot be attributed a loan until it is active.

## Worth knowing
- Send an Idempotency-Key header. Reusing a key with a different body returns 409.

## Parameters
- `Idempotency-Key` (header, string): Per-intent key; persist it before sending and reuse it on retry

## Request body (application/json)
- `name` (string): Placeholder name, to be confirmed. The partner's name.
- `external_id` (string): Placeholder name, to be confirmed. The partner's external id.
- `partner_type` (string): Placeholder name, to be confirmed. A partner type code from the reference data.
- `details` (object): The partner's details. May ride this call so onboarding is one request.
- `contacts` (array): The partner's contacts. If none is marked primary, the first becomes primary.

## Responses
- `default`: default response

## Example request (cURL)
```bash
curl -X POST \
  'https://default.lokta.tech/lokta-lms/api/v1/sourcing-partners' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "external_id": "string",
  "partner_type": "string",
  "details": {},
  "contacts": [
    {}
  ]
}'
```

Interactive: https://developer.lokta.ai/reference#operation/create_6
