
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
@paypal/agentic-commerce-spec
Advanced tools
TypeScript types, Zod schemas, and Axios client for PayPal Cart API v1
TypeScript types, Zod schemas, and Axios client for PayPal Cart API v1, generated from OpenAPI specification.
This package provides comprehensive TypeScript support for PayPal Cart API v1, enabling AI-powered agentic commerce integrations:
Generated automatically from the official OpenAPI specification using @hey-api/openapi-ts.
npm install @paypal/agentic-commerce-spec
import {
PayPalCart,
createCart,
getCart,
updateCart,
payPalCartSchema,
client,
} from "@paypal/agentic-commerce-spec";
// Create a new cart
const cartData = {
items: [
{
item_id: "ITEM123",
variant_id: "VAR456",
quantity: 2,
unit_price: "29.99",
},
],
totals: {
total: "59.98",
currency_code: "USD",
},
};
const newCart = await createCart({
body: cartData,
});
console.log("Cart created:", newCart.data);
import { payPalCartSchema, createCart } from "@paypal/agentic-commerce-spec";
// Validate incoming data
const validatedCart = payPalCartSchema.parse(unknownCartData);
// Validate request before API call
const result = await createCart({ body: validatedCart });
import { client } from "@paypal/agentic-commerce-spec";
// Configure the HTTP client
client.setConfig({
baseURL: "https://your-api-server.com/api/paypal/v1",
headers: {
Authorization: "Bearer your-jwt-token",
},
});
import { createCart } from "@paypal/agentic-commerce-spec";
try {
const cart = await createCart({ body: cartData });
if (cart.data?.validation_issues?.length) {
console.log("Validation issues:", cart.data.validation_issues);
}
} catch (error) {
console.error("API Error:", error);
}
createCart(options) - Create a new cartgetCart(options) - Retrieve cart by IDupdateCart(options) - Update existing cartcheckoutCart(options) - Complete cart checkoutKey types exported from the package:
// Core cart type
type PayPalCart = {
id?: string;
status?: "CREATED" | "INCOMPLETE" | "READY" | "COMPLETED";
items: CartItem[];
totals?: CartTotals;
shipping_address?: Address;
billing_address?: Address;
payment_method?: PaymentMethod;
validation_issues?: ValidationIssue[];
// ... additional fields
};
// API request/response types
type CreateCartRequest = {
/* ... */
};
type CreateCartResponse = {
/* ... */
};
type UpdateCartRequest = {
/* ... */
};
type CheckoutRequest = {
/* ... */
};
import {
// Types
PayPalCart,
CartItem,
ValidationIssue,
// SDK Functions
createCart,
getCart,
updateCart,
// Zod Schemas
payPalCartSchema,
// Client
client,
} from "@paypal/agentic-commerce-spec";
// Configure authentication
client.setConfig({
baseURL: "https://your-api-server.com/api/paypal/v1",
headers: {
Authorization: "Bearer YOUR_PAYPAL_JWT_TOKEN",
},
});
// Validate and create cart
const validatedCart = payPalCartSchema.parse(incomingData);
const result = await createCart({ body: validatedCart });
The API requires JWT authentication. Set up your client with proper headers:
import { client } from "@paypal/agentic-commerce-spec";
client.setConfig({
headers: {
Authorization: "Bearer YOUR_PAYPAL_JWT_TOKEN",
},
});
Understanding cart statuses is crucial for proper integration:
CREATED - Cart successfully created and ready for paymentINCOMPLETE - Cart has validation issues that need resolutionREADY - Previously incomplete cart is now readyCOMPLETED - Order finished, payment capturedconst cart = await createCart({ body: cartData });
switch (cart.data?.status) {
case "CREATED":
// Proceed to payment
break;
case "INCOMPLETE":
// Handle validation issues
console.log("Issues:", cart.data.validation_issues);
break;
case "READY":
// Cart is ready for checkout
break;
case "COMPLETED":
// Order complete
break;
}
When a cart has validation issues, they're returned in the validation_issues array:
type ValidationIssue = {
code: string;
type: string;
message: string;
user_message?: string;
item_id?: string;
field?: string;
context?: Record<string, any>;
};
Handle validation issues appropriately:
if (cart.data?.validation_issues?.length) {
cart.data.validation_issues.forEach((issue) => {
console.log(`${issue.type}: ${issue.message}`);
if (issue.item_id) {
console.log(`Affects item: ${issue.item_id}`);
}
});
}
This package uses pre-generated code committed to the repository. To regenerate:
# From the package directory
npm run generate
# Or from the workspace root
npm run generate-agentic-spec
Customer ↔ AI Agent ↔ PayPal Commerce Platform ↔ Your Merchant API
This package facilitates the "Your Merchant API" integration with PayPal's commerce platform.
Apache-2.0
For issues and questions:
FAQs
TypeScript types, Zod schemas, and Axios client for PayPal Cart API v1
The npm package @paypal/agentic-commerce-spec receives a total of 211 weekly downloads. As such, @paypal/agentic-commerce-spec popularity was classified as not popular.
We found that @paypal/agentic-commerce-spec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 27 open source maintainers collaborating on the project.
Did you know?

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.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.