Offers (2.0.0)

Download OpenAPI specification:Download

E-mail: support@fabric.inc License: fabric Inc

fabric e-commerce Offers APIs let you set up and manage stock keeping unit (SKU) prices. Its wide range of coupon and promotion features let you design discounts ranging from single-use, customer-specific coupons to site-wide promotions applicable for all skus.

Price List

Price list is a collection of items and their assigned prices. An item can exist in multiple price lists. This gives you the ability to assign different prices to the same item. Price lists let you set currency and duration of the prices. For example, if the price list expires, prices of items within the price list will also expire. You can configure the pricing API to include your default price.
When requesting pricelist of items or evaluating promotions, you should mention the price list ID that you want to use.

Create price list

Enables you to create a price list. Depending upon the currency code you set for a price list, you will be able to create or update price (using POST/api-offers/price) under the pricelist for the defined currency code only.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
name
required
string

Pricelist name

isDefault
required
boolean

true: If you want to keep the given pricelist as the default price list.
false: If you do not want to keep the given pricelist as the default price list.

currency
required
string <iso-4217>

Currency code, as defined by ISO-4217, of the price specified in the price list.

startDate
string <date-time>

Start date of the price list, it indicates the date when the price list becomes available to use.

endDate
string <date-time>

End date of the price list.

Responses
200

OK

400

Bad request

500

Internal Server Error

post/api-offers/price-list
Request samples
application/json
{
  • "name": "BuildMuscles-CONTRACT123",
  • "isDefault": false,
  • "currency": "CAD",
  • "startDate": "2021-05-04T09:23:51.459Z",
  • "endDate": "2021-06-09T09:23:51.459Z"
}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "priceListId": 10000003,
  • "name": "BuildMuscles-CONTRACT123",
  • "isDefault": false,
  • "currency": "USD",
  • "startDate": "2021-05-04T09:23:51.459Z",
  • "endDate": "2021-06-09T09:23:51.459Z",
  • "deleted": false,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Get all price lists

Retrieves a paginated list of all price lists.

SecurityAuthorizationToken
Request
query Parameters
limit
number >= 0
Default: 10

Number of records to return on a single page

offset
number >= 0
Default: 0

Number of records you wish to skip before selecting records

sortBy
string
Default: "updatedAt"

Field by which you want to sort the records

Enum: "updatedAt" "name" "priceListId"
sortOrder
string
Default: "desc"

Sorting order of the records

Enum: "asc" "desc"
filter
string

Value by which price lists are filtered

Value: "not_expired"
isDefault
boolean

If set to true, this endpoint returns the default price list

Enum: true false
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

400

Bad Request

500

Internal Server Error

get/api-offers/price-list
Response samples
application/json
{
  • "query": {
    },
  • "data": [
    ]
}

Get a specific price list

Enables you to retrieve details of a price list by price list ID or name.

SecurityAuthorizationToken
Request
path Parameters
required
string or number

ID or name of the price list to get details for

query Parameters
filterBy
string
Default: "priceListId"

Field by which you want to filter the record; by priceListId or by name of the price list

Enum: "priceListId" "name"
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

get/api-offers/price-list/{priceListId}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "priceListId": 10000003,
  • "name": "BuildMuscles-CONTRACT123",
  • "isDefault": false,
  • "currency": "USD",
  • "startDate": "2021-05-04T09:23:51.459Z",
  • "endDate": "2021-06-09T09:23:51.459Z",
  • "deleted": false,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Update a specific price list

Updates a specific price list by price list ID.

SecurityAuthorizationToken
Request
path Parameters
priceListId
required
number

Price list ID

Example: 10000003
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
name
required
string <= 300 characters

Pricelist name

isDefault
required
boolean

true: If you want to set the given price list as default price list.
false: If you do not want to set the given price list as default price list.

currency
string <iso-4217>

3 letter currency code as defined by ISO-4217

startDate
string <date-time>

Start date of the price list. It indicates the date when the price list will be available to use. This value can be null, however if you mention the start date, you must provide end date as well.

endDate
string <date-time>

End date of the price list. This value can be null, however if you mention an end date, you must provide a start date as well.

Responses
200

OK

404

Not Found

406

Not Acceptable

500

Internal Server Error

