Skip to main content

Update dunning rule policy

PUT 

https://euwest.api.elasticpath.com/v2/subscriptions/dunning-rules/:dunning_rule_uuid

Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the rule is not updated. For fields that are optional, an existing value can be removed by specifying a value of null.

Request

Path Parameters

    dunning_rule_uuid UUIDrequired

    The unique identifier of a dunning rule set.

Body

    data DunningRuleUpdaterequired
    idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionDunningRuleType (string)required

    Possible values: [subscription_dunning_rule]

    Example: subscription_dunning_rule
    attributes DunningRuleUpdateAttributesrequired
    payment_retry_typestring

    The strategy used to make payments. Always fixed. This means payments are retried on a fixed schedule as defined by the payment_retry_unit and payment_retry_interval, for example, every two days.

    Possible values: [fixed, backoff, tiered]

    Example: fixed
    payment_retry_intervalint64nullable

    The number of payment_interval_units to wait between each payment retry attempt.

    Possible values: >= 1 and <= 1024

    Example: 1
    payment_retry_unitstringnullable

    The unit of time used to measure the intervals between payment attempts or retries.

    Possible values: [day, week]

    Example: day
    payment_retry_multiplierdoublenullable

    The multiplier that increases the interval between consecutive each payment attempts or retries. This is typically used to gradually extend the time between retries. Allowing more time between attempts as failures persist, helps reduce the risk of triggering multiple failures in a short period and gives the subscriber more time to resolve the issue. Must only be set for backup types.

    Possible values: >= 1 and <= 1024

    Example: 1
    payment_retries_limitint64

    The number of times Subscriptions attempts payment retries before action is taken.

    Example: 5
    actionstring

    The action to take after all payment attempts for an invoice have failed.

    Possible values: [none, pause, close, suspend]

    Example: none
    defaultboolean

    Set to true if you want this rule to be the default for the store.

    Example: false

Responses

Success. The dunning rule set has been updated.

Schema
    data DunningRule
    idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionDunningRuleType (string)required

    Possible values: [subscription_dunning_rule]

    Example: subscription_dunning_rule
    attributes DunningRuleAttributesrequired

    The dunning rule attributes you can use to configure your payment retry strategy.

    payment_retry_typestringrequired

    The strategy used to make payments. Always fixed. This means payments are retried on a fixed schedule as defined by the payment_retry_unit and payment_retry_interval, for example, every two days.

    Possible values: [fixed, backoff, tiered]

    Example: fixed
    payment_retry_intervalint64

    The number of payment_interval_units to wait between each payment retry attempt.

    Possible values: >= 1 and <= 1024

    Example: 1
    payment_retry_unitstring

    The unit of time used to measure the intervals between payment attempts or retries.

    Possible values: [day, week]

    Example: day
    payment_retry_multiplierdouble

    The multiplier that increases the interval between consecutive each payment attempts or retries. This is typically used to gradually extend the time between retries. Allowing more time between attempts as failures persist, helps reduce the risk of triggering multiple failures in a short period and gives the subscriber more time to resolve the issue. Must only be set for backup types.

    Possible values: >= 1 and <= 1024

    Example: 1
    payment_retries_limitint64required

    The number of times Subscriptions attempts payment retries before action is taken.

    Example: 5
    actionstringrequired

    The action to take after all payment attempts for an invoice have failed.

    • None - the subscription remains active and Subscriptions does not attempt to retry the payment. However, the subscription is still available for a subscriber to use.
    • Suspend the subscription. Subscriptions does not attempt to retry the payment. A subscriber can choose to pay the outstanding invoice. However, a subscriber cannot renew their subscription; a merchandizer must renew the subscription on behalf of the subscriber.
    • close a subscription. The subscription ends and it's status becomes inactive. However, a merchandizer can choose to resume the subscription if a subscriber pays the outstanding payment.

    Possible values: [none, pause, close, suspend]

    Example: none
    defaultboolean

    Set to true if you want this rule to be the default for the store.

    Example: false
    meta DunningRuleMetarequired
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps Timestampsrequired
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/v2/subscriptions/dunning-rules/:dunning_rule_uuid");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"id\": \"11111111-2222-3333-4444-555555555555\",\n \"type\": \"subscription_dunning_rule\",\n \"attributes\": {\n \"payment_retry_type\": \"fixed\",\n \"payment_retry_interval\": 1,\n \"payment_retry_unit\": \"day\",\n \"payment_retry_multiplier\": 1,\n \"payment_retries_limit\": 5,\n \"action\": \"none\",\n \"default\": false\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Parameters
— pathrequired
Body
{
  "data": {
    "id": "11111111-2222-3333-4444-555555555555",
    "type": "subscription_dunning_rule",
    "attributes": {
      "payment_retry_type": "fixed",
      "payment_retry_interval": 1,
      "payment_retry_unit": "day",
      "payment_retry_multiplier": 1,
      "payment_retries_limit": 5,
      "action": "none",
      "default": false
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.