OverviewPlatformsAPI ReferenceResources
Commerce

Add codes to a discount

POSThttps://zernio.com/api/v1/commerce/discounts/{discountId}/codes

Adds up to 250 more codes to a code discount, for example one per influencer. The platform adds them in the background. Needs discounts.codes, which WooCommerce stores do not have.

PlatformsShopify

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

discountIdstringRequired

Platform-native id.

Body

application/json

What every request needs

accountIdstringRequired
codesarray of stringsRequired

Responses

Success· the request worked

Errors· the request failed

POST/v1/commerce/discounts/{discountId}/codes
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commerce.addCommerceDiscountCodes({  path: {    discountId: 'discount_abc123',  },  body: {    accountId: 'account_abc123',    codes: [      'abc123',    ],  },});console.log(data);
{  "pending": true}
OpenAPI specification
Was this page helpful?