Skip to main content

Create a Proration Policy

POST 

https://euwest.api.elasticpath.com/v2/subscriptions/proration-policies

In Subscriptions, you configure proration by creating a proration policy and attaching it to an offering. Once you have attached the policy, the proration policy applies to all subscriptions that use the offering.

Request

Responses

Success. The proration policy is created.

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/subscriptions/proration-policies");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"subscription_proration_policy\",\n \"attributes\": {\n \"name\": \"Main Policy\",\n \"rounding\": \"up\",\n \"external_ref\": \"abc123\"\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
Body
{
  "data": {
    "type": "subscription_proration_policy",
    "attributes": {
      "name": "Main Policy",
      "rounding": "up",
      "external_ref": "abc123"
    }
  }
}
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.