> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.resmarksystems.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Resmark API: Cart

A shopping cart in Resmark holds product inventory items while a customer completes their booking. When inventory is added to a cart, those seats are locked for 30 minutes. If checkout is not completed within that window, the seats are released back to availability.
 
The typical cart workflow is: create a cart, add inventory, set customer information, optionally apply a discount, then convert the cart to an order.
 
### Create New Cart
 
```
POST /cart
```
 
Creates a new empty cart. No request body is required. Use the returned cart `id` for all subsequent cart operations.
 
**Example response:**
```json
{
  "errorMessage": null,
  "data": {
    "id": "f81b20b0-c6d6-4375-a149-9b24addb7a3f",
    "entityId": "60be6c0876dc590010d74ea6",
    "createdDate": "2021-12-15T21:31:39.195Z",
    "createdBy": "Brandon Lake",
    "createdByEmail": "email@resmarksystems.com",
    "customer": {},
    "items": [],
    "total": 0
  }
}
```
 
### Create New Cart for Reseller Orders
 
```
POST /cart?supplierId={supplierId}
```
 
Creates a cart for placing orders as a reseller. The logged-in user is treated as the reseller agent. The `supplierId` parameter is required for this flow.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| supplierId | string | Yes | Supplier identifier for the business whose products are being booked |
 
### Get All Carts
 
```
GET /cart
```
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Number of carts to return. Default: 50. |
| page | number | No | Pagination offset. Default: 0. |
| ids | csv | No | Filter by specific cart ID(s). |
 
### Get Cart
 
```
GET /cart/{id}
```
 
Returns a single cart including customer info, line items with pricing breakdown, and total. Each item includes a `participantList` with per-participant pricing.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Cart ID |
 
### Delete Cart
 
```
DELETE /cart/{id}
```
 
Deletes the cart and returns all locked inventory back to availability.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Cart ID |
 
### Add Inventory to Cart
 
```
POST /cart/{id}/item
```
 
Adds a product time slot to the cart. You'll need data from the Get Product Inventory and (if applicable) Get Product Pickup Options endpoints, documented in the [Resmark API: Products](https://helpdesk.resmarksystems.com/en-us/article/resmark-api-products-1ce4p9z/) article.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Cart ID (path parameter) |
| itemId | string | Yes | `activityId` from the Product Inventory endpoint. This is the specific date/time slot being booked. |
| participants | object | Yes | Tier keys mapped to quantities. Example: `{"Adult": "1", "Child": "1"}` |
| pickupDetailId | string | Conditional | Required if the product has pickups configured. Obtained from Get Product Pickup Options. |
| locationId | string | Conditional | Required if the product has pickups. Location ID from Get Product Pickup Options. |
| locationOther | string | Conditional | Alternative to `locationId` for entering a custom pickup location as free text. |
| internalComment | string | No | Internal comment associated with this cart item. |
 
|| The `activityId` from the Product Inventory endpoint is passed as `itemId` here. The naming is different between endpoints, but the value is the same.
 
### Remove Inventory from Cart
 
```
DELETE /cart/{id}/item/{itemId}
```
 
Removes a product time slot from the cart and releases the locked seats back to availability.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Cart ID |
| itemId | string | Yes | ID of the inventory time slot to remove |
 
### Update Customer
 
```
PUT /cart/{id}/customer
```
 
Adds or updates the customer information on a cart. This sets the purchasing customer only. Participant-level details cannot be set through the API.
 
| It's a good idea to GET the cart first to see which customer fields are required for checkout before calling this endpoint.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| email | string | Yes | Customer email address |
| firstName | string | Yes | Customer first name |
| lastName | string | Yes | Customer last name |
| title | string | No | Customer title |
| organization | string | No | Organization name |
| middleName | string | No | Customer middle name |
| nickName | string | No | Customer nickname |
| phone | string | No | Customer phone number |
| dialCode | string | No | Country dial code (e.g., `+1` or `1`) |
| birthDate | string | No | Date of birth in `YYYY-MM-DD` or `YYYY/MM/DD` format |
| gender | string | No | `MALE` or `FEMALE` |
| streetAddress | string | No | Customer street address |
| postalCode | string | No | Customer postal code |
| state | string | No | 2-character state code (when country is USA) |
| city | string | No | Customer city |
| country | string | No | 3-character country code (e.g., `USA`) |
| [custom field name] | string | No | Custom text fields: use the field name as the key, field value as the value |
| [checkbox field name] | array | No | Custom checkbox fields: pass an array of selected values |
| [list field name] | array | No | Custom list fields: pass an array with the selected value |
 
**Phone number handling:** You can provide the dial code and phone number in several ways: (1) send `dialCode` and `phoneNumber` without the code prefix, (2) omit `dialCode` and prefix `phoneNumber` with `+dialCode`, (3) send both, or (4) omit both and Resmark will assume US (+1).
 
### Apply Discount
 
```
POST /cart/{id}/discount
```
 
Applies a promo code to the cart and recalculates totals. The response will indicate whether the code is invalid or valid but doesn't apply to any items in the cart.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Cart ID (path parameter) |
| promoCode | string | Yes | Discount promo code to apply |
 
### Renew Cart
 
```
GET /cart/{id}/renew
```
 
Resets the 30-minute inventory lock timer for all items in the cart. Use this if your checkout flow takes longer than 30 minutes and you need to keep the inventory held.
 
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Cart ID |
 
**Example response:**
```json
{
  "errors": [],
  "messages": [],
  "info": [],
  "expDateTime": 1543516775683
}
```
 
The `expDateTime` value is a Unix timestamp (milliseconds) representing when the renewed lock will expire.