Skip to main content

apply_voucher

Applies a promotional voucher or coupon code to the customer's cart for a discount.

Platform Support​

PlatformStatusNotes
iOSYes—
AndroidYes—
Authentication Required

The user must be signed in to use this tool.

Description​

Apply a voucher/coupon code to the cart

Parameters​

NameTypeRequiredDefaultDescription
voucher_codestringYes—The voucher or coupon code to apply

Response​

FieldTypeDescription
successbooleanWhether the voucher was applied
discountstringDiscount amount applied
cart_totalstringUpdated cart total after discount

Error Codes​

CodeDescription
AUTH_REQUIREDUser must be signed in
INVALID_PARAMSMissing voucher_code
EXECUTION_ERRORInvalid or expired voucher code

Source Files​

  • iOS: one-app-ios-chat/Chat/Sources/Chat/MCP/EcommerceMCPServer.swift
  • Android: chat-pnp-android/mcp-ecommerce/src/main/java/pnp/app/mcp/ecommerce/tools/EcommerceMCPTools.kt