Skip to main content

Update a subscriber

PUT 

https://euwest.api.elasticpath.com/v2/subscriptions/subscribers/:subscriber_uuid

Update a subscriber

Request

Path Parameters

    subscriber_uuid UUIDrequired

    The unique identifier of the subscriber.

Body

    data SubscriberUpdaterequired
    idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionSubscriberType (string)required

    Possible values: [subscription_subscriber]

    Example: subscription_subscriber
    attributes SubscriberUpdateAttributesrequired
    namestring

    The name of the subscriber.

    Possible values: >= 3 characters and <= 1024 characters

    Example: John Doe
    emailemail

    The email of the subscriber.

    Possible values: >= 3 characters and <= 1024 characters

    Example: john.doe@example.com
    payment_authority objectnullable
    type stringrequired

    Possible values: [elastic_path_payments_stripe, authorize_net]

    customer_idstring

    The unique identifier for a customer.

    Possible values: >= 3 characters and <= 1024 characters

    Example: cus_OPfKlxWV3hp9h6
    card_idstring

    The unique identifier of the card used to facilitate payment of the subscription. If a card payment fails, you can use the card_id and customer_id attributes to program your front-end implementation to allow your preferred payment service provider to update a subscription with new card details. See Card declines.

    Possible values: >= 3 characters and <= 1024 characters

    Example: card_8Diw3FQPhxK27WADPVMeXieP

Responses

Success. The subscriber details are returned.

Schema
    data Subscriber
    idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionSubscriberType (string)required

    Possible values: [subscription_subscriber]

    Example: subscription_subscriber
    attributes SubscriberResponseAttributes
    account_idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    namestringrequired

    The name of the subscriber.

    Possible values: >= 3 characters and <= 1024 characters

    Example: John Doe
    emailemailrequired

    The email of the subscriber.

    Possible values: >= 3 characters and <= 1024 characters

    Example: john.doe@example.com
    payment_authority object
    type stringrequired

    Possible values: [elastic_path_payments_stripe, authorize_net]

    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    meta SubscriberMetarequired
    feature_entitlementsFeatureTag (string)[]

    A list of entitlement tags currently active for the subscriber

    Possible values: non-empty and <= 64 characters, Value must match regular expression ^[0-9A-Za-z_-]+$

    Example: ["tag1","tag2"]
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps Timestampsrequired
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/v2/subscriptions/subscribers/:subscriber_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_subscriber\",\n \"attributes\": {\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"payment_authority\": {\n \"type\": \"elastic_path_payments_stripe\",\n \"customer_id\": \"cus_OPfKlxWV3hp9h6\",\n \"card_id\": \"card_8Diw3FQPhxK27WADPVMeXieP\"\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": {
    "id": "11111111-2222-3333-4444-555555555555",
    "type": "subscription_subscriber",
    "attributes": {
      "name": "John Doe",
      "email": "john.doe@example.com",
      "payment_authority": {
        "type": "elastic_path_payments_stripe",
        "customer_id": "cus_OPfKlxWV3hp9h6",
        "card_id": "card_8Diw3FQPhxK27WADPVMeXieP"
      }
    }
  }
}
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.