Runtime_UpdateShipping
#
Description#
This function allows you to update the shipping address in a runtime checkout session. Address Validation should be done separately using the Runtime_ValidateAddress
function.
Request Body Parameters#
Parameter |
Type | Description |
---|---|---|
Session_Type |
String | This will always be runtime |
Session_ID |
String | The Session ID of the basket |
Update_Customer |
Boolean | If true the associated customer record will be updated |
Address_ID |
Number | The Customer Address ID that you want to update shipping with. All other address fields must be blank. |
FirstName |
String | Shipping First Name |
LastName |
String | Shipping Last Name |
Email |
String | Shipping Email Address |
Phone |
String | Shipping Phone Number |
Address1 |
String | Shipping Address line one |
Address2 |
String | Shipping Address line two |
City |
String | Shipping City |
State |
String | Shipping State |
Zip |
String | Shipping Zip Code |
Country |
String | Shipping Country Code |
Response Parameters#
Parameter |
Type | Description |
---|---|---|
success |
Boolean | Boolean value for if the request was successful |
total |
Number | Basket total |
subtotal |
Number | Basket Subtotal |
formatted_total |
String | Currency formatted total |
formatted_subtotal |
String | Currency formatted subtotal |
ready_for_checkout |
Number | Returns 0 or 1 . If 0 , a ready_for_checkout_reason will be provided |
ready_for_checkout_reason |
String | Reason session is not ready for checkout. Possible reasons include: 1. Missing shipping 2. Missing Tax 3. Missing shipping and tax |
charges |
Object | Object containing the basket charges array (added in Version 10.10.01) |
charges
Object#
Parameter |
Type | Description |
---|---|---|
type |
String | Specifies the type of charge, such as “Shipping”, “Handling”, or “Tax”. |
descrip |
String | Provides a short description or label for the charge. |
amount |
Number | The raw amount of the charge |
disp_amt |
Number | The amount to be displayed to the user, often identical to amount unless modified for display. |
tax_exempt |
Boolean | Indicates whether the charge is tax-exempt (true ) or taxable (false ). |
tax |
Number | The tax amount associated with the charge, if applicable. |
formatted_amount |
String | The formatted version of amount as a string. |
formatted_disp_amt |
String | The formatted version of disp_amt . |
formatted_tax |
String | The formatted version of the tax field as a string. |
Note
Content-Type for the request must be ‘application/json’
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Runtime_UpdateShipping",
"Session_Type": "runtime",
"Session_ID": "b65e340b3fb23e4b30e3ac3ddde33680",
"Address_ID": 1,
"Update_Customer": true,
"FirstName": "John",
"LastName": "Doe",
"Email": "jdoe@miva.com",
"Phone": "654-456-7894",
"Address1": "16745 W. Bernardo Dr, Fourth Floor",
"City": "San Diego",
"State": "CA",
"Zip": "92127",
"Country": "US"
}
Example Response#
{
"success": 1,
"data": {
"total": 328.75,
"subtotal": 300.0,
"formatted_total": "$328.75",
"formatted_subtotal": "$300.00",
"ready_for_checkout": true,
"charges":
[
{
"type": "TAX",
"descrip": "Tax",
"amount": 12.34,
"disp_amt": 12.34,
"tax_exempt": true,
"tax": 0.00,
"formatted_amount": "$12.34",
"formatted_disp_amt": "$12.34",
"formatted_tax": "$0.00"
}
]
}
}