Skip to content

Manage Stripe Coupons

This component allows you to manage discount coupons in your Stripe payment system directly from your Nappai automation workflows. You can create new coupons with specific discount rules, retrieve details of existing coupons, list all available coupons, or delete old ones. It serves as the central tool for handling customer discounts and promotional offers.

How it Works

This component connects to the Stripe API to perform actions on coupon data. When you configure the inputs, the component sends a secure request to Stripe’s servers. Depending on the operation you choose, it will either generate a new coupon, fetch specific coupon details, retrieve a list of all coupons, or remove a coupon from your account. The results, such as the new coupon ID or error messages, are passed back to your workflow for further processing.

Connection & Credentials

This component requires configuring a credential in the Nappai panel before interacting with the external service:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type Stripe API and fill in the required fields (API Keys).
  3. In your workflow, select the saved credential in the Credential input field of this node.

Inputs

The following fields are available to configure this component. Each field may be visible in different operations:

  • Operation: [REQUERIDO] Select the action you want to perform (e.g., Create, Get, Delete).
  • Get Mode: Select “By ID” to retrieve a specific coupon or “List” to retrieve all coupons.
  • Coupon ID: [REQUERIDO] The unique ID of the coupon. Required when retrieving a specific coupon by ID or deleting one.
  • Name: A human-readable name for the coupon (e.g., “Summer Sale 2024”).
  • Duration: How long the discount applies (e.g., “Once” or “Repeating”).
  • Duration in Months: The number of months the discount applies. Required when Duration is set to “Repeating”.
  • Percent Off: The percentage discount (1-100). Use either Percent Off or Amount Off, not both.
  • Amount Off: The amount to discount in the smallest currency unit (e.g., cents). Use together with Currency.
  • Currency: The three-letter ISO currency code (e.g., “usd”, “eur”). Required when Amount Off is set.
  • Max Redemptions: The maximum number of times this coupon can be redeemed by customers.
  • Redeem By: The Unix timestamp after which the coupon can no longer be redeemed.
  • Limit: The maximum number of coupons to return when listing (1-100).

Outputs

Output Data Example (JSON)

The component returns data that helps you track the status of your coupon operations or use the new coupon details in subsequent steps. json { “coupon_id”: “20PERCENT_OFF_2024”, “status”: “success”, “details”: { “name”: “Summer Sale”, “percent_off”: 20, “currency”: “usd”, “duration”: “once”, “created”: 1690000000 }, “error”: null }

Connectivity

This component typically connects to:

  • Previous Steps: Input nodes or previous automation steps that provide coupon details (like names, discount percentages, or currency codes).
  • Next Steps: Actions that need to verify the coupon exists, confirm its details, or log the creation of a new discount code. It can also connect to notification systems to alert teams when coupons are created or deleted.

Usage Example

Scenario: Creating a New Discount Coupon

  1. Set Operation to “Create”.
  2. Enter Name as “Holiday Special”.
  3. Set Duration to “Once”.
  4. Set Percent Off to “15”.
  5. The component will create the coupon in Stripe and return the Coupon ID, which you can then use in other parts of your workflow to apply the discount to customer orders.

Tips and Best Practices

  • Always ensure you have the correct Stripe API credential configured before attempting to use this component.
  • When creating a coupon, remember that you can either use Percent Off OR Amount Off, but not both simultaneously.
  • If you are setting an Amount Off, you must also specify a Currency (e.g., “usd”).
  • Use the Max Redemptions field to limit how many times a coupon can be used, which helps control budget for promotions.
  • For Repeating durations, always specify the Duration in Months to ensure the discount lasts for the intended period.

Security Considerations

  • Ensure your Stripe API credentials are kept secure and are not shared publicly.
  • Use Limit values carefully when listing coupons to avoid overwhelming your account with too many requests at once.
  • Be cautious when deleting coupons, as this action may be irreversible depending on Stripe’s policies.