put/api-offers/price-list/{priceListId}
Request samples
application/json
{
  • "name": "BuildMuscles-CONTRACT123",
  • "isDefault": false,
  • "currency": "CAD",
  • "startDate": "2021-05-04T09:23:51.459Z",
  • "endDate": "2021-06-09T09:23:51.459Z"
}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "priceListId": 10000003,
  • "name": "BuildMuscles-CONTRACT123",
  • "isDefault": false,
  • "currency": "CAD",
  • "startDate": "2021-05-04T09:23:51.459Z",
  • "endDate": "2021-06-09T09:23:51.459Z",
  • "deleted": false,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Delete a specific price list

Delets a price list by priceListId.

SecurityAuthorizationToken
Request
path Parameters
priceListId
required
number

Price list ID

Example: 10000003
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

delete/api-offers/price-list/{priceListId}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "priceListId": 10000003,
  • "name": "BuildMuscles-CONTRACT123",
  • "isDefault": false,
  • "currency": "CAD",
  • "startDate": "2021-05-04T09:23:51.459Z",
  • "endDate": "2021-06-09T09:23:51.459Z",
  • "deleted": true,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Pricing

Pricing endpoints let you create and manage price details for one or many items. You can configure the pricing API to include your default price list in all requests.

Create or update price

Creates or updates price details for one or many items based on given item IDs. Support for currency code is determined based on the currency code you have set while creating the price list, whuch is identified by priceListId in the request body.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json

A JSON object containing price information

string or number

Optional. ID or name of the price list to update the price for. If you do not provide ID or name, price will be updated for the default price list.
If you are using this endpoint to create price details, the price list ID will be generated automatically.

itemIds
required
Array of numbers

Item IDs to create or update the price for

itemSkus
Array of strings

SKUs of the products to create or update the price for

required
Array of objects [ 1 .. 10 ] items
Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

post/api-offers/price
Request samples
application/json
{
  • "priceListId": "100-TwoWeeks",
  • "itemIds": [
    ],
  • "itemSkus": [
    ],
  • "offers": [
    ]
}
Response samples
application/json
[
  • {
    }
]

Get all prices

Gets a paginated list of all prices.

SecurityAuthorizationToken
Request
query Parameters
limit
number [ 1 .. 100 ]
Default: 10

Number of records returned on a single page.

page
number >= 1
Default: 1

Page number you want to get the record for.

priceListId
number

ID of the price list for which you want to get the price details

sortBy
string
Default: "updatedAt"

Field by which you want to sort the records

Enum: "itemId" "priceListId" "updatedAt"
sortOrder
string
Default: "desc"

Sorting order the records- ascending or descending

Enum: "asc" "desc"
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

400

Bad Request

500

Internal Server Error

get/api-offers/price
Response samples
application/json
{
  • "query": {
    },
  • "prices": [
    ]
}

Get price by priceId

Retrieves paginated list of price details based on priceListId and priceId or itemSku or itemId.

SecurityAuthorizationToken
Request
path Parameters
priceId
required
string

Value for this field can be database ID (_id) of the price or itemSku or itemId based on the type mentioned in the type query parameter.
If a type is not specified in the type query parameter, you must provide itemSku in this priceId field.

Example: SKU123456
priceListId
required
number

ID of the priceList to search the price for.

Example: 100000
query Parameters
type
string

The priceId path parameter will be treated as itemSku, itemId or _id based on the value of this field. The default search will be done by itemSku.

Enum: "itemSku" "itemId" "_id"
Example: type=itemId
limit
number

Number of records returned in the price offers array. Default is 10 if limit is not specified. If the isActive flag is sent, limit will be ignored.

Example: limit=10
page
number

Number of pages you wish to retrieve when selecting records in the price offers array. Default is 1. If the isActive flag is true, page will be ignored.

Example: page=1
isActive
boolean

If isActive is false, offers array response based on limit and page parameters.
If isActive is true, only the offer object whose price is active will be returned in the offers array.
Default value is false.

Example: isActive=false
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

get/api-offers/price/{priceId}/priceList/{priceListId}
Response samples
application/json
{
  • "_id": "62583d6e2d4b944f747127a5",
  • "isSoftDeleted": false,
  • "itemId": 1000000051,
  • "itemSku": "SKU123456",
  • "priceListId": 100000,
  • "offers": [
    ],
  • "createdAt": "2020-02-02T17:22:48.570Z",
  • "updatedAt": "2020-02-02T17:22:48.570Z",
  • "job": false,
  • "offerId": 1074,
  • "query": {
    }
}

