Skip to main content

Update a subscription

PUT 

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

Updates a subscription. For example, a subscriber can switch from one plan to another in a subscription.

Request

Responses

Success. The subscription is 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");
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\",\n \"attributes\": {\n \"plan_id\": \"00000000-0000-0000-0000-000000000001\",\n \"address_id\": \"00000000-0000-0000-0000-000000000001\",\n \"payment_authority\": {\n \"type\": \"elastic_path_payments_stripe\",\n \"customer_id\": \"cus_OPfKlxWV3hp9h6\",\n \"card_id\": \"card_8Diw3FQPhxK27WADPVMeXieP\"\n },\n \"go_live_after\": \"2017-01-10T11:41:19.244842Z\"\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",
    "attributes": {
      "plan_id": "00000000-0000-0000-0000-000000000001",
      "address_id": "00000000-0000-0000-0000-000000000001",
      "payment_authority": {
        "type": "elastic_path_payments_stripe",
        "customer_id": "cus_OPfKlxWV3hp9h6",
        "card_id": "card_8Diw3FQPhxK27WADPVMeXieP"
      },
      "go_live_after": "2017-01-10T11:41:19.244842Z"
    }
  }
}
ResponseClear

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