### Get Installed Solution Entity by ID Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieve parameters for an installed solution using its account-specific ID. The ID is a required string parameter. ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/application/b58a6312-f958-11e9-ac12-000a00000020" \ -H "Authorization: Bearer " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Get Installed Solution Entity Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves the parameters of an installed solution by its ID. ```APIDOC ## GET /entity/application/{id} ### Description Retrieves the parameters of an installed solution by its ID. ### Method GET ### Endpoint /entity/application/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the installed solution on the account. Example: `b58a6312-f958-11e9-ac12-000a00000020` ### Request Example ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/application/b58a6312-f958-11e9-ac12-000a00000020" \ -H "Authorization: Bearer " \ -H "Accept-Encoding: gzip" ``` ### Response #### Success Response (200) - **meta** (object) - Metadata about the application. - **appUid** (string) - The unique identifier of the application. - **id** (string) - The unique identifier of the application instance. #### Response Example ```json { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/application/b58a6312-f958-11e9-ac12-000a00000020", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/application/metadata", "type": "application", "mediaType": "application/json" }, "appUid": "test.moysklad@reqwy1", "id": "b58a6312-f958-11e9-ac12-000a00000020" } ``` ``` -------------------------------- ### Example Request for Sales Return Without Expand Source: https://dev.moysklad.ru/doc/api/remap/1.2 This example demonstrates how to fetch a sales return without using the expand parameter. Ensure you replace with your actual authorization details. ```curl curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Contextual Search Examples Source: https://dev.moysklad.ru/doc/api/remap/1.2 Examples of using the 'search' URI parameter for contextual search across entity lists. Values should be URL-encoded. ```http https://api.moysklad.ru/api/remap/1.2/entity/project?search=реструктуризация ``` ```http https://api.moysklad.ru/api/remap/1.2/entity/move?search=ул.Вавилова ``` ```http https://api.moysklad.ru/api/remap/1.2/entity/counterparty?search=петров ``` -------------------------------- ### Sales Return without Expand Source: https://dev.moysklad.ru/doc/api/remap/1.2 This example demonstrates how to retrieve a sales return without using the 'expand' parameter. It shows the basic structure of a GET request for a specific sales return entity. ```APIDOC ## GET /entity/salesreturn/{id} ### Description Retrieves a specific sales return entity without expanding related data. ### Method GET ### Endpoint /api/remap/1.2/entity/salesreturn/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the sales return. ### Request Example ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` ### Response #### Success Response (200) - **meta** (object) - Metadata about the sales return. - **demand** (object) - Details of the associated demand. ``` -------------------------------- ### Get Solution Context Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieve parameters for the solution in which the request is made. Use this to get application-specific context, similar to employee context. ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/context/application" \ -H "Authorization: Bearer " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Get Application Context Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves the context of the solution, including its parameters. This is analogous to the Employee context. ```APIDOC ## GET /context/application ### Description Retrieves the context of the solution, including its parameters. This is analogous to the Employee context. ### Method GET ### Endpoint /context/application ### Request Example ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/context/application" \ -H "Authorization: Bearer " \ -H "Accept-Encoding: gzip" ``` ### Response #### Success Response (200) - **meta** (object) - Metadata about the application. - **appUid** (string) - The unique identifier of the application. - **id** (string) - The unique identifier of the application instance. #### Response Example ```json { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/application/b58a6312-f958-11e9-ac12-000a00000020", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/application/metadata", "type": "application", "mediaType": "application/json" }, "appUid": "test.moysklad@reqwy1", "id": "b58a6312-f958-11e9-ac12-000a00000020" } ``` ``` -------------------------------- ### Create Shipment with Expand Source: https://dev.moysklad.ru/doc/api/remap/1.2 This example shows how to create a shipment using the POST method and includes the 'agent' field expanded in the request. ```APIDOC ## POST /entity/demand?expand=agent ### Description Creates a shipment with the specified details, expanding the agent field to include related information. ### Method POST ### Endpoint /entity/demand?expand=agent ### Request Body - **name** (string) - Required - The name of the shipment. - **organization** (object) - Required - Metadata for the organization. - **meta** (object) - Required - Metadata details. - **href** (string) - Required - The URL of the organization. - **type** (string) - Required - The type of the metadata (e.g., 'organization'). - **mediaType** (string) - Required - The media type of the metadata (e.g., 'application/json'). - **agent** (object) - Required - Metadata for the agent. - **meta** (object) - Required - Metadata details. - **href** (string) - Required - The URL of the agent. - **type** (string) - Required - The type of the metadata (e.g., 'counterparty'). - **mediaType** (string) - Required - The media type of the metadata (e.g., 'application/json'). - **store** (object) - Required - Metadata for the store. - **meta** (object) - Required - Metadata details. - **href** (string) - Required - The URL of the store. - **type** (string) - Required - The type of the metadata (e.g., 'store'). - **mediaType** (string) - Required - The media type of the metadata (e.g., 'application/json'). ### Request Example ```json { "name": "0001", "organization": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/organization/850c8195-f504-11e5-8a84-bae50000015e", "type": "organization", "mediaType": "application/json" } }, "agent": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/counterparty/9794d400-f689-11e5-8a84-bae500000078", "type": "counterparty", "mediaType": "application/json" } }, "store": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/store/850ee995-f504-11e5-8a84-bae500000160", "type": "store", "mediaType": "application/json" } } } ``` ``` -------------------------------- ### Retrieve Sales Return with Expanded Demand Source: https://dev.moysklad.ru/doc/api/remap/1.2 This example demonstrates how to retrieve a specific sales return and include its associated demand information by using the `expand=demand` query parameter. ```APIDOC ## GET /entity/salesreturn/{id}?expand=demand ### Description Retrieves a specific sales return, including details of the associated demand document. ### Method GET ### Endpoint `/api/remap/1.2/entity/salesreturn/{id}?expand=demand` ### Parameters #### Query Parameters - **expand** (string) - Required - Specifies related entities to include in the response. Use `demand` to include demand details. ### Request Example ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043?expand=demand" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` ### Response #### Success Response (200 OK) Returns the sales return object with an embedded demand object if the `expand=demand` parameter is used. ``` -------------------------------- ### Retrieve Employee Context Source: https://dev.moysklad.ru/doc/api/remap/1.2 Use this endpoint to get the context of an employee's request. Ensure you include your credentials in the Authorization header and specify gzip encoding. ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/context/employee/" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Example Metadata Response Body Source: https://dev.moysklad.ru/doc/api/remap/1.2 This JSON structure represents the metadata for different entities, including links to their respective metadata resources. ```json { "service": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/product/metadata", "mediaType": "application/json" } }, "product": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/product/metadata", "mediaType": "application/json" } }, "demand": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/demand/metadata", "mediaType": "application/json" } } } ``` -------------------------------- ### Retrieve Metadata for Multiple Entities Source: https://dev.moysklad.ru/doc/api/remap/1.2 Use a GET request to fetch metadata for specific entity types. Filter by 'type' to limit the results to desired entities. ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/metadata?filter=type=product;type=service;type=demand" \ -H "Authorization: Bearer " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Complex Filtering Example Source: https://dev.moysklad.ru/doc/api/remap/1.2 Demonstrates how to apply multiple filter criteria in a single request, including date ranges, exact values, and multiple values for the same field. ```APIDOC ## Complex Filtering Example ### Description Examples of applying multiple filters in a single request. ### Request Example ``` GET https://api.moysklad.ru/api/remap/1.2/entity/demand?filter=moment>2016-10-11 12:00:00;moment<2016-10-11 13:00:00;sum=100;name=0010;name=0011 GET https://api.moysklad.ru/api/remap/1.2/entity/counterparty?filter=name=Иван;phone=89269269222;email=vanyan@mail.krut ``` ``` -------------------------------- ### Delete Entity to Trash Source: https://dev.moysklad.ru/doc/api/remap/1.2 Example of sending a POST request to move an entity to the trash. Requires appropriate employee rights and company settings for trash usage. ```curl curl --compressed -X POST \ "https://api.moysklad.ru/api/remap/1.2/entity/move/b8fe9f6b-f48f-11ed-ac1a-000d0000003a/trash" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Expand Related Objects in API Response Source: https://dev.moysklad.ru/doc/api/remap/1.2 Example of using the 'expand' parameter to retrieve related objects instead of just links. List the desired fields separated by commas. ```http Example: ?expand=agent ``` -------------------------------- ### Get Entity Metadata Source: https://dev.moysklad.ru/doc/api/remap/1.2 This endpoint allows you to retrieve metadata for various entities. You can filter the results to get metadata for specific entity types. ```APIDOC ## GET /entity/metadata ### Description Retrieves metadata for specified entity types. Allows filtering by entity type. ### Method GET ### Endpoint /entity/metadata ### Parameters #### Query Parameters - **filter** (string) - Optional - Filter criteria, e.g., `type=product;type=service`. ### Request Example ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/metadata?filter=type=product;type=service;type=demand" \ -H "Authorization: Bearer " \ -H "Accept-Encoding: gzip" ``` ### Response #### Success Response (200) - **service** (object) - Metadata for the 'service' entity. - **product** (object) - Metadata for the 'product' entity. - **demand** (object) - Metadata for the 'demand' entity. #### Response Example ```json { "service": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/product/metadata", "mediaType": "application/json" } }, "product": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/product/metadata", "mediaType": "application/json" } }, "demand": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/demand/metadata", "mediaType": "application/json" } } } ``` ``` -------------------------------- ### Get Custom Attribute Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves a specific custom attribute for Demand entities by its ID. ```APIDOC ## GET /api/remap/1.2/entity/demand/metadata/attributes/{id} ### Description Retrieves a specific custom attribute for Demand entities by its ID. ### Method GET ### Endpoint /api/remap/1.2/entity/demand/metadata/attributes/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the custom attribute to retrieve. Example: 7bc578d8-6501-11e8-9464-e4de00000004 ### Response #### Success Response (200) - **meta** (object) - Metadata of the attribute. - **id** (string) - The unique identifier of the attribute. - **name** (string) - The name of the attribute. - **type** (string) - The data type of the attribute (e.g., "string"). - **required** (boolean) - Indicates if the attribute is mandatory. - **show** (boolean) - Indicates if the attribute is displayed. - **description** (string) - A description of the attribute. ### Response Example ```json { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/demand/metadata/attributes/7bc578d8-6501-11e8-9464-e4de00000004", "type": "attributemetadata", "mediaType": "application/json" }, "id": "7bc578d8-6501-11e8-9464-e4de00000004", "name": "Строковое поле", "type": "string", "required": true, "show": true, "description": "Поле-строка" } ``` ``` -------------------------------- ### Get Employee Context Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves the context for an employee. This is useful for understanding employee-specific permissions and settings. ```APIDOC ## GET /context/employee/ ### Description Request to get the context of an employee. ### Method GET ### Endpoint /context/employee/ ### Request Example ```curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/context/employee/" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` ``` -------------------------------- ### Create Demand with Agent Expand Source: https://dev.moysklad.ru/doc/api/remap/1.2 Use this endpoint to create a new demand and include the agent's details by expanding the 'agent' field. Ensure you have the correct credentials and API endpoint. ```curl curl --compressed -X POST \ "https://api.moysklad.ru/api/remap/1.2/entity/demand?expand=agent" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" \ -H 'Content-Type: application/json' \ -d '{ "name": "0001", "organization": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/organization/850c8195-f504-11e5-8a84-bae50000015e", "type": "organization", "mediaType": "application/json" } }, "agent": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/counterparty/9794d400-f689-11e5-8a84-bae500000078", "type": "counterparty", "mediaType": "application/json" } }, "store": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/store/850ee995-f504-11e5-8a84-bae500000160", "type": "store", "mediaType": "application/json" } } }' ``` -------------------------------- ### Get Employee Information Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves detailed information about a specific employee, including their permissions and associated stores. ```APIDOC ## GET /entity/employee/{id} ### Description Retrieves detailed information about a specific employee. ### Method GET ### Endpoint /entity/employee/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the employee. ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **meta** (object) - Metadata about the response. - **id** (string) - The unique identifier of the employee. - **accountId** (string) - The identifier of the account the employee belongs to. - **owner** (object) - Information about the owner of the employee record. - **shared** (boolean) - Indicates if the employee record is shared. - **group** (object) - Information about the group the employee belongs to. - **updated** (string) - The timestamp when the employee record was last updated. - **name** (string) - The name of the employee. - **externalCode** (string) - An external code for the employee. - **archived** (boolean) - Indicates if the employee record is archived. - **created** (string) - The timestamp when the employee record was created. - **uid** (string) - The unique user ID of the employee. - **email** (string) - The email address of the employee. - **lastName** (string) - The last name of the employee. - **fullName** (string) - The full name of the employee. - **shortFio** (string) - The short form of the employee's name. - **cashiers** (array) - A list of cashier information associated with the employee. - **permissions** (object) - An object detailing the employee's permissions for various entities. #### Response Example ```json { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/employee/5bf6430e-204c-11ec-c0a8-300d00000042?expand=cashier.retailStore", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/employee/metadata", "type": "employee", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#employee/edit?id=5bf6430e-204c-11ec-c0a8-300d00000042" }, "id": "5bf6430e-204c-11ec-c0a8-300d00000042", "accountId": "59de7a4b-204c-11ec-c0a8-300e00000002", "owner": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/employee/5bf6430e-204c-11ec-c0a8-300d00000042", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/employee/metadata", "type": "employee", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#employee/edit?id=5bf6430e-204c-11ec-c0a8-300d00000042" } }, "shared": true, "group": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/group/59e4a97a-204c-11ec-c0a8-300e00000003", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/group/metadata", "type": "group", "mediaType": "application/json" } }, "updated": "2021-09-28 14:08:07.359", "name": "Администратор", "externalCode": "YuqqVXgviyQsimcElBCDl0", "archived": false, "created": "2021-09-28 14:08:07.359", "uid": "admin@f1", "email": "f@f.ru", "lastName": "Администратор", "fullName": "Администратор", "shortFio": "Администратор", "cashiers": [ { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/retailstore/5d9c8f7a-204c-11ec-c0a8-300d00000096/cashiers/5d9ce2d8-204c-11ec-c0a8-300d00000097", "type": "cashier", "mediaType": "application/json" } } ], "permissions": { "currency": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "uom": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "productfolder": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "product": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "bundle": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "service": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "consignment": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "variant": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "store": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "counterparty": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "organization": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "employee": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "settings": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "contract": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL", "print": "ALL" }, "project": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "country": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "customentity": { "view": "ALL", "create": "ALL", "update": "ALL", "delete": "ALL" }, "demand": { "view": "ALL", "create": "ALL", "update": "ALL" } } } ``` ``` -------------------------------- ### Expand with depth 2 Source: https://dev.moysklad.ru/doc/api/remap/1.2 This example demonstrates how to expand the 'agent' field of a nested 'demand' within a sales return, achieving a nesting level of two for the 'expand' parameter. The response will include the sales return with the expanded demand, and within that, the expanded agent object. ```APIDOC ## GET /entity/salesreturn/{id} ### Description Retrieves a sales return with nested entities expanded up to a specified depth. ### Method GET ### Endpoint /entity/salesreturn/{id}?expand={nested_field}.{nested_field} ### Parameters #### Query Parameters - **expand** (string) - Required - Specifies the fields to expand. Supports nested expansion, e.g., `demand.agent`. ### Request Example ```curl curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043?expand=demand.agent" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` ### Response #### Success Response (200) - **demand** (object) - Expanded demand object. - **agent** (object) - Expanded agent object within the demand. ``` -------------------------------- ### Get Employee Context Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves data about the employee making the request. This endpoint is accessible via the `/context/employee` path. ```APIDOC ## GET /context/employee ### Description Retrieves data about the employee making the request. ### Endpoint `/context/employee` ### Response #### Success Response (200) - **accountId** (UUID) - ID of the account. Required. Read-only. - **archived** (Boolean) - Whether the Employee is archived. Required. Read-only. - **attributes** (Array(Object)) - Additional fields of the Employee. Read-only. - **cashiers** (MetaArray) - Array of cashiers. Read-only. Expandable. - **code** (String(255)) - Employee code. Read-only. - **created** (DateTime) - Moment of Employee creation. Required. Read-only. - **description** (String(4096)) - Comment about the Employee. Read-only. - **email** (String(255)) - Employee's email address. Read-only. - **externalCode** (String(255)) - External Employee code. Required. Read-only. - **firstName** (String(255)) - First name. Read-only. - **fullName** (String(255)) - Full name (First Middle Last). Read-only. - **group** (Meta) - Employee's department. Required. Read-only. - **id** (UUID) - Employee ID. Required. Read-only. - **image** (Object) - Employee's photo. Read-only. - **inn** (String(255)) - Employee's INN (individual tax ID). Read-only. - **lastName** (String(255)) - Last name. Required. Read-only. - **meta** (Meta) - Employee metadata. Required. Read-only. - **middleName** (String(255)) - Middle name. Read-only. - **name** (String(255)) - Employee name. Required. Read-only. - **owner** (Meta) - Owner (Employee). Required. Read-only. - **permissions** (Object) - Employee's permissions. Required. Read-only. - **phone** (String(255)) - Employee's phone number. Read-only. - **position** (String(255)) - Employee's position. Read-only. - **shared** (Boolean) - Shared access. Required. Read-only. - **shortFio** (String(255)) - Short full name. Read-only. - **uid** (String(255)) - Employee login. Read-only. - **updated** (DateTime) - Moment of last Employee update. Required. Read-only. ### Response Example { "accountId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "archived": false, "created": "2023-10-27T10:00:00+00:00", "externalCode": "EXT123", "group": { "id": "g1h2i3j4-k5l6-7890-1234-567890abcdef", "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/group/g1h2i3j4-k5l6-7890-1234-567890abcdef", "type": "group", "mediaType": "application/json" }, "name": "Sales Department" }, "id": "e1f2a3b4-c5d6-7890-1234-567890abcdef", "lastName": "Doe", "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/context/employee", "type": "employee", "mediaType": "application/json" }, "name": "John Doe", "owner": { "id": "e1f2a3b4-c5d6-7890-1234-567890abcdef", "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/employee/e1f2a3b4-c5d6-7890-1234-567890abcdef", "type": "employee", "mediaType": "application/json" }, "name": "John Doe" }, "permissions": { "limit_api_access": true }, "shared": false, "uid": "johndoe", "updated": "2023-10-27T10:05:00+00:00" } ``` -------------------------------- ### Get Stock and Cost Information Source: https://dev.moysklad.ru/doc/api/remap/1.2 To retrieve stock and cost information for document positions, include the `fields=stock` parameter in your request. This is applicable to various documents like Sales, Customer Orders, and more. For certain documents, stock is calculated at the document's `moment`; for others, it's calculated at the current time. The `cost` field may be absent for returns without a basis. ```json { "stock": { "cost": 5000, "quantity": 999, "reserve": 90, "intransit": 9, "available": 918 } } ``` ```http /customerorder/{id документа}?fields=stock&expand=positions ``` ```http /customerorder?fields=stock&expand=positions&limit=100 ``` -------------------------------- ### Get Sales Returns with Shipment Expand Source: https://dev.moysklad.ru/doc/api/remap/1.2 Use this cURL command to fetch sales returns and include expanded shipment details. Set the 'limit' parameter to control the number of returned items. ```bash curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn?limit=100&expand=demand" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Sales Return Response Example Source: https://dev.moysklad.ru/doc/api/remap/1.2 This JSON object represents a successful response for a sales return request. It includes metadata, core sales return details, and expanded information for related entities like the owner, group, store, agent, organization, and the associated demand with its agent. Use this structure to understand the data returned when retrieving or creating sales return information. ```json { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043?expand=demand.agent", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/metadata", "type": "salesreturn", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#salesreturn/edit?id=685a0eb9-e707-11ef-ac12-000e00000043" }, "id": "685a0eb9-e707-11ef-ac12-000e00000043", "accountId": "a3816d8b-d7d4-11ef-ac12-001000000001", "owner": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/employee/a50d2d81-d7d4-11ef-ac12-000f00000051", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/employee/metadata", "type": "employee", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#employee/edit?id=a50d2d81-d7d4-11ef-ac12-000f00000051" } }, "shared": false, "group": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/group/a3832874-d7d4-11ef-ac12-001000000002", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/group/metadata", "type": "group", "mediaType": "application/json" } }, "updated": "2025-02-09 20:00:47.301", "name": "00002", "externalCode": "EMY-acmYh9LKG6GbGLvkY0", "moment": "2025-02-09 20:00:00.000", "applicable": true, "rate": { "currency": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/currency/a56cd0da-d7d4-11ef-ac12-000f000000a2", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/currency/metadata", "type": "currency", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#currency/edit?id=a56cd0da-d7d4-11ef-ac12-000f000000a2" } } }, "sum": 111100.0, "store": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/store/a56684d8-d7d4-11ef-ac12-000f0000009d", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/store/metadata", "type": "store", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#warehouse/edit?id=a56684d8-d7d4-11ef-ac12-000f0000009d" } }, "agent": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/counterparty/a56832b7-d7d4-11ef-ac12-000f000000a0", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/counterparty/metadata", "type": "counterparty", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#company/edit?id=a56832b7-d7d4-11ef-ac12-000f000000a0" } }, "organization": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/organization/a2a04526-e705-11ef-ac12-000e00000018", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/organization/metadata", "type": "organization", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#mycompany/edit?id=a2a04526-e705-11ef-ac12-000e00000018" } }, "created": "2025-02-09 20:00:47.329", "printed": false, "published": false, "files": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043/files", "type": "files", "mediaType": "application/json", "size": 0, "limit": 1000, "offset": 0 } }, "positions": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043/positions", "type": "salesreturnposition", "mediaType": "application/json", "size": 1, "limit": 1000, "offset": 0 } }, "vatEnabled": true, "vatIncluded": true, "vatSum": 0.0, "demand": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/demand/a6c50571-e705-11ef-ac12-000e0000001d?expand=agent", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/demand/metadata", "type": "demand", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#demand/edit?id=a6c50571-e705-11ef-ac12-000e0000001d" }, "id": "a6c50571-e705-11ef-ac12-000e0000001d", "accountId": "a3816d8b-d7d4-11ef-ac12-001000000001", "owner": { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/employee/a50d2d81-d7d4-11ef-ac12-000f00000051", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/employee/metadata", "type": "employee", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#employee/edit?id=a50d2d81-d7d4-11ef-ac12-000f00000051" } }, "shared": false, "group": { "meta": { } } } ``` -------------------------------- ### Request Sales Return with Expanded Demand (cURL) Source: https://dev.moysklad.ru/doc/api/remap/1.2 This cURL command demonstrates how to fetch a sales return entity and include its associated demand information by using the 'expand=demand' query parameter. Ensure you replace '' with your actual API authentication details. ```curl curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/salesreturn/685a0eb9-e707-11ef-ac12-000e00000043?expand=demand" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Get Demand Attributes Metadata Source: https://dev.moysklad.ru/doc/api/remap/1.2 Retrieves the metadata for custom attributes associated with demand entities. This is useful for understanding available attribute types and their configurations. ```curl curl --compressed -X GET \ "https://api.moysklad.ru/api/remap/1.2/entity/demand/metadata/attributes" \ -H "Authorization: Basic " \ -H "Accept-Encoding: gzip" ``` -------------------------------- ### Solution Context Response Source: https://dev.moysklad.ru/doc/api/remap/1.2 Successful response containing solution data, including its metadata, appUid, and id. ```json { "meta": { "href": "https://api.moysklad.ru/api/remap/1.2/entity/application/b58a6312-f958-11e9-ac12-000a00000020", "metadataHref": "https://api.moysklad.ru/api/remap/1.2/entity/application/metadata", "type": "application", "mediaType": "application/json" }, "appUid": "test.moysklad@reqwy1", "id": "b58a6312-f958-11e9-ac12-000a00000020" } ```