> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/data-sources/create-a-data-source.md).

# Create a data source

Creates a data source.

`name` and `supplier_code` are both required and must each be unique across all data sources; `slug`, when given, must be unique as well. The identifier is assigned by the server; a `pk` sent in the request body is ignored. `is_active` defaults to `true`.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Data Sources","description":"Administrative endpoints for **data sources** — the sellers / suppliers behind the catalog. A data source carries the commercial and legal identity of a seller (a display `name`, a unique `supplier_code`, and contact details) and binds that seller to the price list and stock list it sells under. On a marketplace, each seller is a data source; a single-seller store typically has one.\n\n## Core Capabilities\n\n**1. Listing & Filtering**\n* Retrieve a paginated list of data sources.\n* Filter by `supplier_code` (case-insensitive exact match).\n* Order results with the `sort` parameter, as described under **Filtering & Ordering**.\n\n**2. Full CRUD**\n* Create a data source with its identity, contact details, and price / stock list bindings.\n* Retrieve a single data source.\n* Fully or partially update a data source.\n* Delete a data source. `DELETE` is a **hard delete** — the record is removed.\n\n> **Deactivating a data source has a side effect.** Setting `is_active` to `false` on an update removes every basket item on the storefront that references this data source. Deactivation is not the same as deletion: the record itself is kept and can be reactivated later.\n\n## Data Source Fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `pk` | integer | The unique identifier of the data source. Read-only; supplying it in a request body has no effect. |\n| `name` | string | The seller's display name. Required on create and full update. Up to 64 characters and unique across all data sources. |\n| `slug` | string | A URL-safe identifier. Optional and unique when given; up to 64 characters. |\n| `title` | string | The seller's full / legal name. Optional; up to 255 characters. |\n| `supplier_code` | string | The seller's unique business code. Required on create and full update. Up to 50 characters and unique across all data sources. |\n| `address` | string | Postal address. Optional. |\n| `email` | string | Contact e-mail address. Optional; must be a valid e-mail when given. |\n| `phone_number` | string | Contact phone number. Optional; up to 128 characters. |\n| `fax_number` | string | Fax number. Optional; up to 128 characters. |\n| `kep_address` | string | Registered electronic-mail (KEP) address. Optional; must be a valid e-mail when given. |\n| `mersis_number` | string | Central Registry (MERSIS) number. Optional; up to 16 characters. |\n| `trade_association` | string | Trade association / chamber the seller belongs to. Optional; up to 255 characters. |\n| `extras` | object | Free-form JSON for extra, integration-specific data. Optional; defaults to an empty object. |\n| `price_list` | integer | The identifier of the price list supplying this seller's prices. Optional; may be `null`. |\n| `stock_list` | integer | The identifier of the stock list supplying this seller's stock. Optional; may be `null`. |\n| `is_active` | boolean | Whether the data source is active. Defaults to `true` on create. See the deactivation side effect above. |\n\n## Filtering & Ordering\n\nThe list endpoint accepts a single filter, `supplier_code`, matched case-insensitively against the whole value. Query parameters that are not listed are ignored rather than rejected. Results can be ordered with the `sort` parameter on the data source's fields; prefix a field with a hyphen for descending order and separate several fields with commas.\n\n## Dynamic Settings & Environment Variables\n\nNo dynamic settings (`dj_dynamic_settings`) and no environment variables are read by these endpoints. Their behavior does not change with the management-panel or deployment configuration."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"schemas":{"DataSourceRequest":{"type":"object","description":"The body of a data source create or full update request.","required":["name","supplier_code"],"properties":{"name":{"type":"string","maxLength":64,"description":"The seller's display name. Must be unique across all data sources."},"slug":{"type":["string","null"],"maxLength":64,"description":"A URL-safe identifier. Optional; must be unique when given."},"title":{"type":["string","null"],"maxLength":255,"description":"The seller's full / legal name. Optional."},"supplier_code":{"type":"string","maxLength":50,"description":"The seller's unique business code. Must be unique across all data sources."},"address":{"type":["string","null"],"description":"Postal address. Optional."},"email":{"type":["string","null"],"format":"email","description":"Contact e-mail address. Optional."},"phone_number":{"type":["string","null"],"maxLength":128,"description":"Contact phone number. Optional."},"fax_number":{"type":["string","null"],"maxLength":128,"description":"Fax number. Optional."},"kep_address":{"type":["string","null"],"format":"email","description":"Registered electronic-mail (KEP) address. Optional."},"mersis_number":{"type":["string","null"],"maxLength":16,"description":"Central Registry (MERSIS) number. Optional."},"trade_association":{"type":["string","null"],"maxLength":255,"description":"Trade association / chamber the seller belongs to. Optional."},"extras":{"type":"object","description":"Free-form JSON for extra data. Optional; defaults to an empty object."},"price_list":{"type":["integer","null"],"description":"The identifier of the price list supplying this seller's prices. Optional. Must reference an existing price list when given."},"stock_list":{"type":["integer","null"],"description":"The identifier of the stock list supplying this seller's stock. Optional. Must reference an existing stock list when given."},"is_active":{"type":"boolean","default":true,"description":"Whether the data source is active. On create, omitting it stores the record as active."}}},"DataSource":{"type":"object","description":"A data source — the commercial and legal identity of a seller / supplier, bound to the price and stock lists it sells under.","properties":{"pk":{"type":"integer","readOnly":true,"description":"The unique identifier of the data source."},"name":{"type":"string","maxLength":64,"description":"The seller's display name. Unique across all data sources."},"slug":{"type":["string","null"],"maxLength":64,"description":"A URL-safe identifier. Unique when set."},"title":{"type":["string","null"],"maxLength":255,"description":"The seller's full / legal name."},"supplier_code":{"type":"string","maxLength":50,"description":"The seller's unique business code."},"address":{"type":["string","null"],"description":"Postal address."},"email":{"type":["string","null"],"format":"email","description":"Contact e-mail address."},"phone_number":{"type":["string","null"],"maxLength":128,"description":"Contact phone number."},"fax_number":{"type":["string","null"],"maxLength":128,"description":"Fax number."},"kep_address":{"type":["string","null"],"format":"email","description":"Registered electronic-mail (KEP) address."},"mersis_number":{"type":["string","null"],"maxLength":16,"description":"Central Registry (MERSIS) number."},"trade_association":{"type":["string","null"],"maxLength":255,"description":"Trade association / chamber the seller belongs to."},"extras":{"type":"object","description":"Free-form JSON for extra, integration-specific data."},"price_list":{"type":["integer","null"],"description":"The identifier of the price list supplying this seller's prices."},"stock_list":{"type":["integer","null"],"description":"The identifier of the stock list supplying this seller's stock."},"is_active":{"type":"boolean","description":"Whether the data source is active."}}},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"DataSourceValidationError":{"description":"The request contains invalid or missing data — for example a missing `name` or `supplier_code`, a `name`, `supplier_code`, or `slug` that repeats a value already stored, a malformed e-mail in `email` or `kep_address`, or a `price_list` / `stock_list` that does not exist. The response names the field the complaint belongs to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/data_sources/":{"post":{"tags":["Data Sources"],"operationId":"createDataSource","summary":"Create a data source","description":"Creates a data source.\n\n`name` and `supplier_code` are both required and must each be unique across all data sources; `slug`, when given, must be unique as well. The identifier is assigned by the server; a `pk` sent in the request body is ignored. `is_active` defaults to `true`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceRequest"}}}},"responses":{"201":{"description":"The created data source.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSource"}}}},"400":{"$ref":"#/components/responses/DataSourceValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/data-sources/create-a-data-source.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
