@Route("/api/v{version}/_action/order/{orderId}/creditItem", name="api.action.order.add-credit-item", methods={"POST"})
185426
public function addCreditItemToOrder(string $orderId, Request $request, Context $context)
    {
        $identifier = $request->request->get('identifier');
        $type = LineItem::CREDIT_LINE_ITEM_TYPE;
        $quantity = $request->request->getInt('quantity', 1);

        $lineItem = new LineItem($identifier, $type, $quantity);
        $label = $request->request->get('label');
        $description = $request->request->get('description');
        $removeable = $request->request->get('removeable', true);
        $stackable = $request->request->get('stackable', true);
        $payload = $request->request->get('payload', []);
        $priceDefinition = $request->request->get('priceDefinition');

        $lineItem->setLabel($label);
        $lineItem->setDescription($description);
        $lineItem->setRemovable($removeable);
        $lineItem->setStackable($stackable);
        $lineItem->setPayload($payload);

        $lineItem->setPriceDefinition(
            new AbsolutePriceDefinition(
                $priceDefinition['price'],
                $priceDefinition['precision'] ?? $context->getCurrencyPrecision(),
                new LineItemOfTypeRule(Rule::OPERATOR_NEQ, $type)
            )
        );

        $this->recalculationService->addCustomLineItem($orderId, $lineItem, $context);

        return new Response(null, Response::HTTP_NO_CONTENT);
    }
1113431
void addCredit(InputChannelID receiverId, int credit) throws Exception {
		if (fatalError) {
			return;
		}

		NetworkSequenceViewReader reader = allReaders.get(receiverId);
		if (reader != null) {
			reader.addCredit(credit);

			enqueueAvailableReader(reader);
		} else {
			throw new IllegalStateException("No reader for receiverId = " + receiverId + " exists.");
		}
	}
137259
def action(context, request, action=None, resource=None, uid=None):
    

    # allow to set the method via the header
    if action is None:
        action = request.get_header("HTTP_X_HTTP_METHOD_OVERRIDE", "CREATE").lower()

    # Fetch and call the action function of the API
    func_name = "{}_items".format(action)
    action_func = getattr(api, func_name, None)
    if action_func is None:
        api.fail(500, "API has no member named '{}'".format(func_name))

    portal_type = api.resource_to_portal_type(resource)
    items = action_func(portal_type=portal_type, uid=uid)

    return {
        "count": len(items),
        "items": items,
        "url": api.url_for("senaite.jsonapi.v1.action", action=action),
    }
353449
def post(self, request, *args, **kwargs):
        
        POST = json.loads(request.body.decode('utf-8'))

        if 'product_pk' in POST and 'quantity' in POST:
            cart = ShoppingCartProxy(request)
            cart.add(
                product_pk=int(POST['product_pk']),
                quantity=int(POST['quantity'])
            )
            return JsonResponse(cart.products)

        return HttpResponseBadRequest()
770519
private void addPostParams(final Request request) {
        if (data != null) {
            request.addPostParam("Data", Converter.mapToJson(data));
        }

        if (ttl != null) {
            request.addPostParam("Ttl", ttl.toString());
        }

        if (itemTtl != null) {
            request.addPostParam("ItemTtl", itemTtl.toString());
        }

        if (collectionTtl != null) {
            request.addPostParam("CollectionTtl", collectionTtl.toString());
        }
    }
75826
def upload_credit_note_signature(self, credit_note_it, signature_dict):
        
        return self._create_put_request(
            resource=CREDIT_NOTES,
            billomat_id=credit_note_it,
            send_data=signature_dict,
            command=UPLOAD_SIGNATURE
        )
327311
public function addComment($creditmemoIncrementId, $comment = null, $notifyCustomer = null, $includeComment = null)
    {
        return $this->__createAction('order_creditmemo.addComment', func_get_args());
    }
1302933
function addCreditToCredits(credits, person, name) {
	let credit = getCredit(credits, person);

	if (!credit) {
		credit = person;
		credit.packages = [];

		credits.push(credit);
	}

	if (credit.packages.indexOf(name) === -1) {
		credit.packages.push(name);
	}

	return credits;
}
1350224
public void tickets_ticketId_score_POST(Long ticketId, String score, String scoreComment) throws IOException {
		String qPath = "/support/tickets/{ticketId}/score";
		StringBuilder sb = path(qPath, ticketId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "score", score);
		addBody(o, "scoreComment", scoreComment);
		exec(qPath, "POST", sb.toString(), o);
	}
428087
public function postUpdateComponentOrder()
    {
        $componentData = Binput::get('ids');

        foreach ($componentData as $order => $componentId) {
            try {
                $component = Component::find($componentId);

                execute(new UpdateComponentCommand(
                    $component,
                    $component->name,
                    $component->description,
                    $component->status,
                    $component->link,
                    $order + 1,
                    $component->group_id,
                    $component->enabled,
                    $component->meta,
                    true
                ));
            } catch (QueryException $e) {
                throw new BadRequestHttpException();
            }
        }

        return $this->collection(Component::query()->orderBy('order')->get());
    }