Delete price by priceId

Deletes a price based on priceListID, and priceId or itemSku or itemId.

SecurityAuthorizationToken
Request
path Parameters
priceId
required
string

Value for this field can be database ID (_id) of the price or itemSku or itemId based on the type mentioned in the type query parameter.
If a type is not specified in the type query parameter, you must provide itemSku in this priceId field.

Example: SKU123456
priceListId
required
number

ID of the priceList to search the price for.

Example: 100000
query Parameters
type
string

The priceId path parameter will be treated as itemSku, itemId or databse ID (_id) depending on this field. The default search will be done by itemSku.

Enum: "itemSku" "itemId" "_id"
Example: type=itemId
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

delete/api-offers/price/{priceId}/priceList/{priceListId}
Response samples
application/json
{
  • "_id": "616e011037a3810012345678",
  • "isSoftDeleted": true,
  • "itemId": 1000000051,
  • "itemSku": "SKU123456",
  • "offerId": 2386,
  • "createdAt": "2020-02-02T17:22:48.570Z",
  • "updatedAt": "2020-02-02T17:22:48.570Z",
  • "job": false,
  • "priceListId": 100000,
  • "offers": [ ]
}

Price Add-on

Add-ons are additional items that shoppers want to buy while purchasing. Price add-on endpoints provide flexibility to create and manage such add-ons, and calculate price for the additional products that shoppers select while purchasing items.

Get all add-ons

Retrieves a paginated list of all add-ons.

SecurityAuthorizationToken
Request
query Parameters
limit
number

Limits the number of records returned on a single page. Default is 10 if limit is not specified

offset
number

Number of records you wish to skip before selecting records. Default is 0 if not specified

sortBy
string

Name of the field to sort the records. Default is updatedAt.

Enum: "updatedAt" "name" "priceAddonId" "price" "currency"
Example: sortBy=name
sortOrder
string

Order to sort the records- ascending or descending. Default is desc.

Enum: "desc" "asc"
Example: sortOrder=desc
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

400

Bad Request

500

Internal Server Error

get/api-offers/addon
Response samples
application/json
{
  • "query": {
    },
  • "data": [
    ]
}

Create add-on

Create a price add-on record.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
name
required
string

Add-on name. It must be unique.

currency
required
string

Currency of the add-on

price
required
number

Price of the add-on. Should be equal to or greater than zero.

Responses
200

OK

400

Bad request

500

Internal Server Error

post/api-offers/addon
Request samples
application/json
{
  • "name": "BuildMotor",
  • "currency": "USD",
  • "price": 458.97
}
Response samples
application/json
{
  • "_id": "61118a79c7357752aa96aa76",
  • "priceAddonId": 100000,
  • "name": "BuildMotor",
  • "currency": "USD",
  • "price": 458.97,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2020-12-14T12:15:43.646Z",
  • "deleted": false
}

Update add-on by ID

Update a price add-on record by add-on ID

SecurityAuthorizationToken
Request
path Parameters
addonId
required
string

You can send either the database _id or the priceAddonId of the add-on to update. i.e. 61118a79c7357752aa96aa76 or 100010.

Example: 61118a79c7357752aa96aa76
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
name
required
string

Add-on name. It must be unique.

currency
required
string

Currency of the add-on

price
required
number

Price of the add-on. Should be equal to or greater than zero.

Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

put/api-offers/addon/{addonId}
Request samples
application/json
{
  • "name": "BuildMotor",
  • "currency": "USD",
  • "price": 458.97
}
Response samples
application/json
{
  • "_id": "61118a79c7357752aa96aa76",
  • "priceAddonId": 100000,
  • "name": "BuildMotor",
  • "currency": "USD",
  • "price": 458.97,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2020-12-14T12:15:43.646Z",
  • "deleted": false
}

Delete add-on

Deletes an add-on record by add-on ID

SecurityAuthorizationToken
Request
path Parameters
addonId
required
string

You can send either the database _id or the priceAddonId of the add-on to delete. i.e. 61118a79c7357752aa96aa76 or 100010.

Example: 61118a79c7357752aa96aa76
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

