UpdateItem

Description

The UpdateItem method modifies an existing ItemDetails object in the EBizCharge platform.

Syntax

ItemDetailsResponse UpdateItem(SecurityToken securityToken, ItemDetails itemDetails, string itemInternalId, string itemId)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

A unique token that is used to identify a merchant and authenticate the API request.

ItemDetails

itemDetails

R

The updated ItemDetails object that replaces the existing object.

Warning: Omitting a field clears its value.

Required Fields
  • UnitPrice
  • UnitCost
  • Active
  • QtyOnHand
  • Taxable
  • TaxRate

string

itemInternalId

D

Internal ID automatically assigned by EBizCharge for the ItemDetails object.

Note: Required if itemId is not included.

string

itemId

D

Custom ID assigned by the user for the ItemDetails object.

Note: Required if itemInternalId is not included.

Return Value

TypeDescription
ItemDetailsResponseReturns the update status, status code, and any associated error details.

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:UpdateItem>
         <ebiz:securityToken>
            <ebiz:SecurityId>*************-4621-b899-************</ebiz:SecurityId>
            <ebiz:UserId />
            <ebiz:Password />
         </ebiz:securityToken>
         <ebiz:itemDetails>
            <ebiz:ItemId />
            <ebiz:Name />
            <ebiz:SKU />
            <ebiz:UPC />
            <ebiz:Description />
            <ebiz:UnitPrice>2100</ebiz:UnitPrice>
            <ebiz:UnitCost>900</ebiz:UnitCost>
            <ebiz:UnitOfMeasure />
            <ebiz:Active>true</ebiz:Active>
            <ebiz:ItemType />
            <ebiz:QtyOnHand>19</ebiz:QtyOnHand>
            <ebiz:Taxable>true</ebiz:Taxable>
            <ebiz:TaxRate>10</ebiz:TaxRate>
            <ebiz:SoftwareId />
            <ebiz:ItemCategoryId />
            <ebiz:ItemNotes />
            <ebiz:ItemUniqueId />
            <ebiz:ImageUrl />
            <ebiz:TaxCategoryID />
            <ebiz:ItemCustomFields>
               <ebiz:EbizCustomField>
                  <ebiz:FieldId />
                  <ebiz:FieldCaption />
                  <ebiz:FieldName />
                  <ebiz:FieldValue />
                  <ebiz:FieldType />
                  <ebiz:FieldDataType />
                  <ebiz:FieldDescription />
               </ebiz:EbizCustomField>
            </ebiz:ItemCustomFields>
            <ebiz:DivisionId />
            <ebiz:LocationId />
         </ebiz:itemDetails>
         <ebiz:itemInternalId>*************-4794-8bdc-************</ebiz:itemInternalId>
         <ebiz:itemId />
      </ebiz:UpdateItem>
   </soapenv:Body>
</soapenv:Envelope>
private static void UpdateItem()
    {
        IeBizService apiClient = new IeBizServiceClient();
        SecurityToken securityToken = new SecurityToken
        {
            SecurityId = "*******-c870-41b8-aa5c-********", // Replace with your actual token
            UserId = "",
            Password = ""
        };
        string itemId = "P-0001";
        string itemInternalId = "";
        //Create the Terms object with updated information
        ItemDetails itemDetails = new ItemDetails();
        itemDetails.Name = "Sample Item";
        itemDetails.SKU = "";
        itemDetails.UPC = "";
        itemDetails.Description = "";
        itemDetails.UnitPrice = 10;
        itemDetails.UnitCost = 10;
        itemDetails.UnitOfMeasure = "m";
        itemDetails.Active = true;
        itemDetails.ItemType = "Inventory";
        itemDetails.QtyOnHand = 100;
        itemDetails.Taxable = true;
        itemDetails.TaxRate = 0;
        itemDetails.SoftwareId = "";
        itemDetails.ItemCategoryId = "";
        itemDetails.ItemNotes = "";
        itemDetails.DateTimeCreated = DateTime.Now.ToString();
        itemDetails.DateTimeModified = "";
        itemDetails.ItemUniqueId = "";
        itemDetails.ImageUrl = "";
        itemDetails.ItemLastSyncDateTime = "";
        itemDetails.DivisionId = "";
        itemDetails.LocationId = "";
        ItemDetailsResponse response = apiClient.UpdateItem(securityToken, itemDetails, itemInternalId, itemId);
        //Display results
        Console.WriteLine($"Status: {response.Status}");
        Console.WriteLine($"Status Code: {response.StatusCode}");
        Console.WriteLine($"Error: {response.Error}");
        Console.WriteLine($"Error Code: {response.ErrorCode}");
        Console.ReadLine();
    }
}
function updateItem(){
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-4567457-777',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$itemDetails = array(
'ItemId' => 1,
'Name' => 'AC',
'SKU' => 'Tets-123',
'Description' => 'Test',
'UnitPrice' => 12,
'UnitCost' => '0',
'UnitOfMeasure' => '',
'Active' => 1,
'ItemType' => 1,
'QtyOnHand' => 12,
'UPC' => '',
'Taxable' => '0',
'TaxRate' => '0',
'ItemCategoryId' => '',
'TaxCategoryID' => '',
'ImageUrl' => '',
'ItemNotes' => '',
'GrossPrice' => 0,
'WarrantyDiscount' => 0,
'SalesDiscount' => 0
);
$updateItem = array(
'securityToken' => $securityToken,
'itemDetails' => $itemDetails,
'itemId' => 1,
'itemInternalId' => 12
);
$updateItemResponse = $client->UpdateItem($updateItem);
$updateItemResponseResult = $updateItemResponse->UpdateItemResult;
}

Example Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <UpdateItemResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateItemResult>
            <ItemInternalId>*************-4794-8bdc-************</ItemInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </UpdateItemResult>
      </UpdateItemResponse>
   </s:Body>
</s:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <UpdateItemResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateItemResult>
            <ItemInternalId/>
            <Status>Error</Status>
            <StatusCode>0</StatusCode>
            <Error>Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</Error>
            <ErrorCode>10</ErrorCode>
         </UpdateItemResult>
      </UpdateItemResponse>
   </s:Body>
</s:Envelope>