price-changes

Stable. Describes behaviour that is built and covered by tests in this repository.

API reference

GET /v1/price-changes #

The price changes made, newest first

Each with the number of subscriptions that are waiting for their renewal (scheduled), were moved (applied), were withdrawn or were skipped. The latest 100.

Parameters

NameInTypeDescription
plan_codequerystringOnly the price changes of this plan

Responses

StatusMeaningBody
200OKListPriceChangesResponse
Example response
{
  "price_changes": [
    {
      "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "plan_code": "string",
      "from_version": 1,
      "to_version": 1,
      "notice_days": 1,
      "effective_time": "2026-11-03T10:15:00Z",
      "effective_from": "2026-11-03T10:15:00Z",
      "notice_send_days_before": 1,
      "state": "open",
      "created_by": "string",
      "create_time": "2026-11-03T10:15:00Z",
      "withdraw_time": "2026-11-03T10:15:00Z",
      "withdrawn_by": "string",
      "scheduled": 1,
      "applied": 1,
      "withdrawn": 1,
      "skipped": 1
    }
  ]
}
curl
curl -X GET https://YOUR-API-ADDRESS/v1/price-changes \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

GET /v1/price-changes/{id} #

One price change with its subscriptions and what became of each

The subscriptions by customer, a page at a time (page_size 1 to 500, default 500; next_page_token is empty on the last page), optionally only those in one state. The state of a scheduled one follows its change - waiting (scheduled), applied at the renewal, or withdrawn.

Parameters

NameInTypeDescription
id requiredpathstring · uuid
statequeryscheduled | applied | withdrawn | skipped
page_sizequeryinteger
page_tokenquerystring

Responses

StatusMeaningBody
200OKGetPriceChangeResponse
400Error envelopeError
404Error envelopeError
Example response
{
  "price_change": {
    "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
    "plan_code": "string",
    "from_version": 1,
    "to_version": 1,
    "notice_days": 1,
    "effective_time": "2026-11-03T10:15:00Z",
    "effective_from": "2026-11-03T10:15:00Z",
    "notice_send_days_before": 1,
    "state": "open",
    "created_by": "string",
    "create_time": "2026-11-03T10:15:00Z",
    "withdraw_time": "2026-11-03T10:15:00Z",
    "withdrawn_by": "string",
    "scheduled": 1,
    "applied": 1,
    "withdrawn": 1,
    "skipped": 1
  },
  "items": [
    {
      "subscription_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "customer_external_id": "string",
      "state": "scheduled",
      "reason": "string",
      "effective_time": "2026-11-03T10:15:00Z",
      "notify_time": "2026-11-03T10:15:00Z"
    }
  ],
  "next_page_token": "string"
}
curl
curl -X GET https://YOUR-API-ADDRESS/v1/price-changes/<id> \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

POST /v1/price-changes/{id}/retry #

Try the skipped subscriptions of a price change again

Runs the price change again with the notice it was made with, for the subscriptions that were skipped (a renewal that was too close may be far enough now) and any that joined the version since. What is scheduled already is left alone. Refused with 409 plans.price_change.withdrawn once it was withdrawn.

Parameters

NameInTypeDescription
id requiredpathstring · uuid

Responses

StatusMeaningBody
200OKSchedulePriceChangeResponse
404Error envelopeError
409Error envelopeError
Example response
{
  "scheduled": 1,
  "scheduled_subscription_ids": [
    "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e"
  ],
  "skipped": [
    {
      "subscription_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "customer_external_id": "string",
      "reason": "renews_soon"
    }
  ],
  "to_version": 1,
  "notice_days": 1
}
curl
curl -X POST https://YOUR-API-ADDRESS/v1/price-changes/<id>/retry \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

POST /v1/price-changes/{id}/withdraw #

Cancel every change of a price change that is still waiting

Closes the price change and cancels the scheduled changes that have not taken effect, so those customers stay on the old price. A change that was applied stays, and the mail that was sent is not taken back (tell those customers yourself). Calling it again finishes what an interrupted call left; a new run makes a new price change.

Parameters

NameInTypeDescription
id requiredpathstring · uuid

Responses

StatusMeaningBody
200OKWithdrawPriceChangeResponse
404Error envelopeError
Example response
{
  "price_change": {
    "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
    "plan_code": "string",
    "from_version": 1,
    "to_version": 1,
    "notice_days": 1,
    "effective_time": "2026-11-03T10:15:00Z",
    "effective_from": "2026-11-03T10:15:00Z",
    "notice_send_days_before": 1,
    "state": "open",
    "created_by": "string",
    "create_time": "2026-11-03T10:15:00Z",
    "withdraw_time": "2026-11-03T10:15:00Z",
    "withdrawn_by": "string",
    "scheduled": 1,
    "applied": 1,
    "withdrawn": 1,
    "skipped": 1
  },
  "withdrawn": 1
}
curl
curl -X POST https://YOUR-API-ADDRESS/v1/price-changes/<id>/withdraw \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

Models

Error

FieldTypeDescription
error requiredobject

GetPriceChangeResponse

FieldTypeDescription
price_change requiredPriceChange
items requiredarray of PriceChangeItem
next_page_token requiredstring

ListPriceChangesResponse

FieldTypeDescription
price_changes requiredarray of PriceChange

PriceChange

FieldTypeDescription
id requiredstring · uuid
plan_code requiredstring
from_version requiredinteger
to_version requiredinteger
notice_days requiredintegerThe notice of the latest run
effective_time requiredstring · date-timeThe earliest date a customer's price changes: the first scheduled renewal (until one is scheduled, the end of the notice)
effective_from requiredstring · date-timeThe date the seller chose the new price to start from; null when each subscription moves on its next renewal
notice_send_days_before requiredintegerDays before the new price that the notice mails go out; 0 when they go out as the run schedules the change
state requiredopen | withdrawn
created_by requiredstringThe signed-in person's address, key:<id> for an API key, or the operator
create_time requiredstring · date-time
withdraw_time requiredstring · date-time
withdrawn_by requiredstring
scheduled requiredintegerSubscriptions waiting for their renewal
applied requiredintegerSubscriptions moved to the new price
withdrawn requiredintegerSubscriptions whose change was cancelled (by a withdrawal, or because the seller or the customer changed the subscription)
skipped requiredintegerSubscriptions left out; retry tries them again

PriceChangeItem

FieldTypeDescription
subscription_id requiredstring · uuid
customer_external_id requiredstring
state requiredscheduled | applied | withdrawn | skipped
reason requiredstringWhy it was skipped (as in PriceChangeSkipped); empty otherwise
effective_time requiredstring · date-timeThe renewal the new price starts on; unset for a skipped one
notify_time requiredstring · date-timeWhen the customer's mail was queued; unset for a skipped one

PriceChangeSkipped

FieldTypeDescription
subscription_id requiredstring · uuid
customer_external_id requiredstring
reason requiredrenews_soon | has_pending_change | run_by_provider | not_changeable | customer_blocked

SchedulePriceChangeResponse

FieldTypeDescription
scheduled requiredintegerScheduled by this run
scheduled_subscription_ids requiredarray of string · uuid
skipped requiredarray of PriceChangeSkipped
to_version requiredinteger
notice_days requiredinteger
price_change_idstringThe price change this run made or continued; empty for a dry run when none is open
already_scheduledintegerScheduled by this price change before: not scheduled or mailed again

WithdrawPriceChangeResponse

FieldTypeDescription
price_change requiredPriceChange
withdrawn requiredintegerHow many waiting changes this call cancelled