> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nymblecommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Nymble Commerce API Quickstart: Make Your First API Calls

> Make your first Nymble Commerce API call in under 5 minutes. Authenticate, list your product catalog, build a cart, and submit your first order.

This guide walks you through the core Nymble Commerce API flow from zero to a submitted order. You'll exchange your credentials for an access token, list your product catalog, build a cart, add items, and check out — all via straightforward HTTP requests.

<Tip>
  Use the sandbox environment (`https://api-dev.achievemomentum.com`) while following this guide so you don't affect live data. Swap in the production base URL (`https://api.achievemomentum.com`) when you're ready to go live.
</Tip>

<Steps>
  <Step title="Authenticate">
    Exchange your organization credentials for an API key token. Send a `POST` request to `/api/auth/login` with your `OrgCode`, `ClientId`, and `ClientSecret`.

    ```bash theme={null}
    curl -X POST https://api-dev.achievemomentum.com/api/auth/login \
      -H "Content-Type: application/json" \
      -d '{
        "OrgCode": "org_52a3021e813",
        "ClientId": "your-client-id",
        "ClientSecret": "your-client-secret"
      }'
    ```

    A successful response returns your access token:

    ```json theme={null}
    {
      "AccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "TokenType": "api-key",
      "ExpiresIn": 86400
    }
    ```

    Store the `AccessToken` value — you'll include it in the `x-api-key` header for all subsequent requests. The token is valid for `ExpiresIn` seconds (86,400 seconds = 24 hours). Cache it and reuse it rather than re-authenticating on every request.

    <Note>
      The login endpoint is rate-limited to **10 requests per minute** per `ClientId`. If you exceed this limit, you'll receive a `429 Too Many Requests` response. Cache your token until it's close to expiry to avoid hitting this limit.
    </Note>
  </Step>

  <Step title="List your products">
    Retrieve your organization's product catalog. The `OrganizationId`, `PriceTier`, `CustomerNumber`, and `CurrencyCode` are read automatically from your token's claims — you don't need to pass them explicitly.

    ```bash theme={null}
    curl -X GET "https://api-dev.achievemomentum.com/api/products?PageNumber=1&PageSize=25&SortOn=Sku&SortDirection=asc" \
      -H "x-api-key: your-access-token" \
      -H "Accept: application/json"
    ```

    The response is a paginated result set:

    ```json theme={null}
    {
      "data": [
        {
          "id": "64a1f2e3b5c8d90012345678",
          "sku": "PROD-001",
          "name": "Heavy-Duty Widget",
          "description": "Industrial-grade widget for high-volume applications.",
          "price": 49.99,
          "currency": "USD",
          "inventory": 320,
          "images": [
            "https://cdn.example.com/images/prod-001.jpg"
          ]
        },
        {
          "id": "64a1f2e3b5c8d90012345679",
          "sku": "PROD-002",
          "name": "Standard Bracket Kit",
          "description": "Mounting bracket kit, 12-piece.",
          "price": 14.50,
          "currency": "USD",
          "inventory": 84,
          "images": []
        }
      ],
      "totalRecords": 527,
      "currentPage": 1,
      "pageSize": 25
    }
    ```

    You can filter products by passing a `Filters` array in the query. Supported filter fields include `Sku`, `Name`, and other product attributes. See the [API reference](/api-reference/overview) for the full filter syntax.
  </Step>

  <Step title="Create a cart">
    Create a new shopping cart for a customer. Pass the `customerNumber` in the URL path and provide the `organizationId` in the request body. Your token supplies the organization context automatically.

    ```bash theme={null}
    curl -X POST https://api-dev.achievemomentum.com/api/carts/CUST1234 \
      -H "x-api-key: your-access-token" \
      -H "Content-Type: application/json" \
      -d '{
        "organizationId": "65904937457314222c3f1cb4",
        "customerNumber": "CUST1234",
        "orderType": "Order",
        "userId": "user_abc123"
      }'
    ```

    The response includes the new cart's ID, which you'll use in subsequent steps:

    ```json theme={null}
    {
      "id": "CART-8f3a2b1c",
      "customerNumber": "CUST1234",
      "organizationId": "65904937457314222c3f1cb4",
      "orderType": "Order",
      "items": [],
      "createdAt": "2025-01-15T10:30:00Z"
    }
    ```
  </Step>

  <Step title="Add an item">
    Add a product to the cart by posting to `/api/carts/{customerNumber}/{cartId}/items`. Use the `sku` from your product listing and the cart ID returned in the previous step.

    ```bash theme={null}
    curl -X POST https://api-dev.achievemomentum.com/api/carts/CUST1234/CART-8f3a2b1c/items \
      -H "x-api-key: your-access-token" \
      -H "Content-Type: application/json" \
      -d '{
        "organizationId": "65904937457314222c3f1cb4",
        "customerNumber": "CUST1234",
        "shoppingCartId": "CART-8f3a2b1c",
        "sku": "PROD-001",
        "quantity": 5
      }'
    ```

    The updated cart is returned with the new line item included:

    ```json theme={null}
    {
      "id": "CART-8f3a2b1c",
      "customerNumber": "CUST1234",
      "organizationId": "65904937457314222c3f1cb4",
      "items": [
        {
          "sku": "PROD-001",
          "name": "Heavy-Duty Widget",
          "quantity": 5,
          "unitPrice": 49.99,
          "lineTotal": 249.95
        }
      ],
      "subtotal": 249.95,
      "updatedAt": "2025-01-15T10:31:45Z"
    }
    ```

    Repeat this step for each additional product you want to add to the cart.
  </Step>

  <Step title="Checkout">
    Convert the cart into an order by calling the `complete-checkout` endpoint. Provide the payment details and shipping address. Nymble Commerce supports credit card payment at checkout via Authorize.Net and WorldPay.

    ```bash theme={null}
    curl -X POST https://api-dev.achievemomentum.com/api/carts/CUST1234/CART-8f3a2b1c/complete-checkout \
      -H "x-api-key: your-access-token" \
      -H "Content-Type: application/json" \
      -d '{
        "organizationId": "65904937457314222c3f1cb4",
        "customerNumber": "CUST1234",
        "channel": "Web",
        "payment": {
          "billingAddress": {
            "address1": "123 Main St",
            "city": "New York",
            "stateProvince": "NY",
            "postalCode": "10001",
            "country": "US"
          },
          "creditCard": {
            "cardNumber": "4111111111111111",
            "cardholderName": "Jane Smith",
            "expiryMonth": "12",
            "expiryYear": 2028,
            "cvv": "123"
          }
        }
      }'
    ```

    A successful checkout converts the cart to an order and returns the new order record:

    ```json theme={null}
    {
      "orderId": "ORDER-20250115-00042",
      "customerNumber": "CUST1234",
      "organizationId": "65904937457314222c3f1cb4",
      "status": "Confirmed",
      "channel": "Web",
      "total": 249.95,
      "currency": "USD",
      "createdAt": "2025-01-15T10:35:00Z"
    }
    ```

    Save the `orderId` — you can use it to retrieve order details, send confirmation emails, or trigger downstream fulfillment workflows.
  </Step>
</Steps>

## What's next?

You've made your first end-to-end Nymble Commerce API flow. From here, explore:

* [Placing an Order](/guides/placing-an-order) — full order workflow including shipping, rep assignment, and order types
* [Authentication](/authentication) — token lifecycle, API keys, roles, and security best practices
