Cancel product assignment
https://app.iteras.dk/api/customers/cancelproductassignment/
The API key must allow "Change subscriber data".
Cancels a product assignment, optionally crediting an amount.
Parameters
-
id string required
ID of the customer.
-
product_assignment_id string required
ID of the product assignment.
Find it with the customer data or assign product endpoint.
-
credit_amount integer Defaults to
0Integer amount to credit while cancelling the product assignment, e.g.
"credit_amount": 1050for €10.50. It cannot exceed the amount invoiced when the product was assigned. -
exclude_from_webhooks bool Defaults to
falseSet to
trueto keep every event the request causes from being sent to webhooks, invoice and payment events included, e.g."exclude_from_webhooks": true. The events are still added to the history.
Examples
POST /api/customers/cancelproductassignment/ HTTP/1.1
Content-Type: application/json{
"id": "12345",
"product_assignment_id": "9989892798",
"credit_amount": 1050
}Return value
On success the endpoint returns the ID of the cancelled product assignment:
{ "product_assignment_id": "9989892798" }
Errors
Invalid requests due to programming error, e.g. invalid JSON, returns 400.
A well-formed operation where a supplied value is invalid is not executed
and returns an HTTP 422 error. The response is a JSON object with the
errors keyed by the field they concern, e.g. an invalid
credit_amount:
{
"credit_amount": ["Amount too large."]
}
Errors that are not specific to a field are returned with the empty string as key, e.g. an unknown product assignment:
{
"": ["Product assignment does not exist."]
}