Create a Proration Policy
POSThttps://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
- 201
- 400
- 500
Success. The proration policy is created.
Bad request. The request failed validation.
Internal server error. There was a system failure in the platform.
Authorization: http
name: BearerTokentype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
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());
ResponseClear