Price List API v2

From Memsource
Jump to: navigation, search

Create New Price List

action: api/v2/priceList/create
    token                       string
    name                        string
    currency                    currency
    unit                        enum(BillingUnit)        O(Word)

response: JSON
    {
      "id": 175                // id of the new price list
    }

Get Price List

action: api/v2/priceList/get
    token                       string
    priceList                   domain(PriceList)

response: JSON
   {
     "id":175,
     "name":"price list",
     "currency":"EUR",
     "unit":"Word"
   }

List Price Lists

action: api/v2/priceList/list
    token                       string
    page                        integer            O(0)

response: JSON
   [
     {
       "id":175,
       "name":"domain",
       "currency":"EUR",
       "unit":"Word"
     }
   ]

Update Price List

action: api/v2/priceList/update
    token                       string
    priceList                   domain(PriceList)
    name                        string                   O  // if not specified, leaves unmodified
    currency                    currency                 O  // if not specified, leaves unmodified
    unit                        enum(BillingUnit)        O  // if not specified, leaves unmodified

response: JSON
    {}

Delete Price List

action: api/v2/priceList/delete
    token                       string
    priceList                   domain(PriceList)

response: JSON
   {}

Add Language Pairs

action: api/v2/priceList/addLanguagePairs
    token                       string
    priceList                   domain(PriceList)
    sourceLang                  list(locale)
    targetLang                  list(locale)

response: JSON
   {}

Remove Language Pairs

action: api/v2/priceList/removeLanguagePairs
    token                       string
    priceList                   domain(PriceList)
    sourceLang                  list(locale)             O  // if not specified, selects all
    targetLang                  list(locale)             O  // if not specified, selects all

response: JSON
   {}

Get Price

action: api/v2/priceList/getPrice
    token                       string
    priceList                   domain(PriceList)
    sourceLang                  list(locale)                 O  // if not specified, selects all
    targetLang                  list(locale)                 O  // if not specified, selects all
    workflowStep                list(domain(WorkflowStep))   O  // if not specified, selects all

response: JSON
   [
     {
       "sourceLang":"en_us",
       "targetLang":"de_de",
       "prices":[
         {
           "workflowStep":{
             "abbr":"T",
             "id":1,
             "name":"Translation"
           },
           "price":0.05
         },
         {
           "workflowStep":{
             "abbr":"R",
             "id":2,
             "name":"Revision"
           },
           "price":0.02
         },
         {
           "workflowStep":{
             "abbr":"CR",
             "id":3,
             "name":"Client review"
           },
           "price":0
         }
       ],
       "minimumPrice":5
     }
   ]

Set Minimum Price

action: api/v2/priceList/setMinimumPrice
    token                       string
    priceList                   domain(PriceList)
    sourceLang                  list(locale)             O  // if not specified, selects all
    targetLang                  list(locale)             O  // if not specified, selects all
    minimumPrice                double                   O  // if not specified, sets price to null

response: JSON
   {}

Set Price

action: api/v2/priceList/setPrice
    token                       string
    priceList                   domain(PriceList)
    sourceLang                  list(locale)                 O  // if not specified, selects all
    targetLang                  list(locale)                 O  // if not specified, selects all
    workflowStep                list(domain(WorkflowStep))   O  // if not specified, selects all
    price                       double                       O  // if not specified, sets price to null

response: JSON
   {}