Base URL

https://api.venuerun.com/merchants/:merchantId/coupons

Coupons

Coupons define discounts that can be applied to orders.

This doc was generated by our interal API tester at:

November 11, 2024 at 2:00:27 AM

Endpoints

GET /merchants/:merchantId/coupons
GET /merchants/:merchantId/coupons/:couponId
POST /merchants/:merchantId/products
POST /merchants/:merchantId/coupons/:couponId
DELETE /merchants/:merchantId/coupons/:couponId

The Coupon Object

Properties

  • Name
    id
    Type
    string read-only
    Description
    The id of the coupon
  • Name
    title
    Type
    string
    Description
    The title of the modifier
  • Name
    description
    Type
    string
    Description
    A description of the modifier
  • Name
    code
    Type
    string
    Description
    The code of the coupon
  • Name
    type
    Type
    string
    Description
    The type of the coupon PERCENTAGE or FIXED
  • Name
    active
    Type
    boolean
    Description
    Is the coupon active
  • Name
    value
    Type
    string
    Description
    The value of the coupon
  • Name
    minimumOrderAmount
    Type
    number
    Description
    The minimum order amount for the coupon
  • Name
    individualUse
    Type
    boolean
    Description
    Is the coupon for individual use
  • Name
    timesRedeemed
    Type
    number
    Description
    The number of times the coupon has been redeemed
  • Name
    applyToAllProducts
    Type
    boolean
    Description
    Apply the coupon to all products
  • Name
    products
    Type
    array
    Description
    Array of productIds the coupon applies to
  • Name
    []
    Type
    string
    Description
    Id of an product
  • Name
    createdAt
    Type
    string read-only
    Description
    The date the coupon was created
  • Name
    updatedAt
    Type
    string read-only
    Description
    The date the coupon was updated

The Coupon Object

{
  "active": true,
  "applyToAllProducts": true,
  "code": "SAVE10EXTENDED",
  "createdAt": 1731312024,
  "description": "",
  "id": "1lWG2KjiMlRam4tBx6i4",
  "individualUse": true,
  "minimumOrderAmount": 0,
  "products": [],
  "testMode": true,
  "timesRedeemed": 0,
  "title": "Save 10% on your order EXTENDED!",
  "type": "PERCENTAGE",
  "updatedAt": 1731312024,
  "value": 10
}

POST/merchants/:merchantId/coupons

Create a Coupon

This endpoint allows you to create a Coupon

Required attributes

  • Name
    title
    Type
    string
    Description
    The title of the modifier
  • Name
    code
    Type
    string
    Description
    The code of the coupon
  • Name
    type
    Type
    string
    Description
    The type of the coupon PERCENTAGE or FIXED
  • Name
    value
    Type
    string
    Description
    The value of the coupon

Optional attributes

  • Name
    id
    Type
    string read-only
    Description
    The id of the coupon
  • Name
    description
    Type
    string
    Description
    A description of the modifier
  • Name
    active
    Type
    boolean
    Description
    Is the coupon active
  • Name
    minimumOrderAmount
    Type
    number
    Description
    The minimum order amount for the coupon
  • Name
    individualUse
    Type
    boolean
    Description
    Is the coupon for individual use
  • Name
    timesRedeemed
    Type
    number
    Description
    The number of times the coupon has been redeemed
  • Name
    applyToAllProducts
    Type
    boolean
    Description
    Apply the coupon to all products
  • Name
    products
    Type
    array
    Description
    Array of productIds the coupon applies to
  • Name
    []
    Type
    string
    Description
    Id of an product
  • Name
    createdAt
    Type
    string read-only
    Description
    The date the coupon was created
  • Name
    updatedAt
    Type
    string read-only
    Description
    The date the coupon was updated

Request

POST
/merchants/:merchantsId/coupons
const coupon = await VenueRun.coupons.create({
  title: "Save 10% on your order",
  description: "",
  code: "SAVE10",
  type: "PERCENTAGE",
  active: true,
  value: 10,
  minimumOrderAmount: 0,
  individualUse: true,
  timesRedeemed: 0,
  applyToAllProducts: true,
  products: []
});

