POST UpdateCart
Create/Update a cart.
This feature must be enabled for your account.
Input and output parameters
*denotes required field.
Input Parameter Name |
Type/Info |
id |
id of the cart in the system, provide this if you want to update. |
api_reference_id* |
your reference to identify the cart, if no "id" is provided we'll use this to update your cart. |
contact_id |
ID of the contact in our system you want to assign the cart to. Without we'll use "customer_email" to assign the contact. |
recover_cart_url |
Where the contact in your system can load their cart. This can be embedded into our emails. |
order_id |
ID of the order in our system to associate the cart to. |
external_order_id |
Your order ID, we'll use this to match against order and assign order_id for you. |
cart_create_date |
When your cart was created YYYY-MM-DDTHH:MM:SSZ. |
cart_update_date |
When your cart was updated YYYY-MM-DDTHH:MM:SSZ. |
confirmed_is_abandoned |
Define this cart as abandoned, we'll define the "date_confirmed_is_abandoned". Alteratively you can enable a process in the CRM that will automatically assign this value. |
is_active |
Is the cart still in an active state. Making inactive will prevent automations from processing this record. |
total |
Total worth of the cart. |
total_inc_tax |
Total worth of the cart including tax. |
iso_currency_code |
ISO alpha 3 currency code. |
abandoned_total |
Total cart value when abandoned. |
abandoned_total_with_discount |
Total cart value with discount applied. |
abandoned_total_discount |
Discount applied to abandoned cart. |
customer_email* |
Email address to the customer, without a contact_id, we'll use this to assign to the contact. |
customer_firstname |
Customer first name. |
customer_lastname |
Customer last name. |
customer_gender |
Customer's gender. |
customer_telephone |
Customer's contact number. |
customer_mobile |
Customer's contact mobile number. |
customer_dob |
Customer's date of birth YYYY-MM-DD. |
customer_is_guest |
Is this a guest checkout. |
customer_notes |
Any further info about the customer. |
billing_first_name |
Billing first name. |
billing_last_name |
Billing last name. |
billing_address1 |
Billing address line 1. |
billing_address2 |
Billing address line 2. |
billing_city |
Billing address city. |
billing_county |
Billing address county. |
billing_post_code |
Billing address post-code. |
billing_country |
Billing address country. |
shipping_first_name |
Shipping first name. |
shipping_last_name |
Shipping last name. |
shipping_address1 |
Shipping address line 1. |
shipping_address2 |
Shipping address line 2. |
shipping_city |
Shipping address city. |
shipping_county |
Shipping address county. |
shipping_post_code |
Shipping address post-code. |
shipping_country |
Shipping address country. |
cart_lines* |
Array of data:
- cart_line_id - Your cart reference.
- product_sku - Your product SKU.
- product_name - Your product name.
- product_description - Your product description.
- tax_percent - Tax charged.
- product_price - Price for product.
- product_price_tax - Tax charged to product.
- product_price_inc_tax - Product price with tax.
- product_original_price - Original product price (rrp).
- quantity - Number stocked.
- row_total - Cost for the cart line.
- row_total_inc_tax - Cost for the cart line with tax.
- abandoned_row_total - total row value of abandoned cart line.
- abandoned_row_total_with_discount - total row value with discount applied.
- abandoned_row_total_discount - total row discount applied for abandoned row.
|
custom_fields |
Array of key value pairs for any custom fields data
Key is the field name then value assigned:
|
|
Outputs: |
|
- id - system id for the cart
- status - http status code
- message - created|updated
- error - only present during failure
|
Examples
curl --request POST \
--url https://api.wiredplus.com/v1/UpdateCart \
--header 'content-type: application/json' \
--data '{"id":"abc","api_integration":"IntegrationName","api_resource":"cart","api_reference_id":"1234","contact_id":999,"recover_cart_url": "https://yoursite.com/path/to/contact-cart","order_id":"999","external_order_id":"abc-1020","create_date":"2019-12-1113:01:22","update_date":"2020-01-1008:42:27","cart_create_date":"2019-12-1113:00:00","cart_update_date":"2020-01-1008:42:27","confirmed_is_abandoned":false,"date_confirmed_is_abandoned":null,"is_active":true,"total":21.00,"total_inc_tax":27.00,"iso_currency_code":"GBR","customer_email":"foo@bar.com","customer_firstname":"Foo","customer_lastname":"Bar","customer_gender":"Male","customer_telephone":"1122334455","customer_mobile":"5544332211","customer_dob":"1992-02-01","customer_is_guest":false,"customer_notes":null,"billing_first_name":"Foo","billing_last_name":"Bar","billing_address1":"Unit2","billing_address2":"KestrelCourt","billing_city":"Hapton","billing_county":"Lancashire","billing_post_code":"BB115NA","billing_country":"UnitedKingdom","shipping_first_name":"Foo","shipping_last_name":"Bar","shipping_address1":"Unit2","shipping_address2":"KestrelCourt","shipping_city":"Hapton","shipping_county":"Lancashire","shipping_post_code":"BB115NA","shipping_country":"UnitedKingdom","cart_lines":[{"id":"xyz","cart_id":"abc","create_date":"2019-12-1113:01:22","update_date":"2020-01-1008:42:27","cart_line_id":20,"product_id":"aaabb1122","product_sku":"aabb-1122","product_name":"Myproduct","product_description":"Detailsaboutmyproduct","tax_percent":20.00,"product_price_tax":2.00,"product_original_price":7.00,"product_price":7.00,"product_price_inc_tax":9.00,"quantity":3,"row_total":21.00,"row_total_inc_tax":28.00}]}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.wiredplus.com/v1/UpdateCart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{"id":"abc","api_integration":"IntegrationName","api_resource":"cart","api_reference_id":"1234","contact_id":999,"recover_cart_url": "https://yoursite.com/path/to/contact-cart","order_id":"999","external_order_id":"abc-1020","create_date":"2019-12-1113:01:22","update_date":"2020-01-1008:42:27","cart_create_date":"2019-12-11T13:00:00Z","cart_update_date":"2020-01-10T08:42:27Z","confirmed_is_abandoned":false,"date_confirmed_is_abandoned":null,"is_active":true,"total":21.00,"total_inc_tax":27.00,"iso_currency_code":"GBR","customer_email":"foo@bar.com","customer_firstname":"Foo","customer_lastname":"Bar","customer_gender":"Male","customer_telephone":"1122334455","customer_mobile":"5544332211","customer_dob":"1992-02-01","customer_is_guest":false,"customer_notes":null,"billing_first_name":"Foo","billing_last_name":"Bar","billing_address1":"Unit2","billing_address2":"KestrelCourt","billing_city":"Hapton","billing_county":"Lancashire","billing_post_code":"BB115NA","billing_country":"UnitedKingdom","shipping_first_name":"Foo","shipping_last_name":"Bar","shipping_address1":"Unit2","shipping_address2":"KestrelCourt","shipping_city":"Hapton","shipping_county":"Lancashire","shipping_post_code":"BB115NA","shipping_country":"UnitedKingdom","cart_lines":[{"id":"xyz","cart_id":"abc","create_date":"2019-12-1113:01:22","update_date":"2020-01-1008:42:27","cart_line_id":20,"product_id":"aaabb1122","product_sku":"aabb-1122","product_name":"Myproduct","product_description":"Detailsaboutmyproduct","tax_percent":20.00,"product_price_tax":2.00,"product_original_price":7.00,"product_price":7.00,"product_price_inc_tax":9.00,"quantity":3,"row_total":21.00,"row_total_inc_tax":28.00}]}',
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = {
"id": "abc",
"api_integration": "IntegrationName",
"api_resource": "cart",
"api_reference_id": "1234",
"contact_id": 999,
"recover_cart_url": "https://yoursite.com/path/to/contact-cart",
"order_id": "999",
"external_order_id": "abc-1020",
"create_date": "2019-12-11 13:01:22",
"update_date": "2020-01-10 08:42:27",
"cart_create_date": "2019-12-11T13:00:00Z",
"cart_update_date": "2020-01-10T08:42:27Z",
"confirmed_is_abandoned": false,
"date_confirmed_is_abandoned": null,
"is_active": true,
"total": 21.00,
"total_inc_tax": 27.00,
"iso_currency_code": "GBR",
"customer_email": "foo@bar.com",
"customer_firstname": "Foo",
"customer_lastname": "Bar",
"customer_gender": "Male",
"customer_telephone": "1122334455",
"customer_mobile": "5544332211",
"customer_dob": "1992-02-01",
"customer_is_guest": false,
"customer_notes": null,
"billing_first_name": "Foo",
"billing_last_name": "Bar",
"billing_address1": "Unit 2",
"billing_address2": "Kestrel Court",
"billing_city": "Hapton",
"billing_county": "Lancashire",
"billing_post_code": "BB11 5NA",
"billing_country": "United Kingdom",
"shipping_first_name": "Foo",
"shipping_last_name": "Bar",
"shipping_address1": "Unit 2",
"shipping_address2": "Kestrel Court",
"shipping_city": "Hapton",
"shipping_county": "Lancashire",
"shipping_post_code": "BB11 5NA",
"shipping_country": "United Kingdom",
"cart_lines": [
{
"id": "xyz",
"cart_id": "abc",
"create_date": "2019-12-11 13:01:22",
"update_date": "2020-01-10 08:42:27",
"cart_line_id": 20,
"product_id": "aaabb1122",
"product_sku": "aabb-1122",
"product_name": "My product",
"product_description": "Details about my product",
"tax_percent": 20.00,
"product_price_tax": 2.00,
"product_original_price": 7.00,
"product_price": 7.00,
"product_price_inc_tax": 9.00,
"quantity": 3,
"row_total": 21.00,
"row_total_inc_tax": 28.00
}
]
};
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.wiredplus.com/v1/UpdateCart",
"method": "POST",
"headers": {},
"processData": false,
"contentType": false,
"mimeType": "application/json",
"data": JSON.stringify(data)
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Result Format JSON