Skip to main content

Manage subscription plans

PUT 

https://euwest.api.elasticpath.com/v2/subscriptions/subscriptions/:subscription_uuid/plans

Manage subscription plans by replacing, changing or detaching plans on the subscription

Request

Path Parameters

    subscription_uuid UUIDrequired

    The unique identifier of the subscription.

Body

    data object[]required

    A list of plan IDs to manage on the subscription.

  • Array [
  • typestringrequired

    Possible values: [detach]

    Example: detach
    plansUUID (string)[]required

    Possible values: >= 1

  • ]

Responses

Success. The subscription's plans have been updated.

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/v2/subscriptions/subscriptions/:subscription_uuid/plans");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": [\n {\n \"type\": \"attach\",\n \"plans\": [\n \"bafa601f-359c-48da-834e-377b6c0d9466\"\n ]\n },\n {\n \"type\": \"detach\",\n \"plans\": [\n \"a8aad94d-60fc-44f7-8dfa-299249566ec4\"\n ]\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": [
    {
      "type": "attach",
      "plans": [
        "bafa601f-359c-48da-834e-377b6c0d9466"
      ]
    },
    {
      "type": "detach",
      "plans": [
        "a8aad94d-60fc-44f7-8dfa-299249566ec4"
      ]
    }
  ]
}
ResponseClear

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