Constructor
new Starling(optionsopt)
Create an instance of the starling client
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
options | 
            
            Object | 
                
                    <optional> | 
            
            
            configuration parameters  | 
        
- Source:
 
Methods
getAccount(accessTokenopt) → {Promise}
Gets the customer's account details
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getAddresses(accessTokenopt) → {Promise}
Gets the customer's addresses (current and previous)
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getBalance(accessTokenopt) → {Promise}
Gets the customer's balance
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getCard(accessTokenopt) → {Promise}
Gets the customer's card
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getContacts(accessTokenopt) → {Promise}
Gets the customer's balance
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getCustomer(accessTokenopt) → {Promise}
Gets the customer's details
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getTransaction(transactionID, accessTokenopt) → {Promise}
Gets the full details of a single transaction
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
transactionID | 
            
            string | the unique transaction ID  | 
        |
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise
 
getTransactions(fromDate, toDate, accessTokenopt) → {Promise}
Gets the customer's transaction history
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
fromDate | 
            
            string | filter transactions after this date. Format: YYYY-MM-DD (optional, defaults to one month in past if not provided)  | 
        |
toDate | 
            
            string | filter transactions before this date. Format: YYYY-MM-DD (optional, defaults to current date if not provided)  | 
        |
accessToken | 
            
            string | 
                
                    <optional> | 
            
            
            the oauth bearer token. If not specified, the accessToken on the options object is used.  | 
        
- Source:
 
Returns:
- the http request promise
 
- Type
 - Promise