Get cart
curl --request GET \
--url https://api.wizcommerce.com/v1/carts/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.wizcommerce.com/v1/carts/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.wizcommerce.com/v1/carts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wizcommerce.com/v1/carts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wizcommerce.com/v1/carts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wizcommerce.com/v1/carts/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/carts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "000048fc-c17e-4524-a684-0709c009e353",
"customer_id": "4bd02cd3-06d2-498a-9749-b4f87faeccd7",
"order_id": "691aba0b-de2e-442a-9a3c-e782550e536a",
"name": "New Cart",
"type": "cart",
"cart_status": "open",
"cart_total": 220,
"currency_code": "USD",
"price_list": {
"id": "3e6b41c3-2e17-4395-87ce-74699590aa0b",
"name": "Default Price List"
},
"applied_promotion": {
"id": "<string>",
"name": "<string>",
"reference_id": "<string>",
"promo_code": "<string>"
},
"assigned_sales_reps": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"department": "Sales",
"status": "active",
"created_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"updated_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"created_by": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "user@example.com"
},
"updated_by": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "user@example.com"
},
"created_at": "2024-06-24T18:45:35Z",
"updated_at": "2024-10-09T08:52:27Z",
"items": [
{
"id": "0000105c-f8ef-4289-b501-441ddc09e9dd",
"product_id": "95458b31-5398-42cb-98ed-69cce35eed81",
"sku": "BH1841-320",
"name": "EMILIE 5'0\" Q FOOTBOARD & SLATS",
"quantity": 2,
"reference_id": "LINE-001",
"unit_price": 125,
"amount": 110,
"discount": 12,
"discount_type": "percentage",
"applied_promotion": {
"id": "<string>",
"name": "<string>",
"reference_id": "<string>",
"promo_code": "<string>"
},
"item_total": 220
}
]
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Carts
Get cart
Get a cart with its lines, the discounts and promotions applied to them, the customer’s assigned sales reps, and who created and last changed the cart. cart_total is the sum of the lines, before any cart-level promotion. Fetch the cart named by an open_cart.created or open_cart.updated webhook with this.
GET
/
v1
/
carts
/
{id}
Get cart
curl --request GET \
--url https://api.wizcommerce.com/v1/carts/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.wizcommerce.com/v1/carts/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.wizcommerce.com/v1/carts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wizcommerce.com/v1/carts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wizcommerce.com/v1/carts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wizcommerce.com/v1/carts/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/carts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "000048fc-c17e-4524-a684-0709c009e353",
"customer_id": "4bd02cd3-06d2-498a-9749-b4f87faeccd7",
"order_id": "691aba0b-de2e-442a-9a3c-e782550e536a",
"name": "New Cart",
"type": "cart",
"cart_status": "open",
"cart_total": 220,
"currency_code": "USD",
"price_list": {
"id": "3e6b41c3-2e17-4395-87ce-74699590aa0b",
"name": "Default Price List"
},
"applied_promotion": {
"id": "<string>",
"name": "<string>",
"reference_id": "<string>",
"promo_code": "<string>"
},
"assigned_sales_reps": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"department": "Sales",
"status": "active",
"created_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"updated_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"created_by": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "user@example.com"
},
"updated_by": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "user@example.com"
},
"created_at": "2024-06-24T18:45:35Z",
"updated_at": "2024-10-09T08:52:27Z",
"items": [
{
"id": "0000105c-f8ef-4289-b501-441ddc09e9dd",
"product_id": "95458b31-5398-42cb-98ed-69cce35eed81",
"sku": "BH1841-320",
"name": "EMILIE 5'0\" Q FOOTBOARD & SLATS",
"quantity": 2,
"reference_id": "LINE-001",
"unit_price": 125,
"amount": 110,
"discount": 12,
"discount_type": "percentage",
"applied_promotion": {
"id": "<string>",
"name": "<string>",
"reference_id": "<string>",
"promo_code": "<string>"
},
"item_total": 220
}
]
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Was this page helpful?