There are many reasons why you may choose to update a quota quantity. You can use the quota quantity to:
limit traffic to a quota
increase traffic to a quota
stop traffic to a quota
update quota quantities so that the remaining quantity is consistent with your system’s remaining quantity
You may update the quota quantity to any value greater than or equal to 0. If the new quantity is less than or equal to the quantity fielded, this quota will not receive any traffic.
REST API versions:
PATCH - Request 1
PUT - Request 2
DEPRECATED - Request 3
Request 1 (PATCH)
PATCH $apihost/$basepath/surveys/7654/quotas/qb30
($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)
Body:
[ { "op": "replace", "path": "/current_target", "value": 171 } ]
Response
Response Code
200
Response Body
{ "quantities": { "hasValidQuotas": true, "isFlexible": true, "minimum": 35, "maximum": 35, "flexibility": 0, "number": 200, "percentage": 100, "achieved": 0, "remaining": 0, "currently_open": 0, "sup_currently_open": 0, "current_target": 171 }, "counter": { "Buyer_side_In_Progress": 0, "Buyer_Survey_Starts": 0, "Buyer_Valid_Clicks": 0 }, "buyer_quota_id": "qb30", "marker": "", "locked": false, "criteria": [{...}], "crtd_on": 1611074478715, "mod_on": 1611246548389, "_id": "60070bae00d59f3155555e44", "isActive": true, "type": 0, "quotaCategory": "autoNested", "quota_id": "d113426df-38de-3434-a69a-1734380f8d28", "suppliers": {...} }
Request 2 (PUT)
PATCH $apihost/$basepath/surveys/7654/quotas/qb30
($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)
Body:
{ "buyer_quota_id": "qb30", "required_count": 100, "criteria": [{ "qualification_code": 217, "condition_codes": [ "114" ] }, { "qualification_code": 214, "condition_codes": [ "111" ] }, { "qualification_code": 211, "condition_codes": [ "111" ] }] }
Response
Response Code
200
Response Body
"buyer_quota_id": "qb30", "required_count": 100, "criteria": [{ "qualification_code": 217, "condition_codes": [ "114" ] }, { "qualification_code": 214, "condition_codes": [ "111" ] }, { "qualification_code": 211, "condition_codes": [ "111" ] }] }
Request 3 [DEPRICATED]
Body:
[{ "op": "replace", "path": "/required_count", "value": 171 }]
Response
Response Code
200
Response Body
{ "ps_buyer_quota_id": "qb30", "required_count": 171 }