Skip to content

Runtime_UpdateBilling#


Description#

This function allows you to update the billing 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 Boolean Returns false or true. If false, 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 and tax 2. Missing shipping 3. Missing Tax

Note

Content-Type for the request must be ‘application/json’

Example Request#

{
    "Store_code": "beta",
    "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
    }
}