bill_promocodes


The bill_promocodes bill_promocodes allows partners to create promo codes for discounts on bill_plans. Promocodes can be of 2 types. Fixed Price (fp) or % (pc) off. The promocode would be submitted with the /account_profiles/single PUT upon initial account setup.


Available HTTP and Response Types
DELETE GET POST PUT | JSON

6 Methods


  • DELETE
    https://api.pagely.com/ v1 / bill_promocodes /single

    Available To Partner

    Description
    No Description

    Sample Response


      Required Params

      id int
  • GET
    https://api.pagely.com/ v1 / bill_promocodes /single

    Available To Partner

    Description

    curl -H “X-API-KEY:<key>” https://api.pagely.com/v1/bill_promocodes/single?id=1112

    Sample Response

    {"id":"1112","reseller_id":"001","active":"1","code":"IXNA111","name":"Fresh Start for Visual Society Users","desc":"Fresh Start for Visual Society Users","type":"fp","value":"18","used":"0","max_used":"25","date_added":"1344378182","date_updated":"1344382286"}

      Required Params

      id int
  • GET
    https://api.pagely.com/ v1 / bill_promocodes /all

    Available To Partner

    Description

    curl -H “X-API-KEY:<key>” https://api.pagely.com/v1/bill_promocodes/all

    Sample Response

    {"result":2,"count":3,"limit":25,"offset":0,"objects":[{"id":"1212","reseller_id":"001","active":"1","code":"43ASDSA","name":"Fresh Start for Visual Society Users","desc":"Fresh Start for Visual Society Users","type":"fp","value":"18","used":"0","max_used":"25","date_added":"1344378182","date_updated":"1344382286"},{"id":"1212","reseller_id":"1","active":"0","code":"FOOBAR1112","name":"SAVE 40%","desc":"SAVE 40%","type":"pc","value":"40","used":"0","max_used":"5","date_added":"1338874440","date_updated":"1338874440"},{"id":"1212","reseller_id":"1","active":"0","code":"LEA123111","name":"75% off on leap year.","desc":"75% off on leap year.","type":"pc","value":"75","used":"0","max_used":"50","date_added":"1338874440","date_updated":"1338874440"}]}

      Optional Params

      active bool
      code string
      limit int
      offset int
      order_by string id
      order_dir string DESC
      reseller_id int
  • GET
    https://api.pagely.com/ v1 / bill_promocodes /validate

    Available To Partner

    Description

    curl -H “X-API-KEY:<key>” https://api.pagely.com/v1/bill_promocodes/validate?id=215

    Sample Response

    {"result":3,"message":"You need to supply a valid code."}

      Required Params

      code string

      Optional Params

      reseller_id int
  • POST
    https://api.pagely.com/ v1 / bill_promocodes /single

    Available To Partner

    Description

    curl -X POST -H “X-API-KEY:<key>” -d “id=216&value=50” https://api.pagely.com/v1/bill_promocodes/single

    Sample Response

    {"result":2,"id":"216","object":{"id":"216","reseller_id":"1","active":"0","code":"foo","name":"bar","desc":"my desc","type":"pc","value":"50","used":"0","max_used":"10","date_added":"1345367316","date_updated":"1345367424"},"message":"Object has been created."}

      Required Params

      id int

      Optional Params

      active bool
      desc string
      max_used int mac number of uses for code
      name string
      type string fp|pc
      value int for fp 10.00| for pc 40 for 40%
  • PUT
    https://api.pagely.com/ v1 / bill_promocodes /single

    Available To Partner

    Description

    curl -X PUT -H “X-API-KEY:<key>” -d “code=foo&name=bar&desc=my desc&value=40&type=pc&max_used=10” https://api.pagely.com/v1/bill_promocodes/single

    Sample Response

    {"result":2,"id":216,"object":{"id":"216","reseller_id":"1","active":"0","code":"foo","name":"bar","desc":"my desc","type":"pc","value":"40","used":"0","max_used":"10","date_added":"1345367316","date_updated":"1345367316"},"message":"Object has been created."}

      Required Params

      code string
      desc string
      max_used int max uses
      name string
      type int fp|pc
      value int for fp 10.00|for pc 40 for 40%

      Optional Params

      reseller_id int