AddItem

Description

This method is used to add a new item/product to EBizCharge.

Syntax

ItemDetailsResponse AddItem(SecurityToken securityToken, ItemDetails itemDetails);

Arguments

TypeNameDescription
SecurityTokensecurityTokenMerchant security token: used to identify merchant and validate transaction. (required)
ItemDetailsitemDetailsItem details. (required)

Return Value

TypeDescription
ItemDetailsResponseReturns the item details response

Examples

function addItem(){
$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
);
$addItem = array(
'securityToken' => $securityToken,
'itemDetails' => $itemDetails
)
$addItemResponse = $client->AddItem($addItem);
$addItemResponseResult = $addItemResponse->AddItemResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header />
   <soapenv:Body>
      <ebiz:AddItem>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-55ee-434c-b126-f630f2486a2d</ebiz:SecurityId>
            <ebiz:UserId />
            <ebiz:Password />
         </ebiz:securityToken>
         <ebiz:itemDetails>
            <ebiz:ItemInternalId />
            <ebiz:ItemId>P-0001</ebiz:ItemId>
            <ebiz:Name>Desk</ebiz:Name>
            <ebiz:SKU />
            <ebiz:UPC />
            <ebiz:Description>Sturdy desk</ebiz:Description>
            <ebiz:UnitPrice>10</ebiz:UnitPrice>
            <ebiz:UnitCost>12</ebiz:UnitCost>
            <ebiz:UnitOfMeasure>m</ebiz:UnitOfMeasure>
            <ebiz:Active>1</ebiz:Active>
            <ebiz:ItemType />
            <ebiz:QtyOnHand>1000</ebiz:QtyOnHand>
            <ebiz:Taxable>true</ebiz:Taxable>
            <ebiz:TaxRate>10</ebiz:TaxRate>
            <ebiz:SoftwareId>AX</ebiz:SoftwareId>
            <ebiz:ItemCategoryId />
            <ebiz:ItemNotes>?</ebiz:ItemNotes>
            <ebiz:DateTimeCreated />
            <ebiz:DateTimeModified />
            <ebiz:ItemUniqueId />
            <ebiz:ImageUrl />
            <ebiz:TaxCategoryID>?</ebiz:TaxCategoryID>
            <ebiz:ItemLastSyncDateTime />
            <ebiz:DivisionId />
            <ebiz:LocationId />
         </ebiz:itemDetails>
      </ebiz:AddItem>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <AddItemResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <AddItemResult>
            <ItemInternalId>********-a07c-48ad-bdc0-7e9533ff5477</ItemInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error />
            <ErrorCode>0</ErrorCode>
         </AddItemResult>
      </AddItemResponse>
   </s:Body>
</s:Envelope>