@shipengine/js-api 0.41.2 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/funding-sources/api.d.ts +7 -1
- package/funding-sources/types.d.ts +24 -0
- package/index.js +12 -0
- package/index.mjs +12 -0
- package/package.json +1 -1
package/funding-sources/api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import { Money } from "../payments";
|
|
3
|
-
import {
|
|
3
|
+
import { PageableQuery } from "../resources";
|
|
4
|
+
import { AddFundsResponse, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceTransactionsResponse, MetadataResponse } from "./types";
|
|
4
5
|
/**
|
|
5
6
|
* # Funding Sources API module - /v1/funding_sources
|
|
6
7
|
* Docs: https://auctane.atlassian.net/wiki/spaces/SE/pages/3628370266/ShipEngine+Funding+Sources+API
|
|
@@ -47,4 +48,9 @@ export declare class FundingSourcesAPI {
|
|
|
47
48
|
* and attaching carriers
|
|
48
49
|
*/
|
|
49
50
|
metadata: () => Promise<import("axios").AxiosResponse<MetadataResponse, any>>;
|
|
51
|
+
/**
|
|
52
|
+
* The `transactions` method returns all the transactions of a funding source.
|
|
53
|
+
* See the FundingSourceTransactions type for more information about return data.
|
|
54
|
+
*/
|
|
55
|
+
transactions: (fundingSourceId: string, params?: PageableQuery) => Promise<import("axios").AxiosResponse<FundingSourceTransactionsResponse, any>>;
|
|
50
56
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PageableResult } from "../resources";
|
|
1
2
|
/**
|
|
2
3
|
* An encoded device fingerprint string containing information about the end-user's computing device such as OS, browser, etc.
|
|
3
4
|
* Required for carrier registration and US Wallet creation.
|
|
@@ -96,6 +97,26 @@ export type MetadataRegistrationRequirement = {
|
|
|
96
97
|
requirementType: MetadataRequirement;
|
|
97
98
|
satisfyingFormTypes: MetadataSatisfyingFormTypes[];
|
|
98
99
|
};
|
|
100
|
+
export type TransactionCategory = "adjustment" | "credit" | "debit" | "funds_added" | "insurance" | "label" | "refund" | "service_charge" | "unknown";
|
|
101
|
+
export type FundingSourceTransaction = {
|
|
102
|
+
description?: string | null;
|
|
103
|
+
endingBalance: {
|
|
104
|
+
amount: number;
|
|
105
|
+
currency: string;
|
|
106
|
+
};
|
|
107
|
+
fundingSourceId: string;
|
|
108
|
+
fundingSourceTransactionId: string;
|
|
109
|
+
labelIds: string[];
|
|
110
|
+
relatedFundingSourceTransactionIds: string[];
|
|
111
|
+
shipmentIds: string[];
|
|
112
|
+
trackingNumbers: string[];
|
|
113
|
+
transactionAmount: {
|
|
114
|
+
amount: number;
|
|
115
|
+
currency: string;
|
|
116
|
+
};
|
|
117
|
+
transactionCategory: TransactionCategory;
|
|
118
|
+
transactionDate: string;
|
|
119
|
+
};
|
|
99
120
|
export interface CarrierRegistrationResponse {
|
|
100
121
|
carrierAttachmentResults: [
|
|
101
122
|
{
|
|
@@ -132,4 +153,7 @@ export type AddFundsResponse = {
|
|
|
132
153
|
currency: string;
|
|
133
154
|
};
|
|
134
155
|
};
|
|
156
|
+
export type FundingSourceTransactionsResponse = {
|
|
157
|
+
transactions: FundingSourceTransaction[];
|
|
158
|
+
} & PageableResult;
|
|
135
159
|
export {};
|
package/index.js
CHANGED
|
@@ -3404,6 +3404,18 @@ class FundingSourcesAPI {
|
|
|
3404
3404
|
this.metadata = () => __async$2(this, null, function* () {
|
|
3405
3405
|
return yield this.client.get("/v1/funding_sources/metadata");
|
|
3406
3406
|
});
|
|
3407
|
+
/**
|
|
3408
|
+
* The `transactions` method returns all the transactions of a funding source.
|
|
3409
|
+
* See the FundingSourceTransactions type for more information about return data.
|
|
3410
|
+
*/
|
|
3411
|
+
this.transactions = (fundingSourceId, params) => {
|
|
3412
|
+
return this.client.get(
|
|
3413
|
+
`/v1/funding_sources/${fundingSourceId}/transactions`,
|
|
3414
|
+
{
|
|
3415
|
+
params
|
|
3416
|
+
}
|
|
3417
|
+
);
|
|
3418
|
+
};
|
|
3407
3419
|
this.client = client;
|
|
3408
3420
|
}
|
|
3409
3421
|
}
|
package/index.mjs
CHANGED
|
@@ -3400,6 +3400,18 @@ class FundingSourcesAPI {
|
|
|
3400
3400
|
this.metadata = () => __async$2(this, null, function* () {
|
|
3401
3401
|
return yield this.client.get("/v1/funding_sources/metadata");
|
|
3402
3402
|
});
|
|
3403
|
+
/**
|
|
3404
|
+
* The `transactions` method returns all the transactions of a funding source.
|
|
3405
|
+
* See the FundingSourceTransactions type for more information about return data.
|
|
3406
|
+
*/
|
|
3407
|
+
this.transactions = (fundingSourceId, params) => {
|
|
3408
|
+
return this.client.get(
|
|
3409
|
+
`/v1/funding_sources/${fundingSourceId}/transactions`,
|
|
3410
|
+
{
|
|
3411
|
+
params
|
|
3412
|
+
}
|
|
3413
|
+
);
|
|
3414
|
+
};
|
|
3403
3415
|
this.client = client;
|
|
3404
3416
|
}
|
|
3405
3417
|
}
|