Update product assignment
https://app.iteras.dk/api/customers/updateproductassignment/
The /api/customers/updateproductassignment/ endpoint updates the data on a product assignment.
Parameters
-
id string requiredID of the customer.
-
product_assignment_id string requiredID of the product assignment, as returned by the customer data or assign product endpoint.
-
data objectAny attributes to set on the product assignment. The valid attributes are the fields that are associated with the product assignment. Fields not mentioned in
dataare not touched; to delete a field, passnull. -
reinvoice booleanFor a product assignment that is associated with a subscription (and not a period) this can be set to
trueif the update changes the pricing of the subscription to make the change take effect immediately. The system then credits the future part of the subscription (if it has been invoiced already) and sets it up to be invoiced.
You can set any custom product assignment field, using its field id (the field name with a colon prepended, or its external identifier).
Log in, or send your API key as a bearer token, to see the custom product assignment fields set up for your account.
Examples
POST /api/customers/updateproductassignment/ HTTP/1.1
Content-Type: application/json{
"id": "12345",
"product_assignment_id": "9989892798",
"data": {
":Custom product assignment field": "Eksempeltekst",
":Obsolete field": null
}
}The endpoint returns the ID of the updated 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. a custom product assignment field:
{
":Custom product assignment field": ["Enter a valid value."]
}
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."]
}