Socket
Book a DemoInstallSign in
Socket

@paypal/commerce-cart-zod

Package Overview
Dependencies
Maintainers
26
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paypal/commerce-cart-zod

Zod validation schemas for PayPal Cart API v1

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
346
327.16%
Maintainers
26
Weekly downloads
 
Created
Source

@paypal/commerce-cart-zod

Zod validation schemas for PayPal Cart API v1.

Installation

npm install @paypal/commerce-cart-zod

Usage

import {
  PayPalCartSchema,
  validatePayPalCart,
} from "@paypal/commerce-cart-zod";

// Validate data at runtime
const result = PayPalCartSchema.safeParse(cartData);
if (result.success) {
  console.log("Valid cart:", result.data);
} else {
  console.error("Validation errors:", result.error);
}

// Or use helper function
try {
  const validCart = validatePayPalCart(cartData);
  console.log("Valid cart:", validCart);
} catch (error) {
  console.error("Validation failed:", error);
}

Features

  • Runtime validation with Zod
  • Type-safe validation schemas
  • Helper functions for common validation tasks
  • Inferred TypeScript types from schemas
  • Generated from the official OpenAPI specification

Available Schemas

  • PayPalCartSchema - Main cart object
  • CartItemSchema - Individual cart items
  • CustomerSchema - Customer information
  • MoneySchema - Monetary amounts
  • ValidationIssueSchema - Error handling
  • And many more...

API Reference

See the full API documentation for complete schema reference.

Keywords

paypal

FAQs

Package last updated on 22 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.