delete/api-offers/addon/{addonId}
Response samples
application/json
{
  • "_id": "61118a79c7357752aa96aa76",
  • "priceAddonId": 100000,
  • "name": "BuildMotor",
  • "currency": "USD",
  • "price": 458.97,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2020-12-14T12:15:43.646Z",
  • "deleted": true
}

Price Method Type

Price method types are rules or formulas to calculate prices of products based on the selected priceMethodType. These endpoints let you create and manage such price-method-types.

Get all price method types

Get a paginated list of all price method types.

SecurityAuthorizationToken
Request
query Parameters
limit
number

Limits number of records returned on a single page. Default is 10 if limit is not specified

page
number

Number of page for selecting records. Default is 1 if not specified. It is always paired with limit

sortBy
string

Field by which you want to sort records. Default is updatedAt.

Enum: "updatedAt" "name"
Example: sortBy=name
sortOrder
string

Order to sort the records- ascending or descending. Default is desc.

Enum: "desc" "asc"
Example: sortOrder=desc
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

400

Bad Request

500

Internal Server Error

get/api-offers/method
Response samples
application/json
{
  • "query": {
    },
  • "data": [
    ]
}

Create price method type

Create a price method type record.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
name
required
string

Price Method Type name. Must be UNIQUE.

Responses
200

OK

400

Bad request

500

Internal Server Error

post/api-offers/method
Request samples
application/json
{
  • "name": "SurfaceArea_Square_Increment"
}
Response samples
application/json
{
  • "_id": "61118a79c7357752aa96aa76",
  • "priceMethodId": 100000,
  • "name": "SurfaceArea_Square_Increment",
  • "deleted": false,
  • "createdAt": "2021-10-14T12:15:43.646Z",
  • "updatedAt": "2021-10-14T12:15:43.646Z"
}

Update a specific price method type

Updates a specific price method type record by priceMethodId

SecurityAuthorizationToken
Request
path Parameters
priceMethodId
required
string

You can send either the database _id or the priceMethodId of the row to update. i.e. 61118a79c7357752aa96aa76 or 100010.

Example: 61118a79c7357752aa96aa76
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
name
required
string

Price Method Type name. Must be UNIQUE.

Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

put/api-offers/method/{priceMethodId}
Request samples
application/json
{
  • "name": "SurfaceArea_Square_Increment"
}
Response samples
application/json
{
  • "_id": "61118a79c7357752aa96aa76",
  • "priceMethodId": 100000,
  • "name": "SurfaceArea_Square_Increment",
  • "deleted": false,
  • "createdAt": "2021-10-14T12:15:43.646Z",
  • "updatedAt": "2021-10-14T12:15:43.646Z"
}

Delete a specific price method type

Deletes a specific price method type record by priceMethodId

SecurityAuthorizationToken
Request
path Parameters
priceMethodId
required
string

You can send either the database _id or the priceMethodId of the row to delete. i.e. 61118a79c7357752aa96aa76 or 100010.

Example: 61118a79c7357752aa96aa76
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

delete/api-offers/method/{priceMethodId}
Response samples
application/json
{
  • "_id": "61118a79c7357752aa96aa76",
  • "priceMethodId": 100000,
  • "name": "SurfaceArea_Square_Increment",
  • "deleted": true,
  • "createdAt": "2021-10-14T12:15:43.646Z",
  • "updatedAt": "2021-10-14T12:15:43.646Z"
}

Price Guard

Price Guard allows you to create and manage more diversified price-kinds for the item, such as manufacturer recommended retail price (MSRP), minimum advertised price (MAP), floor price, ceiling price, clearance price, and so on. Price guard works as a protection mechanism against any further creation of prices for the item. These endpoints let you create and manage such price-kinds.

Create price guard

Creates a price guard record that can contain various price kinds other than the elemental prices such as base price, sale price, and clearance price.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
itemId
required
integer

Item ID

itemSku
string

Item SKU

priceListId
required
integer

PriceList ID

MSRP
number

Manufacturer suggested retail price

MAP
number

Minimum advertised price

ceiling
number

Maximum price the seller is allowed to charge for the product. Price created for the item ID or item SKU under the specified pricelist should not exceed the given ceiling price.

floor
number

Lowest price at which the product can be sold. Price created for the item ID or item SKU under the specified pricelist should not be lower than the given floor price.

Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

