Tutorials & Solutions
Orders management
Inventory and shipping
Payments
Catalog
Prices
Rates & Benefits
Insights
Master Data
Message Center
Sales Policies
CMS
Portal
Suggestions
Sellers
Integrations
Apps
Authentications
Account management
Billing
Credit Control
Omnichannel
VTEX IO
Projects & Integrations

Generating massive coupons

VTEX Team
VTEX Team
Last updated
1/25/2019

The creation of coupons for promotions must be performed at the Pricing module and is documented in our article about Coupons. However, there may be situations when it becomes necessary to create many coupons at once, due to some campaign or marketing action. In this case, you can create massive coupons through API Rest. Below, you find  the requirements to call this API:

  • URLrnb.vtexcommercestable.com.br/api/rnb/pvt/coupon?an={AccountName} El numero de cuenta es el nombre con el que ingresamos al admin de nuestra tienda
  • Method: POST
  • **Headers:
    • Header: Content-Type / Value: application/json
    • Header: x-vtex-api-appKey / Value: AppKey of the store, as registered on the License Manager
    • Header: x-vtex-api-appToken / Value: AppToken of the store, as registered on the License Manager

Body:

{
"utmSource": "utm_source", //utm_source registered on the promotion
"UtmCampaign": "utm_campaign" // utm_campaign registered on the promotion
"CouponCode": "coupon_code" // coupon code to be entered in the cart, to enable the promotion
"IsArchived": false, // Boolean field, true or false type. If true, will file the coupon.
"MaxItemsPerClient": 1, // integer type field. Maximum number of products that the customer can purchase using this coupon.
"ExpirationIntervalPerUse": "00:00:00" // default value
}

Note: The sending of the Body is unitary. For multiple requests it is necessary to create a robot/web page that makes bulk sending or, for example, use the Postman Runner to automate the sending.

Still got questions?
Ask the community
Find solutions and share ideas in VTEX's community.
Talk to our experts
Get in touch if you have something specific to ask about the platform.
  • PT
  • ES
VTEX website