Skip to main content

Create an offering

POST 

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

Create an offering

Request

Query Parameters

    filter string

Body

    data OfferingCreaterequired
    typeSubscriptionOfferingType (string)required

    Possible values: [subscription_offering]

    Example: subscription_offering
    attributes OfferingAttributesrequired
    external_refExternalRef (string)

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    Possible values: <= 2048 characters

    Example: abc123
    namestringrequired

    The name of the offering.

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

    Example: Magazine
    descriptionstring

    The offering description to display to customers.

    Possible values: <= 1024 characters

    Example: A lovely magazine that is published every month.
    relationships OfferingRelationships
    proration_policy object
    typeProrationPolicyType (string)required

    Possible values: [subscription_proration_policy]

    Example: subscription_proration_policy
    idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555

Responses

Success. The offering is created.

Schema
    data Offering
    idUUID (string)

    The unique identifier.

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

    Possible values: [subscription_offering]

    Example: subscription_offering
    attributes OfferingResponseAttributes
    external_refExternalRef (string)

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    Possible values: <= 2048 characters

    Example: abc123
    namestringrequired

    The name of the offering.

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

    Example: Magazine
    descriptionstring

    The offering description to display to customers.

    Possible values: <= 1024 characters

    Example: A lovely magazine that is published every month.
    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
    relationships Relationships

    Relationships are established between different subscription entities. For example, a product and a plan are related to an offering, as both are attached to it.

    property name* Relationship
    anyOf
    meta OfferingMetarequired
    external_product_refsstring[]required
    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.Post, "https://euwest.api.elasticpath.com/v2/subscriptions/offerings");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"subscription_offering\",\n \"attributes\": {\n \"external_ref\": \"abc123\",\n \"name\": \"Magazine\",\n \"description\": \"A lovely magazine that is published every month.\"\n },\n \"relationships\": {\n \"proration_policy\": {\n \"type\": \"subscription_proration_policy\",\n \"id\": \"11111111-2222-3333-4444-555555555555\"\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
— query
Body
{
  "data": {
    "type": "subscription_offering",
    "attributes": {
      "external_ref": "abc123",
      "name": "Magazine",
      "description": "A lovely magazine that is published every month."
    },
    "relationships": {
      "proration_policy": {
        "type": "subscription_proration_policy",
        "id": "11111111-2222-3333-4444-555555555555"
      }
    }
  }
}
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.