ElectronicSubscriptionGetPurchasedSubscriptionsByCustomer
| Initial Build | 2013.01 |
| Availability | Web Method |
| Response Type | XML Results |
The ElectronicSubscriptionGetPurchasedSubscriptionsByCustomer web method returns a list of subscriptions for a particular customer. A related web method is ElectronicSubscriptionGetCstListByIP.
Parameters
The request contains the following parameters.
| Name | Type | Occurs | Description |
|---|---|---|---|
| OrgCstKey | guid | 1..1 |
Customer Key of the Organization. |
| actionDate | string | 0..1 | As of Date. If passed, then the method will only return records which have been updated since this date, including new subscriptions sold after the date or subscriptions voided / canceled since then. Format should be MM/DD/YYYY. |
| oIPAddress | string | 0..1 | If an IP address is provided, only line items associated with that IP will be returned; otherwise, any purchases will be returned. |
Response
The request returns the following XML Results:
| Name | Description | Type | Notes |
|---|---|---|---|
| ivd_key | ivdkey | string (guid format) | Primary Key of the invoice detail of the subscription. |
| prd_key | prdkey | string (guid format) | Product Key of the subscription. |
| prd_code | prdcode | string | Product Code of the Subscription. |
| Subscription | Subscription | string | Name of the Subscription |
| StartDate | StartDate | string | Start Date of the subscription term in MM/DD/YYYY format. |
| EndDate | EndDate | string | End Date of the subscription term in MM/DD/YYYY format. |
| Status | Status | string |
See Status below for a listing of the Status codes. |
| ivd_latest_date | ivdlatestdate | string (in DateTime format) | Latest Date in DD/MM/YYYY format. |
Status
The Status property in the return can contain the following codes:
- Active - the subscription is active and was purchased directly by the Organization specified by OrgCstKey.
- Canceled - the purchased subscription has been canceled subsequent to the original purchase. In this case, the subscription should not be accessible but it might be appropriate to inform the user that their subscription was canceled.
- Previous - an expired subscription based on the expiration date of the subscription being in the past, or for issue-count based subscriptions, there are no remaining issues.
- From Consortia - the subscription is available because the organization is related to a Consortia Organization that has the subscription. This is like an Active subscription, only from a different purchasing source.
Sample Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<ns:Token>d2398dcf-f7ec-4a39-a507-8f651ceb6c0e</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:ElectronicSubscriptionGetPurchasedSubscriptionsByCustomer>
<ns:OrgCstKey>a58da3b2-8446-44fe-b66b-038f095e3628</ns:OrgCstKey>
<ns:actionDate>07/12/2011</ns:actionDate>
<ns:oIPAddress></ns:oIPAddress>
</ns:ElectronicSubscriptionGetPurchasedSubscriptionsByCustomer>
</soapenv:Body>
</soapenv:Envelope>
Sample Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/2005/">
<Token>d2398dcf-f7ec-4a39-a507-8f651ceb6c0e</Token>
</AuthorizationToken>
</soap:Header>
<soap:Body>
<ElectronicSubscriptionGetPurchasedSubscriptionsByCustomerResponse xmlns="http://www.avectra.com/2005/">
<ElectronicSubscriptionGetPurchasedSubscriptionsByCustomerResult>
<Results recordReturn="2">
<Result>
<ivd_key>f192ad77-991d-40da-8898-61acf2238218</ivd_key>
<prd_key>82213677-5761-46db-bf29-ad70912aa678</prd_key>
<prd_code>Cal sub</prd_code>
<Subscription>Calendar Sub</Subscription>
<StartDate>01/01/2012</StartDate>
<EndDate>12/31/2012</EndDate>
<Status>Active</Status>
<ivd_latest_date>07/13/2011</ivd_latest_date>
</Result>
<Result>
<ivd_key>667660db-8380-4ba6-8da3-87545c4bcce2</ivd_key>
<prd_key>82213677-5761-46db-bf29-ad70912aa678</prd_key>
<prd_code>Cal sub</prd_code>
<Subscription>Calendar Sub</Subscription>
<StartDate>01/01/2012</StartDate>
<EndDate>12/31/2012</EndDate>
<Status>Active</Status>
<ivd_latest_date>07/13/2011</ivd_latest_date>
</Result>
</Results>
</ElectronicSubscriptionGetPurchasedSubscriptionsByCustomerResult>
</ElectronicSubscriptionGetPurchasedSubscriptionsByCustomerResponse>
</soap:Body>
</soap:Envelope>
JSON Method
POST /xWeb/JSON/ElectronicSubscriptionGetPurchasedSubscriptionsByCustomer
DATA: JSON
{
"ElectronicSubscriptionGetPurchasedSubscriptionsByCustomer": {
"OrgCstKey": "{{orgCstKeySample}}",
"actionDate":"",
"oIPAddress":""
}
}
SAMPLE RESULT
HTTP STATUS: 200
DATA: JSON
{
"Results": {
"@recordReturn": "0"
}
}