Managing Quotas By Supplier

Overview

For researchers that require explicit supplier blends by quota, we offer the capability to manage quotas by supplier.

Use

Quotas by supplier can be set through the POST and PUT /surveys/:surveyId/quotas endpoint. It is not possible to set quotas by supplier during the POST /surveys stage because a supplier list is not actively applied yet to this survey.

Important Considerations

Adding suppliers that are not present in the survey’s supplier list will result in a failed request. The API will return an HTTP status code 400 in these cases.

Request


POST $apihost/$basepath/surveys/:surveyId/quotas?QBS=1

($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header) 

{ "buyer_quota_id": "qb30", "required_count": 200, "suppliers": [ { "supplier_ref_id": "1", "current_target": 50 }, { "supplier_ref_id": "3", "current_target": 150 }, { "supplier_ref_id": "abc", "current_target": 150 } ], "criteria": [ { "qualification_code": 214, "condition_codes": [ "112" ] } ] }

Here abc as supplier_ref_id denotes to supplier group reference id and numeric supplier_ref_idlike 1 and 3 represents to the individual suppliers

Result 


Response Code

200

Response Body

{ "buyer_quota_id": "qb30", "required_count": 200, "suppliers": [ { "supplier_ref_id": "1", "current_target": 50 }, { "supplier_ref_id": "3", "current_target": 150 }, { "supplier_ref_id": "abc", "current_target": 150 } ], "criteria": [ { "qualification_code": 214, "condition_codes": [ "112" ] } ] }

suppliers are part of response due to QBS=1 in the query string.

IF QBS=0

/surveys/:surveyId/quotas?QBS=0

{ "buyer_quota_id": "qb30", "required_count": 200, "criteria": [ { "qualification_code": 214, "condition_codes": [ "112" ] } ] }

 

PUT $apihost/$basepath/surveys/:surveyId/quotas/:quotaId?QBS=0

($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header) 

Request: 

PUT $apihost/$basepath/surveys/:surveyId/quotas/:quotaId?QBS=1

{ "buyer_quota_id": "qb30", "required_count": 200, "suppliers": [ { "supplier_ref_id": "1", "current_target": 50 }, { "supplier_ref_id": "3", "current_target": 150 }, { "supplier_ref_id": "abc", "current_target": 150 } ], "criteria": [ { "qualification_code": 214, "condition_codes": [ "112" ] } ] }


Result 


Response Code

200

Response Body

{ "buyer_quota_id": "qb30", "required_count": 200, "suppliers": [ { "supplier_ref_id": "1", "current_target": 50 }, { "supplier_ref_id": "3", "current_target": 150 }, { "supplier_ref_id": "abc", "current_target": 150 } ], "criteria": [ { "qualification_code": 214, "condition_codes": [ "112" ] } ] }