Add or Edit a Subscription
This API call lets you add or edit a subscription. The response is an XML of the available subscription information.
Request Fields
Field Name | Type | Required | Description |
---|---|---|---|
action | String | Yes | subscriptionEdit |
accountId | Integer | Yes | The Helcim Commerce account ID. |
apiToken | String | Yes | API token used for authentication and access control. |
subscriptionId | String | No | The subscription ID. If its present then you are editing a subscription plan. If it is not present, then you are adding a new subscription plan. |
recurringPlanId | Integer | No | The recurring plan ID. If subscriptionId is present then recurringPlanId is optional. If subscriptionId is not entered then recurringPlanId is required. |
customerCode | String | No | The customer code. If subscriptionId is present then customerCode is optional. If subscriptionId is not entered then customerCode is required. |
dateCreated | String | No | The creation date of the subscription. |
dateStarted | String | No | The start date of the subscription. |
dateRemoved | String | No | The end date of the subscription. |
amountRecurring | Decimal | No | The recurring amount. |
amountInitial | Decimal | No | The initial amount. |
cyclesTotal | Integer | No | The total number of payment cycles. |
status | Integer | No | 1 or 0. Whether the subscription is active or not. |
You can access the Recurring Plan ID by clicking on the recurring plan you want to use under
Recurring
and thenRecurring Plans
, the plan ID is located at the end of the URL for the plan in your browser window.
Response Fields
Field Name | Type | Description |
---|---|---|
message | - | XML structure |
response | Integer | 1 or 0. Whether the subscription was added/edited or not. |
responseMessage | String | Confirmation of action taken. |
subscription | - | XML structure |
id | Integer | The subscription ID> |
dateCreated | String | The creation date of the subscription. |
dateStarted | String | The start date of the subscription. |
dateRemoved | String | The end date of the subscription. |
amountInitial | Decimal | The initial amount. |
amountRecurring | Decimal | The recurring amount. |
cyclesBilled | Integer | The number of billing cycles occured. |
cyclesTotal | Integer | The total number of cycles. |
Errors
For all API requests, there are also generic API authentication and user access restriction errors.
Response Code | Error Code | Message | Description |
---|---|---|---|
0 | - | Invalid Subscription ID | The subscription ID provided is invalid. |
0 | - | Invalid Recurring Plan ID | The plan ID provided was invalid, or not entered. |