POST/merchants/:merchantId/coupons/:couponId

Update a coupon

This endpoint allows you to update a Coupon

Required parameters

  • Name
    id
    Type
    string
    Description

    id of the coupons

Optional attributes

  • Name
    id
    Type
    string read-only
    Description
    The id of the coupon
  • Name
    description
    Type
    string
    Description
    A description of the modifier
  • Name
    active
    Type
    boolean
    Description
    Is the coupon active
  • Name
    minimumOrderAmount
    Type
    number
    Description
    The minimum order amount for the coupon
  • Name
    individualUse
    Type
    boolean
    Description
    Is the coupon for individual use
  • Name
    timesRedeemed
    Type
    number
    Description
    The number of times the coupon has been redeemed
  • Name
    applyToAllProducts
    Type
    boolean
    Description
    Apply the coupon to all products
  • Name
    products
    Type
    array
    Description
    Array of productIds the coupon applies to
  • Name
    []
    Type
    string
    Description
    Id of an product
  • Name
    createdAt
    Type
    string read-only
    Description
    The date the coupon was created
  • Name
    updatedAt
    Type
    string read-only
    Description
    The date the coupon was updated

Request

POST
/merchants/:merchantsId/coupons/couponId
await VenueRun.coupons.update(couponId, {
  title: "Save 10% on your order EXTENDED!",
  code: "SAVE10EXTENDED"
});

Response

{
  "active": true,
  "applyToAllProducts": true,
  "code": "SAVE10EXTENDED",
  "createdAt": 1731312024,
  "description": "",
  "id": "1lWG2KjiMlRam4tBx6i4",
  "individualUse": true,
  "minimumOrderAmount": 0,
  "products": [],
  "testMode": true,
  "timesRedeemed": 0,
  "title": "Save 10% on your order EXTENDED!",
  "type": "PERCENTAGE",
  "updatedAt": 1731312024,
  "value": 10
}

GET/merchants/:merchantId/coupons/:couponId

Retrive a Coupon

This endpoint allows you to retrieve a Coupon

Required parameters

  • Name
    id
    Type
    string
    Description

    id of the Coupon

Request

GET
/merchants/:merchantsId/coupons/:couponId
const product = await VenueRun.coupons.retrieve(product.id);

Response

{
  "active": true,
  "applyToAllProducts": true,
  "code": "SAVE10EXTENDED",
  "createdAt": 1731312024,
  "description": "",
  "id": "1lWG2KjiMlRam4tBx6i4",
  "individualUse": true,
  "minimumOrderAmount": 0,
  "products": [],
  "testMode": true,
  "timesRedeemed": 0,
  "title": "Save 10% on your order EXTENDED!",
  "type": "PERCENTAGE",
  "updatedAt": 1731312024,
  "value": 10
}

DELETE/merchants/:merchantId/coupons/:couponId

Delete a coupon

This endpoint allows you to delete a Coupon

Required parameters

  • Name
    id
    Type
    string
    Description

    id of the product

Request

POST
/merchants/:merchantsId/coupons/:couponId
await VenueRun.coupons.delete(couponId);

Response

{
  "id": "1lWG2KjiMlRam4tBx6i4",
  "object": {
    "active": true,
    "applyToAllProducts": true,
    "code": "SAVE10EXTENDED",
    "createdAt": 1731312024,
    "description": "",
    "id": "1lWG2KjiMlRam4tBx6i4",
    "individualUse": true,
    "minimumOrderAmount": 0,
    "products": [],
    "testMode": true,
    "timesRedeemed": 0,
    "title": "Save 10% on your order EXTENDED!",
    "type": "PERCENTAGE",
    "updatedAt": 1731312024,
    "value": 10
  },
  "message": "Coupon deleted",
  "deleted": true
}

GET/merchants/:merchantId/coupons

Get all Coupons

This endpoint allows you to list all Coupons

Request

POST
/merchants/:merchantsId/coupons
await VenueRun.coupons.list()

Was this page helpful?