Developer documentation

Cancel product assignment

post https://app.iteras.dk/api/customers/cancelproductassignment/

The /api/customers/cancelproductassignment/ endpoint cancels a previous assignment of a product to a subscription.

Parameters

  • id string required
    ID of the customer.
  • product_assignment_id string required
    ID of the product assignment, as returned by the customer data or assign product endpoint.
  • credit_amount integer Defaults to 0
    Integer amount (send €10.50 as 1050) to credit while cancelling the product assignment. The amount can't exceed the amount invoiced when the product was assigned.

Examples

POST /api/customers/cancelproductassignment/ HTTP/1.1
Content-Type: application/json{
  "id": "12345",
  "product_assignment_id": "9989892798",
  "credit_amount": 1050
}

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."]
}