POST api/BuyHistories

Request Information

URI Parameters

None.

Body Parameters

BuyHistory
NameDescriptionTypeAdditional information
Id

integer

None.

ProductId

integer

None.

BuyAt

date

None.

TotalQuantity

decimal number

None.

BalanceQuantity

decimal number

None.

TotalPrice

decimal number

None.

UnitPrice

decimal number

None.

ProductAge

integer

None.

ExpiredAt

date

None.

FarmId

integer

None.

OwnerId

integer

None.

VendorId

integer

None.

Comment

string

None.

CreatedAt

date

None.

UpdatedAt

date

None.

DeletedAt

date

None.

DeletedBy

integer

None.

CreatedBy

integer

None.

UpdatedBy

integer

None.

DeletedStatus

boolean

None.

CompanyBatchNo

string

None.

Product

Product

None.

BuyHistoryPictures

Collection of BuyHistoryPicture

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "ProductId": 2,
  "BuyAt": "2025-12-06T10:21:50.9536974+06:00",
  "TotalQuantity": 3.0,
  "BalanceQuantity": 4.0,
  "TotalPrice": 5.0,
  "UnitPrice": 6.0,
  "ProductAge": 7,
  "ExpiredAt": "2025-12-06T10:21:50.9536974+06:00",
  "FarmId": 8,
  "OwnerId": 9,
  "VendorId": 10,
  "Comment": "sample string 11",
  "CreatedAt": "2025-12-06T10:21:50.9536974+06:00",
  "UpdatedAt": "2025-12-06T10:21:50.9536974+06:00",
  "DeletedAt": "2025-12-06T10:21:50.9536974+06:00",
  "DeletedBy": 14,
  "CreatedBy": 15,
  "UpdatedBy": 16,
  "DeletedStatus": true,
  "CompanyBatchNo": "sample string 18",
  "Product": {
    "Id": 1,
    "ProductTypeId": 2,
    "Title": "sample string 3",
    "SystemName": "sample string 4",
    "MeasurementUnitId": 5,
    "HasAgeCount": true,
    "HasExpiredDate": true,
    "AgeCountUnitId": 8,
    "ForBuy": true,
    "UnitPrice": 10.0,
    "ForSale": true,
    "OwnerId": 12,
    "ActiveStatus": true,
    "DisplayOrder": 14,
    "CreatedAt": "2025-12-06T10:21:50.9536974+06:00",
    "UpdatedAt": "2025-12-06T10:21:50.9536974+06:00",
    "DeletedAt": "2025-12-06T10:21:50.9536974+06:00",
    "DeletedBy": 17,
    "CreatedBy": 18,
    "UpdatedBy": 19,
    "DeletedStatus": true,
    "IsCommonItem": true,
    "IsCompanyRequired": true,
    "BuyHistories": [],
    "CategoryToProductMappings": [
      {
        "Id": 1,
        "ProductId": 2,
        "CategoryId": 3,
        "IsFeaturedProduct": true,
        "DisplayOrder": 5,
        "Category": {
          "Id": 1,
          "Name": "sample string 2",
          "SystemName": "sample string 3",
          "PictureUrl": "sample string 4",
          "ParentCategoryId": 5,
          "IconPath": "sample string 6",
          "DisplayOrder": 7,
          "ActiveStatus": true,
          "CategoryToProductMappings": []
        }
      },
      {
        "Id": 1,
        "ProductId": 2,
        "CategoryId": 3,
        "IsFeaturedProduct": true,
        "DisplayOrder": 5,
        "Category": {
          "Id": 1,
          "Name": "sample string 2",
          "SystemName": "sample string 3",
          "PictureUrl": "sample string 4",
          "ParentCategoryId": 5,
          "IconPath": "sample string 6",
          "DisplayOrder": 7,
          "ActiveStatus": true,
          "CategoryToProductMappings": []
        }
      }
    ],
    "MeasurementUnit": {
      "Id": 1,
      "Title": "sample string 2",
      "SystemName": "sample string 3",
      "OrderSerial": 4,
      "ActiveStatus": true,
      "Products": []
    },
    "Pictures": [
      {
        "Id": 1,
        "PictureUrl": "sample string 2",
        "ActiveStatus": true,
        "DisplayOrder": 4,
        "ProductId": 5
      },
      {
        "Id": 1,
        "PictureUrl": "sample string 2",
        "ActiveStatus": true,
        "DisplayOrder": 4,
        "ProductId": 5
      }
    ],
    "ProductType": {
      "Id": 1,
      "Title": "sample string 2",
      "SystemName": "sample string 3",
      "OrderSerial": 4,
      "ActiveStatus": true,
      "ForBuy": true,
      "ForSale": true,
      "IconPath": "sample string 8",
      "BirdTypeMapping": "sample string 9",
      "Products": []
    },
    "ProductUses": [
      {
        "Id": 1,
        "ProductId": 2,
        "UsedAt": "2025-12-06T10:21:50.9536974+06:00",
        "TotalAmount": 4.0,
        "BatchInfoId": 5,
        "FarmId": 6,
        "OwnerId": 7,
        "CreatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "UpdatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedBy": 10,
        "CreatedBy": 11,
        "UpdatedBy": 12,
        "DeletedStatus": true
      },
      {
        "Id": 1,
        "ProductId": 2,
        "UsedAt": "2025-12-06T10:21:50.9536974+06:00",
        "TotalAmount": 4.0,
        "BatchInfoId": 5,
        "FarmId": 6,
        "OwnerId": 7,
        "CreatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "UpdatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedBy": 10,
        "CreatedBy": 11,
        "UpdatedBy": 12,
        "DeletedStatus": true
      }
    ],
    "SellHistories": [
      {
        "Id": 1,
        "ProductId": 2,
        "SellAt": "2025-12-06T10:21:50.9536974+06:00",
        "Quantity": 4.0,
        "TotalPrice": 5.0,
        "UnitPrice": 6.0,
        "FarmId": 7,
        "OwnerId": 8,
        "BuyerId": 9,
        "Comment": "sample string 10",
        "CreatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "UpdatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedBy": 13,
        "CreatedBy": 14,
        "UpdatedBy": 15,
        "DeletedStatus": true
      },
      {
        "Id": 1,
        "ProductId": 2,
        "SellAt": "2025-12-06T10:21:50.9536974+06:00",
        "Quantity": 4.0,
        "TotalPrice": 5.0,
        "UnitPrice": 6.0,
        "FarmId": 7,
        "OwnerId": 8,
        "BuyerId": 9,
        "Comment": "sample string 10",
        "CreatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "UpdatedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedAt": "2025-12-06T10:21:50.9536974+06:00",
        "DeletedBy": 13,
        "CreatedBy": 14,
        "UpdatedBy": 15,
        "DeletedStatus": true
      }
    ]
  },
  "BuyHistoryPictures": [
    {
      "Id": 1,
      "BuyHistoryId": 1,
      "PictureUrl": "sample string 2",
      "IsActive": true
    },
    {
      "Id": 1,
      "BuyHistoryId": 1,
      "PictureUrl": "sample string 2",
      "IsActive": true
    }
  ]
}

application/xml

Sample:

Sample not available.

text/xml

Sample:

Sample not available.

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.