Developer documentation

Update subscription

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

The /api/customers/updatesubscription/ endpoint updates the data on a subscription.

Parameters

  • id string required
    ID of the customer the subscription belongs to.
  • subscription_id string required
    ID of the subscription to update.
  • data object
    Any fields to set on the subscription. The valid fields are the ones associated with the products that the subscription is subscribed to. Fields not mentioned in data are not touched; to delete a field, pass null.
  • created string
    Override the time the subscription was created, e.g. 2026-09-09T01:35:09. Mainly useful when correcting imported subscriptions.
  • reinvoice boolean
    Set to true if 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.
  • policy object
    An object containing an id or external_id of the business policy to attach to the subscription. To remove an attached policy, send policy as null.

You can set any custom subscription 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 subscription fields set up for your account.

Examples

POST /api/customers/updatesubscription/ HTTP/1.1
Content-Type: application/json{
  "id": "12345",
  "subscription_id": "32142532",
  "data": {
    ":Custom subscription field": "Eksempeltekst",
    ":Obsolete field": null
  },
  "policy": {
    "external_id": "no_pause"
  }
}

The endpoint returns the ID of the updated subscription:

{ "subscription_id": "32142532" }

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 unknown policy:

{
  "external_id": ["Policy not found"]
}

Errors that are not specific to a field are returned with the empty string as key. This covers an unknown subscription or a subscription that belongs to a different customer, and invalid custom subscription fields:

{
  "": ["Subscription does not exist."]
}