JSON API 1.1 — список изменений

Валюты

1.0:

{
   "currency": "RUB"
}

1.1:

{
 "currency": {
      "meta": {
        "href": "https://online.moysklad.ru/api/remap/1.1/entity/currency/${currency.id}",
        "metadataHref": "https://online.moysklad.ru/api/remap/1.1/entity/currency/metadata",
        "type": "currency",
        "mediaType": "application/json"
      }
    } 
}

Единицы измерения

1.0:

{
   "uom": "шт"
}

1.1:

{
 "uom": {
      "meta": {
        "href": "https://online.moysklad.ru/api/remap/1.1/entity/uom/${uom.id}",
        "metadataHref": "https://online.moysklad.ru/api/remap/1.1/entity/uom/metadata",
        "type": "uom",
        "mediaType": "application/json"
      }
    } 
}

Упаковки товара

1.0:

{
    "pack": {
      "id": "${pack_id}",
      "quantity": 10.0,
      "uom": "ящик"
    }
}

1.1:

{
    {
      "id": "${pack1.id}"
      "uom": {
        "meta": {
          "href": "https://online.moysklad.ru/api/remap/1.1/entity/uom/${uom1.id}",
          "metadataHref": "https://online.moysklad.ru/api/remap/1.1/entity/uom/metadata",
          "type": "uom",
          "mediaType": "application/json"
        }
      },
      "quantity": 5
    }
}

Атрибуты (дополнительные поля)

1.0:

{
[
  {
    "name": "customField",
    "type": "string",
    "value": "blablabla"
  },
  {
    "name": "Пользовательский",
    "type": "customentity",
    "value": {
      "name": "два"
    }
  },
  {
    "name": "[Сотрудник]",
    "type": "employee",
    "value": {
      "meta": {
        "href": "https://online.moysklad.ru/api/remap/1.0/entity/employee/${employee_id}",
        "type": "employee",
        "mediaType": "application/json"
      }
    }
  },
  {
    "name": "[Контрагент]",
    "type": "counterparty",
    "value": {
      "meta": {
        "href": "https://online.moysklad.ru/api/remap/1.0/entity/counterparty/${company_id}",
        "type": "counterparty",
        "mediaType": "application/json"
      }
    }
  }
]
}

1.1:

{
"attributes": [
    {
      "id": "${attribute1.id}",
      "name": "strAttr",
      "type" : "string",
      "value": "blablabla"
    },
    {
      "id": "${attribute2.id}",
      "name": "customAttr",
       "type": "customentity",
      "value": {
        "meta": {
          "href": "${json-unit.ignore}",
          "type": "customentity",
          "mediaType": "application/json"
        },
        "name": "два"
      }
    },
    {
      "id": "${customAttribute.id}",
      "name": "customAttrWithValue",
      "type": "customentity",
      "value": {
        "meta": {
          "href": "https://online.moysklad.ru/api/remap/1.1/entity/customentity/${customAttributeMetadata.id}/${customAttributeValue.id}",
          "type": "customentity",
          "mediaType": "application/json"
        },
        "name": "brbrbr"
      }
    },
    {
      "id": "${attribute3.id}",
      "name": "customEmployee",
      "value": {
        "meta": {
          "href": "https://online.moysklad.ru/api/remap/1.1/entity/employee/${employee_id}",
          "type": "employee",
          "mediaType": "application/json"
        }
      }
    },
    {
      "id": "${attribute4.id}",
      "name": "customAgent",
      "type": "company",
       "value": {
        "meta": {
          "href": "https://online.moysklad.ru/api/remap/1.1/entity/counterparty/${company_id}",
          "type": "counterparty",
          "mediaType": "application/json"
        }
      }
    }
  ]
}

Характеристики

1.0:

{
  "characteristics": {
    "память": "мало",
    "проц": "обычный"
  }
}

1.1:

{
  "characteristics": [
    {
      "meta": {
        "href": "${json-unit.ignore}",
        "type": "attributemetadata",
        "mediaType": "application/json"
      },
      "id": "${json-unit.ignore}",
      "name": "память",
      "value": "мало"
    },
    {
      "meta": {
        "href": "${json-unit.ignore}",
        "type": "attributemetadata",
        "mediaType": "application/json"
      },
      "id": "${json-unit.ignore}",
      "name": "проц",
      "value": "обычный"
    }
  ]
}

Позиции в операциях

1.0:

{
  [
  {
    "id": "${json-unit.ignore}",
    "accountId": "${json-unit.ignore}",
    "quantity": 1.0,
    "sum": 100000.0,
    "discount": 0.0,
    "vat": 0,
    "product": {
      "meta": {
        "href": "https://online.moysklad.ru/api/remap/1.0/entity/product/${product1_id}",
        "type": "product",
        "mediaType": "application/json"
      }
    },
    "reserve": 0.0
  },
  {
    "id": "${json-unit.ignore}",
    "accountId": "${json-unit.ignore}",
    "quantity": 1.0,
    "sum": 11000.0,
    "price": 11000.0,
    "discount": 0.0,
    "vat": 0,
    "product": {
      "meta": {
        "href": "https://online.moysklad.ru/api/remap/1.0/entity/product/${product2_id}",
        "type": "product",
        "mediaType": "application/json"
      }
    },
    "reserve": 0.0,
    "pack": {
      "id": "${pack_id}",
      "quantity": 10.0,
      "uom": "ящик"
    }
  }
]
}

1.1:

{
  "positions": [
    {
      "quantity": 1,
      "price": 100000,
      "assortment": {
        "meta": {
          "href": "https://online.moysklad.ru/api/remap/1.1/entity/variant/${variant1_id}",
          "type": "variant",
          "mediaType": "application/json"
        }
      }
    },
    {
      "quantity": 2,
      "price": 11000,
      "assortment": {
        "meta": {
          "href": "https://online.moysklad.ru/api/remap/1.1/entity/product/${product2_id}",
          "type": "product",
          "mediaType": "application/json"
        }
      },
      "pack" : {
        "id" : "${pack_id}"
      }
    }
  ]
}
Еще есть вопросы? Отправить запрос

Комментарии