API

Sales APIs

POST sales/customers/{customerId}/subscriptions

Subscribe new subscription for customer

HTTP method POST
URI https://api.rambase.net/sales/customers/{customerId}/subscriptions
Supported formats Xml, Html, Json (ex. $format=json)
- URI parameter {customerId} Customer identifier
Integer, minimum 10000
Successful HTTP status code 201
API resource identifier 2228, version 3

The following body must be added to the request. Mouse over fieldnames for description and other useful information about the fields. Note that fields in bold are required/mandatory.

Format:
1
<CustomerSubscription>
2
     <Quantity
Quantity

Quantity of customer subscription. If the subscription contains products of various quantities, the total quantity will be the quantity of the product multiplied with customer subscription quantity.

Minimum value: 1

Default value: 1

This field is optional.

>
{Integer}</Quantity>
3
     <Validity>
4
          <EffectiveDate
EffectiveDate

Required/mandatory field

The date the customer subscription takes effect. The customer subscription will be effective from from and including this date.

>
{Date}</EffectiveDate>
5
          <ExpirationDate
ExpirationDate

The date the customer subscription expires. The customer subscription will be active to and NOT including this date.

This field is optional.

>
{Date}</ExpirationDate>
6
     </Validity>
7
     <Subscription>
8
          <SubscriptionId
SubscriptionId

Required/mandatory field

Subscription identifier

Minimum value: 100000

>
{Integer}</SubscriptionId>
9
     </Subscription>
10
</CustomerSubscription>
1
{
2
     "customerSubscription": {
3
          "quantity
Quantity

Quantity of customer subscription. If the subscription contains products of various quantities, the total quantity will be the quantity of the product multiplied with customer subscription quantity.

Minimum value: 1

Default value: 1

This field is optional.

":
"{Integer}",
4
          "validity": {
5
               "effectiveDate
EffectiveDate

Required/mandatory field

The date the customer subscription takes effect. The customer subscription will be effective from from and including this date.

":
"{Date}",
6
               "expirationDate
ExpirationDate

The date the customer subscription expires. The customer subscription will be active to and NOT including this date.

This field is optional.

":
"{Date}"
7
          },
8
          "subscription": {
9
               "subscriptionId
SubscriptionId

Required/mandatory field

Subscription identifier

Minimum value: 100000

":
"{Integer}"
10
          }
11
     }
12
}

The query string is placed after the resource URL, seperated with a questionmark (?). The query string is composed of a series of query parameters with values. See the page about query parameters on how to use these parameters.

$access_token String, optional After successful login you get an access token which needs to be provided in all API requests. Even though it is possible to pass this token as query parameter, we recommended passing it using the HTTP request header as described in Authorization. Note that all access tokens have an expiration time.
$db String, optional Set the database/company for the request
$useMinimumVersion Integer, optional Used to run a new version of an API resource when your API client is running a deprecated API resource. See the Breaking changes page for more information.
$lang String, optional Specifies the language used in the response, following the 3-letter ISO-639-1 [lll]

Read more about filters and sorting on how to use filter parameters and named filters.

Read more about filters and sorting on how to use sortable parameters

Requesting this resource will yield the following response. Mouse over fieldnames (or fieldgroups) for descriptions and other useful information about the fields.

Please note that some fields may be removed from the response, based on user roles/duties/permissions.

Format:
1
<CustomerSubscription>
2
     <CustomerSubscriptionId
CustomerSubscriptionId

Customer subscription identifier

>
{Integer}</CustomerSubscriptionId>
3
     <Status
Status

Status of customer subscription. Status 4: the subscription is pending start date. Status 8: the subscription is active. Status 9: the subscription is closed.

>
{Integer}</Status>
4
     <CreatedAt
CreatedAt

Date and time of creation

>
{Datetime}</CreatedAt>
5
     <Quantity
Quantity

Quantity of customer subscription. If the subscription contains products of various quantities, the total quantity will be the quantity of the product multiplied with customer subscription quantity.

>
{Integer}</Quantity>
6
     <Validity>
7
          <EffectiveDate
EffectiveDate

The date the customer subscription takes effect. The customer subscription will be effective from from and including this date.

>
{Date}</EffectiveDate>
8
          <ExpirationDate
ExpirationDate

The date the customer subscription expires. The customer subscription will be active to and NOT including this date.

>
{Date}</ExpirationDate>
9
     </Validity>
10
     <Subscription>
11
          <SubscriptionId
SubscriptionId

Subscription identifier

>
{Integer}</SubscriptionId>
12
          <SubscriptionLink
SubscriptionLink

Subscription reference

>
{String}</SubscriptionLink>
13
     </Subscription>
14
</CustomerSubscription>
1
{
2
     "customerSubscription": {
3
          "customerSubscriptionId
CustomerSubscriptionId

Customer subscription identifier

":
"{Integer}",
4
          "status
Status

Status of customer subscription. Status 4: the subscription is pending start date. Status 8: the subscription is active. Status 9: the subscription is closed.

":
"{Integer}",
5
          "createdAt
CreatedAt

Date and time of creation

":
"{Datetime}",
6
          "quantity
Quantity

Quantity of customer subscription. If the subscription contains products of various quantities, the total quantity will be the quantity of the product multiplied with customer subscription quantity.

":
"{Integer}",
7
          "validity": {
8
               "effectiveDate
EffectiveDate

The date the customer subscription takes effect. The customer subscription will be effective from from and including this date.

":
"{Date}",
9
               "expirationDate
ExpirationDate

The date the customer subscription expires. The customer subscription will be active to and NOT including this date.

":
"{Date}"
10
          },
11
          "subscription": {
12
               "subscriptionId
SubscriptionId

Subscription identifier

":
"{Integer}",
13
               "subscriptionLink
SubscriptionLink

Subscription reference

":
"{String}"
14
          }
15
     }
16
}

List of available operations/actions for this resource.
See the operations documentation for more information about API operations.

Possible error codes the response might return:

Error 105170 HTTP 404 Job Sequence Extension not found
Error 101376 HTTP 400 ShippingService is not active (status 4)
Error 101375 HTTP 400 Direction of the Shipping Service mismatch with type of transaction document
Error 101399 HTTP 400 Customer account in shipping service mismatch with this customer account
Error 101385 HTTP 400 The carrier that offers this shipping service is not activ (status 4)
Error 100936 HTTP 400 Default invoice- and shipping address is required
Error 100944 HTTP 400 Mismatch between post code and city