post/api-offers/price-guard
Request samples
application/json
{
  • "itemId": 10000000123,
  • "itemSku": "DEF-SKU-1",
  • "priceListId": 100000,
  • "MSRP": 299,
  • "MAP": 299,
  • "ceiling": 299,
  • "floor": 299
}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "itemId": 10000000123,
  • "itemSku": "DEF-SKU-1",
  • "priceListId": 100000,
  • "MSRP": 299,
  • "MAP": 299,
  • "ceiling": 299,
  • "floor": 299,
  • "deleted": false,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Get all price guards

Retrieves a paginated list of price guards based on query parameters.

SecurityAuthorizationToken
Request
query Parameters
limit
number

Limits number of records returned on a single page. Default is 10 if limit is not specified

offset
number

Number of records you wish to skip before selecting records. Default is 0 if not specified

itemId
integer

Item ID for which price guards are to be retrieved

priceListId
integer

ID of the price list under which price gurards are to be retrieved

sortBy
string

Field by which you want to sort the records

Enum: "priceListId" "itemId" "updatedAt"
sortOrder
string

Ascending or Descending

Value: "desc, asc"
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

400

Bad Request

500

Internal Server Error

get/api-offers/price-guard
Response samples
application/json
{
  • "query": {
    },
  • "data": [
    ]
}

Update a specific price guard

Updates a specific price guard record by priceguardId.

SecurityAuthorizationToken
Request
path Parameters
priceGuardId
required
number

ID of the price guard to update

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
itemId
required
integer

Item ID

itemSku
string

Item SKU

priceListId
required
integer

PriceList ID

MSRP
number

Manufacturer suggested retail price

MAP
number

Minimum advertised price

ceiling
number

Maximum price the seller is allowed to charge for the product. Price created for the item ID or item SKU under the specified pricelist should not exceed the given ceiling price.

floor
number

Lowest price at which the product can be sold. Price created for the item ID or item SKU under the specified pricelist should not be lower than the given floor price.

Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

put/api-offers/price-guard/{priceGuardId}
Request samples
application/json
{
  • "itemId": 10000000123,
  • "itemSku": "DEF-SKU-1",
  • "priceListId": 100000,
  • "MSRP": 299,
  • "MAP": 299,
  • "ceiling": 299,
  • "floor": 299
}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "itemId": 10000000123,
  • "itemSku": "DEF-SKU-1",
  • "priceListId": 100000,
  • "MSRP": 299,
  • "MAP": 299,
  • "ceiling": 299,
  • "floor": 299,
  • "deleted": false,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Delete a specific price guard

Deletes a specific price guard record by ID.

SecurityAuthorizationToken
Request
path Parameters
priceGuardId
required
number

ID of the price guard to delete

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

delete/api-offers/price-guard/{priceGuardId}
Response samples
application/json
{
  • "_id": "614b58924e92f6861ac9d43b",
  • "itemId": 10000000123,
  • "itemSku": "DEF-SKU-1",
  • "priceListId": 100000,
  • "MSRP": 299,
  • "MAP": 299,
  • "ceiling": 299,
  • "floor": 299,
  • "deleted": false,
  • "createdAt": "2020-12-14T12:15:43.646Z",
  • "updatedAt": "2021-12-14T12:15:43.646Z"
}

Price Kind

Unlike price guard, price kind endpoint lets you get the fundamental price kinds (for example, base price and sale price) that are created while setting up the item information.

Get all price kinds

Retrieves a paginated list of all normal price kinds that are setup earlier. It returns only price-kinds, not the price information. Price kinds indicate if the offer is under clearance or promotion or base price status. If clearance or promotion price is not set up earlier, a price kind is considered as base price.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
limit
number

Number of records to return on a single page

page
number

Page number to return. Always paired with limit

Responses
200

OK

400

Bad Request

500

Internal Server Error

post/api-offers/price-kind
Request samples
application/json
{
  • "limit": 10,
  • "page": 1
}
Response samples
application/json
[
  • {
    }
]

Promotion

Promotion is a discount on an item, cart or shipping method based on set conditions. As promotions can be linked to specific price lists, it is important to submit the correct price list ID. Promotion endpoints let you create and manage discounts that will be applied to all customers' carts that meet the required conditions.

Create promotion

Enables you to create a promotion

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
title
required
string [ 3 .. 120 ] characters

Promotion title

buyOperator
string
Default: "OR"