862395
def _handle_post(self, method, remainder, request=None):
        '''
        
        '''
        if request is None:
            self._raise_method_deprecation_warning(self._handle_post)

        # check for custom POST/PUT requests
        if remainder:
            match = self._handle_custom_action(method, remainder, request)
            if match:
                return match

            controller = self._lookup_child(remainder[0])
            if controller and not ismethod(controller):
                return lookup_controller(controller, remainder[1:], request)

        # check for regular POST/PUT requests
        controller = self._find_controller(method)
        if controller:
            return controller, remainder

        abort(405)
1135026
function cancel_item(itemId, customParams, callback) {
      var _doArgs51 = doArgs(arguments, ['string|number', ['object', {}], 'function']);

      var _doArgs52 = _slicedToArray(_doArgs51, 3);

      itemId = _doArgs52[0];
      customParams = _doArgs52[1];
      callback = _doArgs52[2];


      customParams.id = itemId;

      doRequest({
        method: 'POST',
        urlPattern: [QUEUE_CANCEL_ITEM]
      }, customParams, callback);
    }
1343609
def action_post(self):
        
        name = request.form["action"]
        pks = request.form.getlist("rowid")
        if self.appbuilder.sm.has_access(name, self.__class__.__name__):
            action = self.actions.get(name)
            items = [
                self.datamodel.get(self._deserialize_pk_if_composite(pk)) for pk in pks
            ]
            return action.func(items)
        else:
            flash(as_unicode(FLAMSG_ERR_SEC_ACCESS_DENIED), "danger")
            return redirect(".")
1316340
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True
        cpc_oid = uri_parms[0]
        try:
            cpc = hmc.cpcs.lookup_by_oid(cpc_oid)
        except KeyError:
            raise InvalidResourceError(method, uri)
        if not cpc.dpm_enabled:
            raise CpcNotInDpmError(method, uri, cpc)
        check_required_fields(method, uri, body, ['name'])

        # We need to emulate the behavior of this POST to always create a
        # hipersocket, but the add() method is used for adding all kinds of
        # faked adapters to the faked HMC. So we need to specify the adapter
        # type, but because the behavior of the Adapter resource object is
        # that it only has its input properties set, we add the 'type'
        # property on a copy of the input properties.
        body2 = body.copy()
        body2['type'] = 'hipersockets'
        try:
            new_adapter = cpc.adapters.add(body2)
        except InputError as exc:
            raise BadRequestError(method, uri, reason=5, message=str(exc))
        return {'object-uri': new_adapter.uri}
357332
function addItem($as, $key, $route_parameters = []) {
        if (is_string($as)) {
            if (!Route::isEnable($as)) {
                return $this;
            }
            if (Route::checkRouteFilters($as)) {
                return $this;
            }
            if (!count(Route::get($as))) {
                return $this;
            }
        }


        if (is_array($as)) {
            $text = Arr::get(
                $as,
                'title'
            );
            $icon = Arr::get(
                $as,
                'icon'
            );
            $url  = Arr::get(
                $as,
                'url',
                '#'
            );
            $as   = Arr::get(
                $as,
                'as'
            );
        } else {
            $keys = array_keys($route_parameters);
            $keys = array_map(
                function ($item) {
                    return '{' . $item . '}';
                },
                $keys
            );

            $text = str_replace($keys, array_values($route_parameters), Route::get_title($as));
            $icon = Route::get_icon($as);
            $url  = \URL::route($as, $route_parameters);
        }
        if ($icon) {
            $text = \HtmlI::setTitle($text)->addClass($icon) . ' &nbsp;' . \HtmlSpan::setContent($text);
        }
        if (!isset($this->maps[$this->section])) {
            $this->maps[$this->section] = Map::instance(get_called_class() . $this->name . $this->section);
        }
        if ($route_parameters) {
            $key .= '.'.str_replace(['&', '='], ['.', '-'], http_build_query($route_parameters));
        }
        $this->maps[$this->section]->add(
            $key,
            $as,
            $text,
            $url
        );

        return $this;
    }
1187002
def add_item(self, item):
        """"""

        if not isinstance(item, JsonRpcResponse):
            raise TypeError(
                "Expected JsonRpcResponse but got {} instead".format(type(item).__name__))

        self.items.append(item)
425493
public function hookOrderCompletePage(array $order, $order_model, $controller)
    {
        if ($order['payment'] === 'authorize_sim') {

            $this->data_order = $order;
            $this->order = $order_model;
            $this->controller = $controller;

            $this->processPurchase();
        }
    }