Skip to content
Navigation

Create a promotion

POST
https://api.nicer.travel/config/promotion

Creates a promotion for the agency the request acts for from a title, description, images and button label, with an optional price, tag and date window, and answers it with its promotionId. It is saved as a draft unless status says otherwise; the agency, its author and its last editor come from the caller, never from the body. Only the agency's admins may call it. Errors: 400 ERROR_COMPANY_REQUIRED for a request that names no agency.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • x-nicer-company
    optional
    string

    Company context for an agency admin who belongs to several companies. Optional when the caller belongs to one.

Request body JSON required

  • buttonName
    string
    required
  • description
    string
    required
  • images
    array of
    string
    required
    minLength: 1
  • title
    string
    required
    minLength: 1
  • endDate
    optional
    string
    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
  • price
    optional
    string
  • startDate
    optional
    string
    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
  • tag
    optional
    object
    • color
      string
      required
      minLength: 1
    • name
      string
      required
      minLength: 1
  • status
    optional
    published
    or
    draft
    or
    deactivated

Returns

200

OK

JSON
  • buttonName
    string
    required
  • companyName
    string
    required
  • createdBy
    string
    required
  • description
    string
    required
  • images
    array of
    string
    required
    minLength: 1
  • lastModifiedBy
    string
    required
  • status
    published
    or
    draft
    or
    deactivated
    required
  • title
    string
    required
    minLength: 1
  • promotionId
    string
    required
    pattern: ^PROMO.*
  • type
    string
    required
  • createdAt
    string
    required
  • updatedAt
    string
    required
  • endDate
    optional
    string
    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
  • price
    optional
    string
  • startDate
    optional
    string
    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
  • tag
    optional
    object
    • color
      string
      required
      minLength: 1
    • name
      string
      required
      minLength: 1

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close