It is used to define operator between different Buy conditions (different conditions as mentioned in the condition object)

Enum: "AND" "OR"
required
Array of objects
startDate
required
string <date-time>

Start date of the promotion

endDate
required
string <date-time>

End date of the promotion

isExclusive
required
boolean

true: it is exclusively a promotion, and coupon cannot be applied on the promotion
false: coupon can be stacked on the promotion

type
required
string

Promotion type.
Product: SKU promotion. Promotion or discount on SKUs based on the value mentioned in discount object
CART: Cart promotion. Promotion or discount on minimum order amount of cart based on the ORDER_VALUE that is set in condition object
QUANTITY: Quantity promotion provides discounts on items based on the quantity requirement set in the promotion
BOGO: Buy One Get One promotion provides discounts based on the Buy conditions and Get discounts
SHIPPING: Shipping promotion provides discounts on the shipping cost
BUYGET: BuyGet promotion specifies the Buy conditions and Get discounts
SPEND_GET: SpendGet promotion can specify the requirement of cart order value and the corresponding Get discounts

Enum: "PRODUCT" "CART" "QUANTITY" "BOGO" "SHIPPING" "BUYGET" "SPEND_GET"
Array of objects (termsAndConditions)
shipmentMethodIds
Array of strings

Required for Shipping type promo to provide eligible shipment Method IDs

eligiblePriceList
Array of numbers

IDs of the price lists to which this promotion is applied

Array of objects

Array of limits for the promotion to be applied

note
string

Promotion note or description

Responses
200

OK

400

Bad request

500

Internal Server Error

post/api-offers/promo/create
Request samples
application/json
{
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!"
}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "SCHEDULED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}

Get all promotions

Retrieves a paginated list of all promotions.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
offset
number >= 0

Number of records you wish to skip before selecting records

limit
number [ 1 .. 100 ]
Default: 10

Number of records to return on a single page

keyword
string

Keyword to filter the matched promotion titles or promotional codes or coupon codes

sortBy
string
Default: "updatedAt"

Field by which you want to sort the records

Enum: "updatedAt" "title" "startDate" "endDate"
sortOrder
string
Default: "desc"

Sorting order of the records
desc: Descending order
asc: Ascending order

Enum: "desc" "asc"
Responses
200

OK

400

Bad Request

500

Internal Server Error

post/api-offers/promo/list
Request samples
application/json
{
  • "offset": 0,
  • "limit": 10,
  • "keyword": "PROMO",
  • "sortBy": "updatedAt",
  • "sortOrder": "desc"
}
Response samples
application/json
{
  • "query": {
    },
  • "promos": [
    ]
}

Get a specific promotion

Retrieves details of a specific promotion by ID

SecurityAuthorizationToken
Request
path Parameters
promoId
required
string

ID of the promotion to be retrieved

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

get/api-offers/promo/{promoId}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "SCHEDULED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [ ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}

Delete a specific promotion

Deletes a specific promotion by ID. You can delete all promotions except an active promotion that has state defined as ACTIVE.

SecurityAuthorizationToken
Request
path Parameters
promoId
required
number

ID of the promotion to be deleted

Example: 61dfc146bf98990009b7091c
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

delete/api-offers/promo/{promoId}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "SCHEDULED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z",
  • "deleted": true
}

Update a specific promotion

Updates a specific promotion based on promotion ID

SecurityAuthorizationToken
Request
path Parameters
promoId
required
string

ID of the promotion to be updated

Example: 61df12345678900009b7091c
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
title
required
string [ 3 .. 120 ] characters

Promotion title

buyOperator
string
Default: "OR"

It is used to define operator between different Buy conditions (different conditions as mentioned in the condition object)

Enum: "AND" "OR"
required
Array of objects
startDate
required
string <date-time>

Start date of the promotion

endDate
required
string <date-time>

End date of the promotion

isExclusive
required
boolean

true: it is exclusively a promotion, and coupon cannot be stacked on promotion
false: coupon can be stacked on promotion

type
required
string

Promotion type.
Product: Promotion or discount on SKUs based on the value mention in discount object
CART: Promotion or discount on cart amount based on the ORDER_VALUE that is set in condition object
QUANTITY: Quantity promotion provides discounts based on the quantity requirement set in the promotion
BOGO: Buy One Get One promotion provides discounts based on the Buy conditions and Get discounts
SHIPPING: Shipping promotion provides discounts on the shipping cost
BUYGET: BuyGet promotion specifies the Buy conditions and Get discounts
SPEND_GET: SpendGet promotion can specify the requirement of cart order value and get the corresponding discounts

