Cupom Center

v0.1.0
io.github.experiens/cupom-center Checked 2 days ago Published 29 days ago

Conecta agentes de IA à API REST do Cupom Center com fluxos seguros de cupons.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

recommend_integration_flow Recommend Cupom Center integration flow

Choose the correct Cupom Center workflow before making API calls. This tool is local, has no commercial effect, and consumes no Cupom Center API allowance. Use it whenever it is unclear whether to discover, quote, issue, redeem, record payment, inspect, or reverse.

ParameterTypeDescription
business_goal *string
operation_id_knownboolean
payment_confirmedboolean

find_eligible_coupons Find eligible coupons

Discover coupons whose configured rules match the known customer/cart context. This does not calculate final totals, reserve budget, or consume a coupon. Missing context intentionally excludes coupons that require that fact. public defaults to true.

ParameterTypeDescription
contextobject
paginationobject

quote_single_coupon Calculate and reserve one coupon

Validate a known coupon code against the current cart, calculate authoritative totals, and create a temporary quote reservation. Use before redeeming or displaying a final discount. Do not use for catalog discovery.

ParameterTypeDescription
context *object
coupon_code *stringCoupon code supplied or selected for the customer.
cart_idstring

quote_multiple_coupons Calculate and reserve multiple coupons

Validate and calculate 2–10 known coupon codes. code_order stacks sequentially in supplied order; highest_discount_per_product applies only the best coupon to each product. Every supplied code must be eligible and applied.

ParameterTypeDescription
context *object
coupon_codes *array
selection *object
cart_idstring

select_coupons_for_units Select coupons per unit

Automatically select public coupons for 1–20 marketplace/store units. Use only when a cart is partitioned into units and the integration wants Cupom Center to choose by coverage or total discount. This is not for validating a known code.

ParameterTypeDescription
mode *string
units *array
contextobject
max_coupons_per_unitinteger
prioritystring

create_coupon_issuance Issue an individual coupon code

Create an individual code from an existing coupon configured with ISSUED distribution, typically for cart recovery, CRM, or individualized delivery. This never creates discount rules. Requires COUPON_ISSUE and a stable idempotency key.

ParameterTypeDescription
cart *array
coupon_id *stringExisting Cupom Center coupon configured with ISSUED distribution.
external_reference *stringStable reference for the CRM, recovery, or distribution event.
idempotency_key *stringStable per-attempt key. Reuse it unchanged after a timeout.
subject *object
metadata
shippingobject
valid_untilstring

get_coupon_issuance Get coupon issuance

Read the current state and immutable commercial details of an individual issued code.

ParameterTypeDescription
issuance_id *stringIssuance ID returned by create_coupon_issuance.

revoke_coupon_issuance Revoke coupon issuance

Revoke one active individual issuance. This is idempotent but cannot reactivate a consumed or expired code. Use only when the individual code must no longer be accepted.

ParameterTypeDescription
issuance_id *stringIssuance ID returned by create_coupon_issuance.

redeem_single_coupon Redeem one coupon

Confirm one coupon as a commercial operation. Normally call after quote_single_coupon and send the same cart/context. Provide cart_id, context.user.id, or quote_id for correlation. Include payment only after external confirmation; Cupom Center does not charge money.

ParameterTypeDescription
context *object
coupon_code *stringCoupon code supplied or selected for the customer.
cart_idstring
order_idstring
paymentobject
quote_idstring

redeem_multiple_coupons Redeem multiple coupons

Atomically confirm 2–10 coupons previously calculated together. Preserve code order and selection strategy from the quote. Either all applicable uses/budgets confirm or none do.

ParameterTypeDescription
context *object
coupon_codes *array
selection *object
cart_idstring
order_idstring
paymentobject
quote_idstring

get_coupon_operation Get coupon operation

Inspect a redemption operation, immutable receipts, current payment, and reversals. Use for reconciliation and as the first recovery step after a timeout when operation_id is known.

ParameterTypeDescription
operation_id *stringoperation_id returned by a successful redeem.

record_operation_payment Record confirmed operation payment

Record an integral payment that an external payment provider has already confirmed. This does not charge or capture money and does not consume coupons again. Requires PAYMENT_WRITE.

ParameterTypeDescription
operation_id *stringoperation_id returned by a successful redeem.
payment *object

reverse_operation Cancel or refund a coupon operation

Fully reverse one coupon operation and release its usage counters and budgets. The backend classifies it as cancellation without payment or refund with confirmed payment. This does not move money at the payment provider and accepts no reason or partial amount.

ParameterTypeDescription
operation_id *stringoperation_id returned by a successful redeem.