WEBCentralizedShoppingCartRefresh
Initial Build |
2008.01 |
xWEB |
Web Method |
Response Type |
object |
This method can be used to refresh the Shopping Cart Object after any key properties are altered. This can be called at any time during the shopping process but would most commonly be used if a customer is changed, address keys are changed, or anything else that may affect pricing is changed.
Parameters
oCentralizedOrderEntry (Shopping Cart Object).
Response
A refreshed Shopping Cart Object.
Update Billing Address
If you need to update the billing address of the invoice, update the <inv_cxa_key> property in the <Invoice> node to that of an address of the same customer as <inv_cst_billing_key>. When the method returns a refreshed Order Entry object, the change will be reflected in the <Billing_Address> and <Billing_Adr> nodes.
If you need to change an existing address of <inv_cxa_key>, you can do so by calling WEBAddressUpdate. To update the addresses in the Shopping Cart Object, you'll need to blank out certain values in order to following to force the Cart to reload the address:
// Cart is a CentralizedOrderEntry object:Cart.Billing_Address.cxa_key = String.Empty;Cart.Billing_Adr.adr_key = String.Empty;
The reason for doing this is because the WEBCentralizedShoppingCartRefresh method only refreshes based on properties that have been altered in the Cart's actual properties. The method doesn't "know" that the Address was updated independently and therefore it does not automatically reload the address data. The reason for this is because there can be times you will need to update certain properties in the Cart but you might not want all of them to be overwritten by the Refresh method, only those properties that should be overwritten based on, for example, changing the Bill-To Customer Key.
Update Bill to Customer
If you need to update the bill-to customer, then update the <inv_cst_billing_key> with a valid Customer Key. When the method returns a refreshed Order Entry object, the change will be reflected in the <BillToCustomer> node. If you do update the bill to customer, you also need to update the <inv_cxa_key> as described in Update Bill Address to be that of a valid address for the new billing customer.
Update Ship-To Customer
See Selective Items in the Cart
Update Shipping Address
All Items in Cart
If you want to update the Ship-To Address for all items in the order to a different shipping address than the default, then you have three options:
- Change it to a different existing Address (for example, ship to home instead of work).
- Add a new Address and make that the ship-to Address for the order.
- Update the current Address using WEBAddressUpdate independently from the Shopping Cart Object (making sure that the customer doesn't overwrite what is a currently valid address - this should only be done in the case of someone updating an outdated or incorrect address).
If you have a new cxa_key (primary key for a customer address) for a new or different address (options #1 and #2 above), then set the <InvoiceDetail.ivd_cxa_key> property to that of the address to which all items in the order should be shipped and then call the WEBCentralizedShoppingCartRefresh method to update the Cart.
If you did option #3 above, then you need to force-change a reload of the shipping address in the cart by blanking out the value of <InvoiceDetail.ivd_cxa_key>. Set the value of the property to the empty string and then call the WEBCentralizedShoppingCartRefresh method. Doing so will re-populate that key and load the update shipping address.
Following the steps above will update each item's ship-to address in the Cart, as well as refresh the Default Shipping Address of the Cart.
Selective Items in the Cart
The Ship-To address can be set at each <InvoiceDetailStatic> in the <Invoice_DetailCollection>. Each invoice detail can be shipped to a different customer and a different address of that customer, although in most cases there will be one overall customer and ship-to address for an ordinary order. To change the ship-to customer and/or ship-to address, update the <ivd_cst_ship_key> and <ivd_cxa_key> respectively for the particular InvoiceDetailStatic, then call this method. See Invoice Detail for more information.
Sample Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<ns:Token>*****</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:WEBCentralizedShoppingCartRefresh>
<ns:oCentralizedOrderEntry>
[[Shopping Cart Object]]
</ns:oCentralizedOrderEntry>
</ns:WEBCentralizedShoppingCartRefresh>
</soapenv:Body>
</soapenv:Envelope>
Sample Response
<<SAMPLE RESPONSE>>