Enum: "PRODUCT" "CART" "QUANTITY" "BOGO" "SHIPPING" "BUYGET" "SPEND_GET"
Array of objects (termsAndConditions)
shipmentMethodIds
Array of strings

Required for Shipping type promo to provide eligible shipment methods

eligiblePriceList
Array of numbers

IDs of the price lists to which this promotion is applied

Array of objects

Array of limits for the promotion to be applied

note
string

Promo note or description

Responses
200

OK

400

Bad request

404

Not Found

500

Internal Server Error

put/api-offers/promo/update/{promoId}
Request samples
application/json
{
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!"
}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "SCHEDULED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}

Enable or disable a promotion

Lets you toggle promotion status by enabling or disabling a promotion, not applicable to ACTIVE promotions.
Enable a promotion: Only disabled promotions can be enabled.
Disable a promotion: Only not expired promotions can be disabled.

SecurityAuthorizationToken
Request
path Parameters
promoId
required
string

ID of the promotion to be toggled

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
enable
required
boolean

flag to enable or disable a promotion.
If set to true, this endpoint enables a disabled promotion.
If set to false, this endpoint disables an enabled promotion.

Responses
200

OK

404

Not Found

500

Internal Server Error

put/api-offers/promo/{promoId}/enable-disable
Request samples
application/json
{
  • "enable": false
}
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "DISABLED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}

Stop a promotion

Lets you stop a specific promotion. This endpoint sets state as EXPIRED, and expiration date (both start date and end date) to the same current date.

SecurityAuthorizationToken
Request
path Parameters
promoId
required
string

ID of the promotion to be stopped

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

OK

404

Not Found

500

Internal Server Error

post/api-offers/promo/{promoId}/kill
Response samples
application/json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [ ],
  • "state": "EXPIRED",
  • "isImplicit": true,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2021-10-18T23:45:40.289Z",
  • "endDate": "2021-10-18T23:45:40.289Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}

Coupon

Coupon endpoints let you create and manage coupon codes that customers can enter at checkout to receive a discount.

Get list of all coupons

Retrieves a paginated list of all coupons.

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
offset
number >= 0

Number of records you wish to skip before selecting records

limit
number [ 1 .. 100 ]
Default: 10

Number of records to return on a single page

keyword
string

Keyword to filter the matched promotion titles or promotional codes or coupon codes

sortBy
string
Default: "updatedAt"

Field by which you want to sort the records

Enum: "updatedAt" "title" "startDate" "endDate"
sortOrder
string
Default: "desc"

Sorting order of the records
desc: Descending order
asc: Ascending order

Enum: "desc" "asc"
Responses
200

OK

400

Bad Request

500

Internal Server Error

post/api-offers/coupon/list
Request samples
application/json
{
  • "offset": 0,
  • "limit": 10,
  • "keyword": "PROMO",
  • "sortBy": "updatedAt",
  • "sortOrder": "desc"
}
Response samples
application/json
{
  • "query": {
    },
  • "promos": [
    ]
}

Create coupon

Enables you to create a coupon that can be applied to get discounts

SecurityAuthorizationToken
Request
header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
title
required
string [ 3 .. 120 ] characters

Coupon title

buyOperator
string
Default: "OR"

It is used to define operator between different Buy conditions (different conditions as mentioned in the condition object)

Enum: "AND" "OR"
required
Array of objects
startDate
required
string <date-time>

Start date of the promotion

endDate
required
string <date-time>

End date of the promotion

isExclusive
required
boolean

To define if a coupon can be stacked on promotions.
true: it is exclusively a coupon and coupon cannot be applied on items that already has promotions applied to them.
false: ccoupon can be applied on items that already has promotions applied to them.

type
required
string

Promotion type.
Product: SKU promotion. Promotion or discount on SKUs based on the value mentioned in discount object
CART: Cart promotion. Promotion or discount on minimum cart value based on the ORDER_VALUE that is set in condition object
QUANTITY: Quantity promotion provides discounts based on the quantity requirement set in the promotion
BOGO: Buy One Get One promotion provides discounts based on the Buy conditions and Get discounts
SHIPPING: Shipping promotion provides discounts on the shipping cost
BUYGET: BuyGet promotion specifies the Buy conditions and Get discounts
SHIPPING: Shipping promotion provides discounts on the shipping cost
SPEND_GET: SpendGet promotion can specify the requirement of cart order value and the corresponding Get discounts

