younifyd
Menu

Create coupons

Create coupons

POST/V1/coupons

Use it in a workflow

  1. Add a step and choose the Adobe Commerce connector.
  2. Pick the Create coupons action (under Promotions).
  3. Fill in the fields below, then reference the result from later steps as {{createCoupons.response.data}}.

Fields

baseUrlstring

The API host this action calls. Override to point at a different environment.

Default "/rest/default"

bodystring

The request body content (for POST, PUT, PATCH requests).

forwardAllHeadersboolean

If enabled, all headers from the incoming request will be forwarded. Additional headers below will override forwarded ones.

Default false

headerskeyvalue

Extra HTTP headers to include, beyond what this action already declares. These override forwarded or declared headers with the same name.

queryParamskeyvalue

Extra URL query parameters to include, beyond what this action already declares. These override declared query parameters with the same name.

Response

Returns 200 with an object. Read it in later steps with {{createCoupons.response.data.<field>}}.

coupon_idinteger

Coupon id

rule_idinteger

The id of the rule associated with the coupon

codestring

Coupon code

usage_limitinteger

Usage limit

usage_per_customerinteger

Usage limit per customer

times_usedinteger

The number of times the coupon has been used

expiration_datestring

Expiration date

is_primaryboolean

The coupon is primary coupon for the rule that it's associated with

created_atstring

When the coupon is created

typeinteger

Of coupon

extension_attributesobject

ExtensionInterface class for @see \Magento\SalesRule\Api\Data\CouponInterface

json
{
  "rule_id": 0,
  "times_used": 0,
  "is_primary": false,
  "coupon_id": 0,
  "code": "string",
  "usage_limit": 0,
  "usage_per_customer": 0,
  "expiration_date": "string",
  "created_at": "string",
  "type": 0,
  "extension_attributes": {}
}

Need more? See the Adobe Commerce guide for connection setup and behaviour shared by every action.

Create coupons — Adobe Commerce — Documentation