Skip to content
Navigation

Update a promotion

PUT
https://api.nicer.travel/config/promotion/{promotionId}

Changes any of the editable fields of one of the agency's promotions, leaving the rest as they are, and answers the promotion as saved. Only the agency's admins may call it. Errors: 404 ERROR_ITEM_NOT_FOUND for a promotion the agency does not have; 400 ERROR_COMPANY_REQUIRED for a request that names no agency.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • promotionId
    string
    required

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
    optional
    string
  • description
    optional
    string
  • 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))$
  • images
    optional
    array of
    string
    minLength: 1
  • 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
  • title
    optional
    string
    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