Enum: "PRODUCT" "CART" "QUANTITY" "BOGO" "SHIPPING" "BUYGET" "SPEND_GET"
Array of objects (termsAndConditions)
shipmentMethodIds
Array of strings

Required for shipping type promo to provide eligible shipment methods

eligiblePriceList
Array of numbers

IDs of the price lists to which this promotion is applied

note
string

Promotion note or description

promoCodes
required
Array of strings

Returns an empty array for a promotion, but contains promo codes for a coupon

Array of objects

Array of limits for the coupon to be applied

Responses
200

OK

400

Bad request

500

Internal Server Error

post/api-offers/coupon/create
Request samples
application/json
{
  • "title": "CREATE COUPON",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "note": "Independence day sale!",
  • "promoCodes": [
    ],
  • "limits": [
    ]
}
Response samples
application./json
{
  • "_id": "abcdefg1ee7ce20123456789",
  • "promoId": 100013,
  • "promoCodes": [
    ],
  • "state": "SCHEDULED",
  • "isImplicit": false,
  • "title": "CREATE PROMO",
  • "buyOperator": "OR",
  • "promo": [
    ],
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-25T14:15:22Z",
  • "isExclusive": true,
  • "type": "PRODUCT",
  • "termsAndConditions": [
    ],
  • "shipmentMethodIds": [
    ],
  • "eligiblePriceList": [
    ],
  • "limits": [
    ],
  • "note": "Independence day sale!",
  • "createdAt": "2019-08-20T14:15:22Z",
  • "updatedAt": "2019-08-20T14:15:22Z"
}

Update a specific coupon

Updates a specific coupon by coupon ID

SecurityAuthorizationToken
Request
path Parameters
couponId
required
number

ID of the coupon to be updated

header Parameters
required
object

Valid JSON object that must contain account, stage, date, and channel attributes. eg - {"stage":"prod","account":"5f328bf0b","date":"2020-12-12T08:00:00.000Z","channel":12}

Authorization
required
string

Authorization token or access token for the user, provided by fabric. It can be obtained after logging into fabric's copilot account.

Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
Request Body schema: application/json
title
required
string [ 3 .. 120 ] characters

Promotion or coupon title

buyOperator
string
Default: "OR"

It is used to define operator between different Buy conditions (different conditions as mentioned in the condition object)

Enum: "AND" "OR"
required
Array of objects
startDate
required
string <date-time>

Start date of the promotion

endDate
required
string <date-time>

End date of the promotion

isExclusive
required
boolean

To define if a coupon can be stacked on promotions.
true: it is exclusively a coupon and coupon cannot be applied on items that already has promotions applied to them.
false: ccoupon can be applied on items that already has promotions applied to them.

type
required
string

Promotion type.
Product: SKU promotion. Promotion or discount on SKUs based on the value mentioned in discount object
CART: Cart promotion. Promotion or discount on minimum cart value based on the ORDER_VALUE that is set in condition object
QUANTITY: Quantity promotion provides discounts based on the quantity requirement set in the promotion
BOGO: Buy One Get One promotion provides discounts based on the Buy conditions and Get discounts
SHIPPING: Shipping promotion provides discounts on the shipping cost
BUYGET: BuyGet promotion specifies the Buy conditions and Get discounts
SHIPPING: Shipping promotion provides discounts on the shipping cost
SPEND_GET: SpendGet promotion can specify the requirement of cart order value and the corresponding Get discounts

Enum: "PRODUCT" "CART" "QUANTITY" "BOGO" "SHIPPING" "BUYGET" "SPEND_GET"
Array of objects (termsAndConditions)
shipmentMethodIds
Array of strings

Required for Shipping type promo to provide eligible shipment Methods

eligiblePriceList
Array of numbers

IDs of the price lists to which this promotion is applied

promoCodes
required
Array of strings

Returns an empty array for a promotion, but will contain promo codes for a coupon

Array of objects

Array of limits for the coupon to be applied

note
string

Promo note or description

Responses
200

OK

400

Bad request

404

Not F