monnify@1.0.0
This adaptor exports the following from common:
- as()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- map()
- merge()
- scrubEmojis()
- sourceValue()
- util
Functions
get
get(path, options) ⇒ Operation
Make a GET request
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Get all transactions
get('/api/v1/transactions/search');
list
list(path, query) ⇒ Operation
Fetch a list of items.
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| query | ListQueryOptions | Query options. |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Get all transactions
list('/api/v2/disbursements/search-transactions', {
sourceAccountNumber: 4864192954
});
Example: Get all transactions for a specific page and page number.
list('/api/v2/disbursements/search-transactions', {
sourceAccountNumber: 4864192954,
pageNo: 0,
pageSize: 10
});
post
post(path, body, options) ⇒ Operation
Make a POST request
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| body | object | The Post request body |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Resend all failed notifications over a time period
post("/api/v1/transaction-notification/resend-failed-notifications", {
"startDate": "2021-01-16T13:56:39.492",
"endDate": "2021-10-16T13:56:39.492"
});
request
request(method, path, options) ⇒ Operation
Make a generic request
| Param | Type | Description |
|---|---|---|
| method | string | HTTP method to use |
| path | string | Path to resource |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Get disbursements from a wallet
request(
'GET',
'/api/v2/disbursements/search-transactions',
{
query: {
sourceAccountNumber: 4864192954,
pageNo: 0,
pageSize: 10
}
}
);
Interfaces
HttpState
State object
Properties
| Name | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
ListQueryOptions
Query option for the list helper function
Properties
| Name | Type | Description |
|---|---|---|
| pageNo | Number | The page number. Please note that Monnify pagination starts at 0 not 1. (Default: 0) |
| pageSize | Number | The page size. (Default: 100) |
| [otherOptions] | Record.<string, any> | Additional options. |
RequestOptions
Options provided to the HTTP request
Properties
| Name | Type | Description |
|---|---|---|
| body | object | string | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). |
| query | object | An object of query parameters to be encoded into the URL. |