### Get Order API Source: https://docs.mvmnt.io/getting-started/quickstart Retrieves order details using its unique client key. ```APIDOC ## GET /v1/orders ### Description Retrieves order details. You can filter orders by providing a unique `key`. ### Method GET ### Endpoint /v1/orders ### Parameters #### Path Parameters None #### Query Parameters - **key** (string) - Required - The unique key of the order to retrieve. #### Request Body None ### Request Example ```bash curl -sS "https://api.mvmnt.io/v1/orders?key=QS-ORDER-2026-0001" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier for the order. - **friendlyId** (string) - A human-readable identifier for the order. - **key** (string) - The unique key of the order. - **status** (string) - The current status of the order. - **createdAt** (string) - The timestamp when the order was created. - **updatedAt** (string) - The timestamp when the order was last updated. #### Response Example ```json { "id": "660e8400-e29b-41d4-a716-446655440001", "friendlyId": "ORD-12345", "key": "QS-ORDER-2026-0001", "status": "draft", "createdAt": "2026-01-22T18:35:00Z", "updatedAt": "2026-01-22T18:35:00Z" } ``` ### Error Handling - **401 Unauthorized**: Missing or invalid `Authorization` header. - **404 Not Found**: No order found with the specified `key`. ``` -------------------------------- ### Webhook Quick Start Guide Source: https://docs.mvmnt.io/webhooks/overview A step-by-step guide to setting up a test endpoint, exposing it, configuring MVMNT, and triggering a test event. ```APIDOC ## Quick Start ### 1. Create a Test Endpoint ```javascript const express = require('express'); const app = express(); app.use(express.json()); app.post('/webhooks/mvmnt', (req, res) => { const { sentAt, events } = req.body; console.log(`Received ${events.length} event(s) sent at ${sentAt}`); events.forEach((event) => { console.log('Event:', event.event, 'Data:', event.data); }); res.status(200).send('OK'); }); app.listen(3000, () => { console.log('Webhook server listening on port 3000'); }); ``` ### 2. Expose with ngrok (for testing) ```bash ngrok http 3000 ``` Copy the HTTPS URL (e.g., `https://abc123.ngrok.io`) ### 3. Configure in MVMNT UI 1. Go to MVMNT Settings → Webhooks 2. Add your ngrok URL: `https://abc123.ngrok.io/webhooks/mvmnt` 3. Generate and copy a webhook token 4. Select event types (e.g., `SHIPMENT_DELIVERED`, `SHIPMENT_BOOKED`) 5. Save configuration ### 4. Update Your Code ```javascript // Use the token from MVMNT UI const WEBHOOK_TOKEN = 'your-token-from-mvmnt-ui'; ``` ### 5. Trigger Test Event Create or update a shipment in the MVMNT UI, and watch your endpoint receive the webhook! ``` -------------------------------- ### Fetch Order by Key with cURL Source: https://docs.mvmnt.io/getting-started/quickstart This command demonstrates how to retrieve an order using its unique client-defined key. It makes a GET request to the MVMNT.IO API, requiring an authorization header with a valid bearer token. This is useful for verifying order creation or fetching order details without needing the order ID. ```bash curl -sS "https://api.mvmnt.io/v1/orders?key=QS-ORDER-2026-0001" \ -H "Authorization: Bearer ${MVMNT_TOKEN}" ``` -------------------------------- ### Create Order API Source: https://docs.mvmnt.io/getting-started/quickstart Creates a new order with specified stops and freight details. ```APIDOC ## POST /v1/orders ### Description Creates a new order. You can optionally provide a unique `key` for the order, which can be used later to retrieve it. ### Method POST ### Endpoint /v1/orders ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **key** (string) - Optional - A unique identifier for the order. Must be unique per resource type. - **stops** (array) - Required - A list of stops for the order. - **sequence** (integer) - Required - The order of the stop. - **type** (string) - Required - The type of stop (`pickup` or `delivery`). - **locationId** (string) - Required - The ID of the location for the stop. - **freight** (object) - Required - Details about the freight. - **handlingUnits** (integer) - Required - The number of handling units. - **handlingUnitType** (string) - Required - The type of handling unit (e.g., `pallet`). - **weight** (number) - Required - The total weight of the freight. - **weightUnit** (string) - Required - The unit of weight (e.g., `lbs`, `kg`). ### Request Example ```json { "key": "QS-ORDER-2026-0001", "stops": [ { "sequence": 1, "type": "pickup", "locationId": "PICKUP_LOCATION_ID" }, { "sequence": 2, "type": "delivery", "locationId": "DELIVERY_LOCATION_ID" } ], "freight": { "handlingUnits": 20, "handlingUnitType": "pallet", "weight": 18400, "weightUnit": "lbs" } } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created order. - **friendlyId** (string) - A human-readable identifier for the order. - **key** (string) - The unique key provided in the request, if any. - **status** (string) - The current status of the order (e.g., `draft`). - **createdAt** (string) - The timestamp when the order was created. - **updatedAt** (string) - The timestamp when the order was last updated. #### Response Example ```json { "id": "660e8400-e29b-41d4-a716-446655440001", "friendlyId": "ORD-12345", "key": "QS-ORDER-2026-0001", "status": "draft", "createdAt": "2026-01-22T18:35:00Z", "updatedAt": "2026-01-22T18:35:00Z" } ``` ### Error Handling - **401 Unauthorized**: Missing or invalid `Authorization` header. - **422 Unprocessable Entity**: Missing required fields or invalid field values. Check `error.details` for specifics. - **409 Conflict**: The provided `key` is not unique. ``` -------------------------------- ### POST /v1/customers Source: https://docs.mvmnt.io/getting-started/quickstart Creates a new customer record in the system. This is typically the first step before creating locations or orders associated with a customer. ```APIDOC ## POST /v1/customers ### Description Creates a new customer record. ### Method POST ### Endpoint https://api.mvmnt.io/v1/customers ### Parameters #### Request Body - **name** (string) - Required - The name of the customer. - **status** (string) - Required - The status of the customer (e.g., "ACTIVE"). - **website** (string) - Optional - The website URL of the customer. - **phoneNumber** (string) - Optional - The phone number of the customer. ### Request Example ```json { "name": "Acme Industrial Plastics", "status": "ACTIVE", "website": "https://acme-industrial-plastics.example", "phoneNumber": "+1-214-555-0199" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created customer. - **name** (string) - The name of the customer. - **status** (string) - The status of the customer. #### Response Example ```json { "object": "CUSTOMER", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Acme Industrial Plastics", "status": "ACTIVE", "createdAt": "2026-01-22T18:30:00Z", "updatedAt": "2026-01-22T18:30:00Z" } ``` ``` -------------------------------- ### Create a customer Source: https://docs.mvmnt.io/getting-started/quickstart This endpoint allows you to create a new customer profile, which serves as a shipper profile for associating locations and orders. ```APIDOC ## POST /v1/customers ### Description Creates a new customer profile. ### Method POST ### Endpoint https://api.mvmnt.io/v1/customers ### Parameters #### Request Body - **name** (string) - Required - The name of the customer. - **status** (string) - Required - The status of the customer (e.g., `ACTIVE`). - **website** (string) - Optional - The customer's website URL. - **phoneNumber** (string) - Optional - The customer's phone number. ### Request Example ```json { "name": "Acme Industrial Plastics", "status": "ACTIVE", "website": "https://acme-industrial-plastics.example", "phoneNumber": "+1-214-555-0199" } ``` ### Response #### Success Response (201 Created) - **object** (string) - The type of object created (e.g., `CUSTOMER`). - **id** (string) - The unique identifier for the created customer. - **name** (string) - The name of the customer. - **status** (string) - The status of the customer. - **createdAt** (string) - The timestamp when the customer was created. - **updatedAt** (string) - The timestamp when the customer was last updated. - **deletedAt** (string/null) - The timestamp when the customer was deleted, or null if not deleted. #### Response Example ```json { "object": "CUSTOMER", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Acme Industrial Plastics", "status": "ACTIVE", "createdAt": "2026-01-22T18:30:00Z", "updatedAt": "2026-01-22T18:30:00Z", "deletedAt": null } ``` ``` -------------------------------- ### OAuth2 Token API Source: https://docs.mvmnt.io/getting-started/quickstart Obtain an access token for authenticating API requests using client credentials. ```APIDOC ## POST /oauth2/token ### Description Requests an access token using the client_credentials grant type. This token is required for authenticating subsequent API requests. ### Method POST ### Endpoint /oauth2/token ### Parameters #### Query Parameters None #### Request Body - **grant_type** (string) - Required - Must be `client_credentials`. - **client_id** (string) - Required - Your application's client ID. - **client_secret** (string) - Required - Your application's client secret. ### Request Example ``` POST https://api.mvmnt.io/oauth2/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET ``` ### Response #### Success Response (200 OK) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token, usually `Bearer`. - **expires_in** (integer) - The token's lifetime in seconds. #### Response Example ```json { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600 } ``` ### Error Handling - **400 Bad Request**: Invalid client credentials or grant type. - `{"error":"invalid_client" ...}`: Incorrect `client_id` or `client_secret`. - `{"error":"invalid_grant" ...}`: Incorrect `grant_type`. ``` -------------------------------- ### Create Order with Python Source: https://docs.mvmnt.io/getting-started/quickstart This Python script demonstrates how to obtain an API access token from MVMNT.IO by sending a POST request with client credentials. It then uses this token to create a new order by sending another POST request with order details. Environment variables are used for authentication credentials. ```python import os import requests token_res = requests.post( "https://api.mvmnt.io/oauth2/token", headers={"Content-Type": "application/x-www-form-urlencoded"}, data={ "grant_type": "client_credentials", "client_id": os.environ["MVMNT_CLIENT_ID"], "client_secret": os.environ["MVMNT_CLIENT_SECRET"], }, timeout=30, ) token_res.raise_for_status() token = token_res.json()["access_token"] order_res = requests.post( "https://api.mvmnt.io/v1/orders", headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"}, json={ "key": "QS-ORDER-2026-0001", "stops": [ {"sequence": 1, "type": "pickup", "locationId": "PICKUP_LOCATION_ID"}, {"sequence": 2, "type": "delivery", "locationId": "DELIVERY_LOCATION_ID"}, ], "freight": { "handlingUnits": 20, "handlingUnitType": "pallet", "weight": 18400, "weightUnit": "lbs", }, }, timeout=30, ) order_res.raise_for_status() order = order_res.json() print({"orderId": order.get("id"), "friendlyId": order.get("friendlyId"), "status": order.get("status"), "key": order.get("key")}) ``` -------------------------------- ### Create Order with JavaScript Source: https://docs.mvmnt.io/getting-started/quickstart This snippet shows how to authenticate with the MVMNT.IO API using client credentials to obtain an access token, and then use that token to create a new order. It requires environment variables for client ID and secret, and makes POST requests to the token and order endpoints. ```javascript async function getToken() { const res = await fetch("https://api.mvmnt.io/oauth2/token", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ grant_type: "client_credentials", client_id: process.env.MVMNT_CLIENT_ID, client_secret: process.env.MVMNT_CLIENT_SECRET, }), }); if (!res.ok) throw new Error(await res.text()); return (await res.json()).access_token; } const token = await getToken(); const orderRes = await fetch("https://api.mvmnt.io/v1/orders", { method: "POST", headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" }, body: JSON.stringify({ key: "QS-ORDER-2026-0001", stops: [ { sequence: 1, type: "pickup", locationId: "PICKUP_LOCATION_ID" }, { sequence: 2, type: "delivery", locationId: "DELIVERY_LOCATION_ID" }, ], freight: { handlingUnits: 20, handlingUnitType: "pallet", weight: 18400, weightUnit: "lbs" }, }), }); if (!orderRes.ok) { console.error(await orderRes.text()); process.exit(1); } const order = await orderRes.json(); console.log({ orderId: order.id, friendlyId: order.friendlyId, status: order.status, key: order.key }); ``` -------------------------------- ### 200 OK Response Example (Bash) Source: https://docs.mvmnt.io/getting-started/errors Example of a successful GET request to retrieve vendor details, returning a 200 OK status code and a JSON response body with the vendor's information. ```bash GET /v1/vendors/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1 200 OK Content-Type: application/json { "id": "550e8400-e29b-41d4-a716-446655440000", "friendlyId": "V100001", "name": "ABC Warehouse Services", ... } ``` -------------------------------- ### Create Customer with Python Source: https://docs.mvmnt.io/getting-started/quickstart This Python script creates a new customer using the MVMNT.IO API. It requires the MVMNT_CLIENT_ID and MVMNT_CLIENT_SECRET environment variables for authentication. The script makes a POST request to the /oauth2/token endpoint to obtain an access token, then uses this token to create a customer via a POST request to the /v1/customers endpoint. It outputs the customer's ID, name, and status. ```python import os import requests token_res = requests.post( "https://api.mvmnt.io/oauth2/token", headers={"Content-Type": "application/x-www-form-urlencoded"}, data={ "grant_type": "client_credentials", "client_id": os.environ["MVMNT_CLIENT_ID"], "client_secret": os.environ["MVMNT_CLIENT_SECRET"], }, timeout=30, ) token_res.raise_for_status() token = token_res.json()["access_token"] customer_res = requests.post( "https://api.mvmnt.io/v1/customers", headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"}, json={ "name": "Acme Industrial Plastics", "status": "ACTIVE", "website": "https://acme-industrial-plastics.example", "phoneNumber": "+1-214-555-0199", }, timeout=30, ) customer_res.raise_for_status() customer = customer_res.json() print({"customerId": customer["id"], "name": customer["name"], "status": customer["status"]}) ``` -------------------------------- ### Request an access token Source: https://docs.mvmnt.io/getting-started/quickstart This endpoint is used to obtain an access token for authenticating subsequent API requests. It requires your client ID and client secret. ```APIDOC ## POST /oauth2/token ### Description Requests an access token using client credentials. ### Method POST ### Endpoint https://api.mvmnt.io/oauth2/token ### Parameters #### Query Parameters - **grant_type** (string) - Required - Must be `client_credentials`. - **client_id** (string) - Required - Your MVMNT API client ID. - **client_secret** (string) - Required - Your MVMNT API client secret. ### Request Example ```bash curl -sS -X POST "https://api.mvmnt.io/oauth2/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=${MVMNT_CLIENT_ID}" \ -d "client_secret=${MVMNT_CLIENT_SECRET}" ``` ### Response #### Success Response (200) - **access_token** (string) - The obtained Bearer token. - **token_type** (string) - The type of token, typically `Bearer`. - **expires_in** (integer) - The token's expiration time in seconds. #### Response Example ```json { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600 } ``` ``` -------------------------------- ### POST /v1/orders Source: https://docs.mvmnt.io/getting-started/quickstart Creates a new order with specified pickup and delivery stops and freight details. This endpoint is used to initiate a shipment process. ```APIDOC ## POST /v1/orders ### Description Creates a new order with defined stops and freight information. The order is initially created in a 'draft' status. ### Method POST ### Endpoint https://api.mvmnt.io/v1/orders ### Parameters #### Request Body - **key** (string) - Required - A unique key for the order. - **stops** (array) - Required - An array of stop objects, defining the sequence, type, and location ID for each stop. - **sequence** (integer) - Required - The order of the stop. - **type** (string) - Required - The type of stop ('pickup' or 'delivery'). - **locationId** (string) - Required - The ID of the location for this stop. - **freight** (object) - Required - Details about the freight being shipped. - **handlingUnits** (integer) - Required - The number of handling units. - **handlingUnitType** (string) - Required - The type of handling unit (e.g., 'pallet'). - **weight** (number) - Required - The total weight of the freight. - **weightUnit** (string) - Required - The unit of weight (e.g., 'lbs'). ### Request Example ```json { "key": "QS-ORDER-2026-0001", "stops": [ { "sequence": 1, "type": "pickup", "locationId": "PICKUP_LOCATION_ID" }, { "sequence": 2, "type": "delivery", "locationId": "DELIVERY_LOCATION_ID" } ], "freight": { "handlingUnits": 20, "handlingUnitType": "pallet", "weight": 18400, "weightUnit": "lbs" } } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created order. - **friendlyId** (string) - A human-readable ID for the order (e.g., 'ORD-12345'). - **key** (string) - The key provided for the order. - **status** (string) - The current status of the order (e.g., 'draft'). - **stops** (array) - Details of the stops associated with the order. - **freight** (object) - Details of the freight. - **createdAt** (string) - Timestamp of order creation. - **updatedAt** (string) - Timestamp of last order update. #### Response Example ```json { "id": "660e8400-e29b-41d4-a716-446655440001", "friendlyId": "ORD-12345", "key": "QS-ORDER-2026-0001", "status": "draft", "stops": [ { "sequence": 1, "type": "pickup", "locationId": "770e8400-e29b-41d4-a716-446655440000" }, { "sequence": 2, "type": "delivery", "locationId": "880e8400-e29b-41d4-a716-446655440002" } ], "freight": { "handlingUnits": 20, "handlingUnitType": "pallet", "weight": 18400, "weightUnit": "lbs" }, "createdAt": "2026-01-22T18:35:00Z", "updatedAt": "2026-01-22T18:35:00Z" } ``` ``` -------------------------------- ### POST /v1/locations Source: https://docs.mvmnt.io/getting-started/quickstart Creates a new location associated with a customer. Locations can be designated as pickup (SHIPPER) or delivery (RECEIVER) points. ```APIDOC ## POST /v1/locations ### Description Creates a new location for a customer, which can be a pickup or delivery point. ### Method POST ### Endpoint https://api.mvmnt.io/v1/locations ### Parameters #### Path Parameters - **CUSTOMER_ID** (string) - Required - The ID of the customer to associate this location with. #### Request Body - **customerId** (string) - Required - The ID of the customer. - **name** (string) - Required - The name of the location. - **key** (string) - Required - A unique key or code for the location. - **type** (string) - Required - The type of location ('SHIPPER' for pickup, 'RECEIVER' for delivery). - **isAppointmentRequired** (boolean) - Optional - Indicates if appointments are required for this location. - **notes** (string) - Optional - General notes about the location. - **internalNotes** (string) - Optional - Internal notes for the location. ### Request Example (Pickup Location) ```json { "customerId": "CUSTOMER_ID", "name": "Acme Plastics DC - Dallas, TX", "key": "QS-LOC-DAL-001", "type": "SHIPPER", "isAppointmentRequired": true, "notes": "Appointments required. Receiving: Mon-Fri 07:00-15:00", "internalNotes": "Check in at gate, then door assignment by radio" } ``` ### Request Example (Delivery Location) ```json { "customerId": "CUSTOMER_ID", "name": "Acme Retail DC - Atlanta, GA", "key": "QS-LOC-ATL-001", "type": "RECEIVER", "isAppointmentRequired": false, "notes": "No appointment. Deliveries: Mon-Fri 08:00-16:00" } ``` ### Response #### Success Response (201 Created) - **object** (string) - Type of object created ('LOCATION'). - **id** (string) - The unique identifier for the created location. - **customerId** (string) - The ID of the customer this location belongs to. - **name** (string) - The name of the location. - **key** (string) - The key of the location. - **type** (string) - The type of the location. - **isAppointmentRequired** (boolean) - Whether appointments are required. - **notes** (string) - Notes about the location. - **internalNotes** (string) - Internal notes about the location. - **createdAt** (string) - Timestamp of creation. - **updatedAt** (string) - Timestamp of last update. - **deletedAt** (string) - Timestamp of deletion (null if not deleted). #### Response Example ```json { "object": "LOCATION", "id": "770e8400-e29b-41d4-a716-446655440000", "customerId": "550e8400-e29b-41d4-a716-446655440000", "name": "Acme Plastics DC - Dallas, TX", "key": "QS-LOC-DAL-001", "type": "SHIPPER", "isAppointmentRequired": true, "notes": "Appointments required. Receiving: Mon-Fri 07:00-15:00", "internalNotes": "Check in at gate, then door assignment by radio", "createdAt": "2026-01-22T18:32:00Z", "updatedAt": "2026-01-22T18:32:00Z", "deletedAt": null } ``` ``` -------------------------------- ### Create Order with cURL Source: https://docs.mvmnt.io/getting-started/quickstart This cURL command creates a draft order with specified pickup and delivery locations and freight details using the MVMNT.IO API. It requires an authorization token and the IDs of the pickup and delivery locations. The command sends a POST request to the /v1/orders endpoint with a JSON payload defining the order key, stops (pickup and delivery), and freight information. The expected output is a JSON object representing the created order. ```bash curl -sS -X POST "https://api.mvmnt.io/v1/orders" \ -H "Authorization: Bearer ${MVMNT_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "key": "QS-ORDER-2026-0001", "stops": [ { "sequence": 1, "type": "pickup", "locationId": "PICKUP_LOCATION_ID" }, { "sequence": 2, "type": "delivery", "locationId": "DELIVERY_LOCATION_ID" } ], "freight": { "handlingUnits": 20, "handlingUnitType": "pallet", "weight": 18400, "weightUnit": "lbs" } }' ``` -------------------------------- ### Filter Bill Payments by Reference Starts With Source: https://docs.mvmnt.io/apis/openapi/bill-payments/filterbillpayments This example demonstrates filtering bill payments where the reference field starts with a specific prefix (case-insensitive) using the `startsWith` operator. ```json { "filter": { "reference": { "startsWith": "INV-" } } } ``` -------------------------------- ### Get Service API Request Example Source: https://docs.mvmnt.io/apis/openapi/services Shows how to retrieve a specific service by its ID using a GET request to the /services/{id} endpoint. The response includes vendor information and associated charges. ```http GET /services/a1b2c3d4-e5f6-7890-1234-567890abcdef HTTP/1.1 Host: api.mvmnt.io ``` -------------------------------- ### GET /v1/orders Source: https://docs.mvmnt.io/getting-started/overview Retrieve a list of orders. This is a basic example of making a request after obtaining an access token. ```APIDOC ## GET /v1/orders ### Description Retrieve a list of orders. This is a basic example of making a request after obtaining an access token. ### Method GET ### Endpoint /v1/orders ### Parameters #### Query Parameters - **pageSize** (integer) - Optional - The number of items to return per page. Maximum is 250, default is 50. - **cursor** (string) - Optional - A cursor for fetching a specific page of results. ### Request Example ```bash curl https://api.mvmnt.io/v1/orders \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200) - **data** (array) - An array of order objects. - **pageInfo** (object) - Information about the current page of results. - **pageSize** (integer) - The number of items returned in this page. - **hasNextPage** (boolean) - Indicates if there are more pages available. - **hasPreviousPage** (boolean) - Indicates if there are previous pages available. - **endCursor** (string) - A cursor for fetching the next page of results. #### Response Example ```json { "data": [ { "id": "...", "name": "..." } ], "pageInfo": { "pageSize": 50, "hasNextPage": true, "hasPreviousPage": false, "endCursor": "eyJpZCI6IjU1MGU4NDAwIn0=" } } ``` ``` -------------------------------- ### Get Saved Search by ID Source: https://docs.mvmnt.io/apis/openapi This example shows how to retrieve a saved search by its ID. Users can only retrieve saved searches they own or that are public within their organization. ```HTTP GET /saved-searches/{id} ``` -------------------------------- ### POST /users Source: https://docs.mvmnt.io/apis/openapi/users Create a new user in your organization. ```APIDOC ## POST /users ### Description Create a new user in your organization. ### Method POST ### Endpoint /users ### Parameters #### Request Body - **email** (string) - Required - The email address of the user. - **name** (string) - Optional - The name of the user. - **customFields** (object) - Optional - Key-value pairs for custom user data. ### Request Example ```json { "email": "newuser@example.com", "name": "New User", "customFields": { "department": "Sales" } } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the newly created user. - **email** (string) - The email address of the user. - **createdAt** (string) - The timestamp when the user was created. #### Response Example ```json { "id": "user-456", "email": "newuser@example.com", "createdAt": "2023-05-16T11:00:00Z" } ``` ``` -------------------------------- ### POST /v1/orders - Create Order with Client Key Source: https://docs.mvmnt.io/getting-started/client-keys Demonstrates how to create a new order and set a client key for it. ```APIDOC ## POST /v1/orders ### Description Creates a new order and associates a client-defined key with it. ### Method POST ### Endpoint https://api.mvmnt.io/v1/orders ### Parameters #### Request Body - **key** (string) - Required - Your system's identifier for this order. Max length 512 characters. - **stops** (array) - Required - An array of stop objects for the order. - **freight** (object) - Required - Freight details for the order. ### Request Example ```json { "key": "ERP-ORDER-123", "stops": [...], "freight": {...} } ``` ### Response #### Success Response (200) - **id** (string) - The unique MVMNT ID for the order. - **friendlyId** (string) - A human-readable ID for the order. - **key** (string) - The client-defined key associated with the order. - **status** (string) - The current status of the order. #### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "friendlyId": "ORD-45678", "key": "ERP-ORDER-123", "status": "draft" } ``` ``` -------------------------------- ### IntFilter Example (JSON) Source: https://docs.mvmnt.io/getting-started/filtering Demonstrates the use of IntFilter for numerical fields, such as 'quantity' and 'weight'. This example shows how to filter for values greater than zero and less than or equal to a specific number. ```json { "filter": { "quantity": { "greaterThan": 0 }, "weight": { "lessThanOrEqualTo": 10000 } } } ``` -------------------------------- ### Set Environment Variables for MVMNT API Source: https://docs.mvmnt.io/getting-started/quickstart This step involves setting environment variables for your MVMNT API client ID and client secret. These credentials are required for authenticating your API requests. Ensure these variables are accessible in your shell environment before proceeding. ```bash export MVMNT_CLIENT_ID="YOUR_CLIENT_ID" export MVMNT_CLIENT_SECRET="YOUR_CLIENT_SECRET" ``` -------------------------------- ### FloatFilter Example (JSON) Source: https://docs.mvmnt.io/getting-started/filtering Illustrates filtering with FloatFilter for decimal values, like 'price' and 'weight'. This example uses 'greaterThanOrEqualTo' and 'lessThan' operations. ```json { "filter": { "price": { "greaterThanOrEqualTo": 99.99 }, "weight": { "lessThan": 500.5 } } } ``` -------------------------------- ### Create Customer API Source: https://docs.mvmnt.io/apis/openapi/customers Create a new customer in your organization. ```APIDOC ## POST /customers ### Description Create a new customer in your organization. ### Method POST ### Endpoint /customers ### Parameters #### Request Body - **name** (string) - Required - The name of the customer. - **email** (string) - Required - The email address of the customer. - **phone** (string) - Optional - The phone number of the customer. - **address** (object) - Optional - The address of the customer. - **street** (string) - Optional - **city** (string) - Optional - **state** (string) - Optional - **zipCode** (string) - Optional - **country** (string) - Optional ### Request Example ```json { "name": "Jane Smith", "email": "jane.smith@example.com", "phone": "123-456-7890", "address": { "street": "123 Main St", "city": "Anytown", "state": "CA", "zipCode": "90210", "country": "USA" } } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created customer. - **name** (string) - The name of the customer. - **email** (string) - The email address of the customer. - **createdAt** (string) - The timestamp when the customer was created. #### Response Example ```json { "id": "cust_456", "name": "Jane Smith", "email": "jane.smith@example.com", "createdAt": "2023-05-16T11:00:00Z" } ``` ``` -------------------------------- ### Request MVMNT API Access Token Source: https://docs.mvmnt.io/getting-started/quickstart This snippet shows how to request an access token from the MVMNT API using client credentials. The token is essential for authenticating subsequent API calls. The response includes the access token, token type, and expiration time. The token should be stored in an environment variable for later use. ```bash curl -sS -X POST "https://api.mvmnt.io/oauth2/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=${MVMNT_CLIENT_ID}" \ -d "client_secret=${MVMNT_CLIENT_SECRET}" ``` ```javascript // quickstart-token.mjs const tokenRes = await fetch("https://api.mvmnt.io/oauth2/token", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ grant_type: "client_credentials", client_id: process.env.MVMNT_CLIENT_ID, client_secret: process.env.MVMNT_CLIENT_SECRET, }), }); if (!tokenRes.ok) { console.error(await tokenRes.text()); process.exit(1); } const { access_token, token_type, expires_in } = await tokenRes.json(); console.log({ token_type, expires_in, access_token: access_token.slice(0, 24) + "..." }); ``` ```python # quickstart_token.py import os import requests res = requests.post( "https://api.mvmnt.io/oauth2/token", headers={"Content-Type": "application/x-www-form-urlencoded"}, data={ "grant_type": "client_credentials", "client_id": os.environ["MVMNT_CLIENT_ID"], "client_secret": os.environ["MVMNT_CLIENT_SECRET"], }, timeout=30, ) res.raise_for_status() data = res.json() print({"token_type": data["token_type"], "expires_in": data["expires_in"], "access_token_prefix": data["access_token"][:24] + "..."}) ``` -------------------------------- ### BooleanFilter Example (JSON) Source: https://docs.mvmnt.io/getting-started/filtering Shows how to use BooleanFilter for true/false fields like 'isPrimary' and 'isActive'. This example demonstrates filtering for exact matches and non-matches. ```json { "filter": { "isPrimary": { "equalTo": true }, "isActive": { "notEqualTo": false } } } ``` -------------------------------- ### Create Pickup Location with cURL Source: https://docs.mvmnt.io/getting-started/quickstart This cURL command creates a pickup location for a customer using the MVMNT.IO API. It requires the customer ID and an authorization token. The command sends a POST request to the /v1/locations endpoint with a JSON payload specifying the customer ID, location name, key, type, and appointment requirements. The expected output is a JSON object representing the created location. ```bash curl -sS -X POST "https://api.mvmnt.io/v1/locations" \ -H "Authorization: Bearer ${MVMNT_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "customerId": "CUSTOMER_ID", "name": "Acme Plastics DC - Dallas, TX", "key": "QS-LOC-DAL-001", "type": "SHIPPER", "isAppointmentRequired": true, "notes": "Appointments required. Receiving: Mon-Fri 07:00-15:00", "internalNotes": "Check in at gate, then door assignment by radio" }' ```