Create a feature
POSThttps://euwest.api.elasticpath.com/v2/subscriptions/features
Create a feature
Request
Responses
- 201
- 400
- 500
Success. The feature 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/features");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"subscription_feature\",\n \"attributes\": {\n \"external_ref\": \"abc123\",\n \"name\": \"Digital library access\",\n \"description\": \"Access to over 100 ebooks via the digital library.\",\n \"configuration\": {\n \"type\": \"access\",\n \"tag\": \"digital_library_access\"\n }\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear