@shipengine/js-api 1.0.0-next.4 → 1.0.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/README.md +30 -0
- package/account-billing-plan/api.d.ts +17 -0
- package/account-billing-plan/index.d.ts +2 -0
- package/account-billing-plan/types.d.ts +37 -0
- package/account-settings/api.d.ts +30 -2
- package/account-settings/types.d.ts +22 -2
- package/addresses/api.d.ts +11 -0
- package/carriers/api.d.ts +69 -2
- package/carriers/types.d.ts +22 -3
- package/client.d.ts +157 -3
- package/connections/api.d.ts +18 -0
- package/connections/index.d.ts +2 -0
- package/connections/types.d.ts +36 -0
- package/custom-packages/api.d.ts +6 -0
- package/dimensions/types.d.ts +5 -0
- package/errors/types.d.ts +2 -2
- package/errors/utils.d.ts +4 -0
- package/funding-sources/api.d.ts +56 -0
- package/funding-sources/index.d.ts +2 -0
- package/funding-sources/types.d.ts +159 -0
- package/index.d.ts +7 -0
- package/index.js +4212 -16
- package/index.mjs +4027 -2786
- package/insurance/api.d.ts +7 -0
- package/labels/api.d.ts +89 -5
- package/order-sources/api.d.ts +17 -0
- package/package.json +6 -2
- package/rate-cards/api.d.ts +44 -0
- package/rate-cards/index.d.ts +2 -0
- package/rate-cards/types.d.ts +88 -0
- package/rates/api.d.ts +26 -0
- package/resources/types.d.ts +40 -0
- package/sales-order-shipments/api.d.ts +94 -5
- package/sales-orders/api.d.ts +25 -0
- package/shipments/api.d.ts +72 -0
- package/shipments/index.d.ts +1 -0
- package/shipments/types.d.ts +85 -4
- package/shipping-rules/api.d.ts +36 -0
- package/shipping-rules/index.d.ts +2 -0
- package/shipping-rules/types.d.ts +77 -0
- package/themes/api.d.ts +13 -0
- package/themes/index.d.ts +2 -0
- package/themes/types.d.ts +21 -0
- package/types.d.ts +10 -0
- package/utilities/index.d.ts +1 -0
- package/utilities/ip-address.d.ts +1 -0
- package/warehouses/api.d.ts +19 -0
- package/weight-band/index.d.ts +1 -0
- package/weight-band/types.d.ts +17 -0
- package/zones/index.d.ts +1 -0
- package/zones/types.d.ts +7 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { Money } from "../payments";
|
|
3
|
+
import { PageableQuery } from "../resources";
|
|
4
|
+
import { AddFundsResponse, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceTransactionsResponse, MetadataResponse } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* # Funding Sources API module - /v1/funding_sources
|
|
7
|
+
* Docs: https://auctane.atlassian.net/wiki/spaces/SE/pages/3628370266/ShipEngine+Funding+Sources+API
|
|
8
|
+
*/
|
|
9
|
+
export declare class FundingSourcesAPI {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: AxiosInstance);
|
|
12
|
+
/**
|
|
13
|
+
* The `list` method retrieves a list of funding sources for a given user.
|
|
14
|
+
*/
|
|
15
|
+
list: () => Promise<import("axios").AxiosResponse<{
|
|
16
|
+
fundingSources: FundingSource[];
|
|
17
|
+
}, any>>;
|
|
18
|
+
/**
|
|
19
|
+
* The `get` method retrieves a specific funding source by `fundingSourceId`.
|
|
20
|
+
*/
|
|
21
|
+
get: (fundingSourceId: string) => Promise<import("axios").AxiosResponse<FundingSource, any>>;
|
|
22
|
+
/**
|
|
23
|
+
* The `create` method creates a new funding source for a given user. This requires
|
|
24
|
+
* payment information to be collected from the user.
|
|
25
|
+
*/
|
|
26
|
+
create: (createFundingSource: CreateFundingSource) => Promise<import("axios").AxiosResponse<{
|
|
27
|
+
fundingSource: FundingSource;
|
|
28
|
+
}, any>>;
|
|
29
|
+
/**
|
|
30
|
+
* The `update` method updates a funding source for a given user. This allows the
|
|
31
|
+
* user to update the billing address or payment information associated with the
|
|
32
|
+
* funding source.
|
|
33
|
+
*/
|
|
34
|
+
update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
|
|
35
|
+
fundingSource: FundingSource;
|
|
36
|
+
}, any>>;
|
|
37
|
+
/**
|
|
38
|
+
* The `registerCarrier` method registers a carrier account and associates
|
|
39
|
+
* it with a given funding source.
|
|
40
|
+
*/
|
|
41
|
+
registerCarrier: (carrier: CarrierRegistration) => Promise<import("axios").AxiosResponse<CarrierRegistrationResponse, any>>;
|
|
42
|
+
/**
|
|
43
|
+
* The `addFunds` method allows you to add funds to a funding source.
|
|
44
|
+
*/
|
|
45
|
+
addFunds: (amount: Money, fundingSourceId: string) => Promise<import("axios").AxiosResponse<AddFundsResponse, any>>;
|
|
46
|
+
/**
|
|
47
|
+
* The `metadata` method returns seller-specific requirements for creating funding sources
|
|
48
|
+
* and attaching carriers
|
|
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>>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { PageableResult } from "../resources";
|
|
2
|
+
/**
|
|
3
|
+
* An encoded device fingerprint string containing information about the end-user's computing device such as OS, browser, etc.
|
|
4
|
+
* Required for carrier registration and US Wallet creation.
|
|
5
|
+
*/
|
|
6
|
+
type IovationBlackBox = string;
|
|
7
|
+
export type CreateFundingSource = {
|
|
8
|
+
acceptedTerms: Term[];
|
|
9
|
+
agreeToTerms: boolean;
|
|
10
|
+
billingInfo: FundingSourceAddress;
|
|
11
|
+
iovationBlackBox: IovationBlackBox;
|
|
12
|
+
paymentMethod: {
|
|
13
|
+
creditCardInfo: CreditCardInfo;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type FundingSource = {
|
|
17
|
+
currencyCode: string;
|
|
18
|
+
defaultCarrierId: string;
|
|
19
|
+
fundingSourceId: string;
|
|
20
|
+
paymentMethod: {
|
|
21
|
+
creditCardInfo: AbbreviatedCreditCardInfo | null;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type AbbreviatedCreditCardInfo = {
|
|
25
|
+
cardNumberLastFour: string;
|
|
26
|
+
provider: Provider;
|
|
27
|
+
};
|
|
28
|
+
export type Provider = "visa" | "mastercard" | "americanExpress" | "discover";
|
|
29
|
+
export type FundingSourceCarrier = {
|
|
30
|
+
acceptedTerms: Term[];
|
|
31
|
+
agreeToTerms: boolean;
|
|
32
|
+
carrierCode: string;
|
|
33
|
+
fundingSourceId: string;
|
|
34
|
+
iovationBlackBox: IovationBlackBox;
|
|
35
|
+
pickupAddress?: FundingSourceAddress;
|
|
36
|
+
};
|
|
37
|
+
export interface CarrierRegistration {
|
|
38
|
+
carriers: FundingSourceCarrier[];
|
|
39
|
+
}
|
|
40
|
+
export interface FundingSourceAddress {
|
|
41
|
+
addressLine1: string;
|
|
42
|
+
addressLine2?: string;
|
|
43
|
+
cityLocality: string;
|
|
44
|
+
company: string;
|
|
45
|
+
countryCode: string;
|
|
46
|
+
email: string;
|
|
47
|
+
fullName: string;
|
|
48
|
+
phone: string;
|
|
49
|
+
postalCode: string;
|
|
50
|
+
stateProvince: string;
|
|
51
|
+
}
|
|
52
|
+
export interface CreditCardInfo {
|
|
53
|
+
cardNumber: string;
|
|
54
|
+
cvv: string;
|
|
55
|
+
expirationMonth: number;
|
|
56
|
+
expirationYear: number;
|
|
57
|
+
name: string;
|
|
58
|
+
provider: Provider;
|
|
59
|
+
}
|
|
60
|
+
export interface Term {
|
|
61
|
+
termType: string;
|
|
62
|
+
version: string;
|
|
63
|
+
}
|
|
64
|
+
export type MetadataRequiredTerm = {
|
|
65
|
+
termType: string;
|
|
66
|
+
version: string;
|
|
67
|
+
};
|
|
68
|
+
export declare enum MetadataCapability {
|
|
69
|
+
AutoFunding = "auto_funding",
|
|
70
|
+
UpdatePaymentMethod = "update_payment_method",
|
|
71
|
+
DefaultPurchaseAmount = "default_purchase_amount",
|
|
72
|
+
ReportsLink = "reports_link",
|
|
73
|
+
BalanceHistory = "balance_history",
|
|
74
|
+
Nickname = "nickname",
|
|
75
|
+
RefreshServices = "refresh_services",
|
|
76
|
+
UpdatePassword = "update_password",
|
|
77
|
+
AccountSettingsLink = "account_settings_link",
|
|
78
|
+
Unknown = "unknown"
|
|
79
|
+
}
|
|
80
|
+
export declare enum MetadataRequirement {
|
|
81
|
+
BillingAddress = "billing_address",
|
|
82
|
+
CurrencyCode = "currency_code",
|
|
83
|
+
IovationBlackBox = "iovation_black_box",
|
|
84
|
+
Nickname = "nickname",
|
|
85
|
+
PaymentMethod = "payment_method",
|
|
86
|
+
PickupAddress = "pickup_address",
|
|
87
|
+
Unknown = "unknown"
|
|
88
|
+
}
|
|
89
|
+
export declare enum MetadataSatisfyingFormTypes {
|
|
90
|
+
Address = "address",
|
|
91
|
+
CreditCard = "credit_card",
|
|
92
|
+
StampsAccountCredentials = "stamps_account_credentials",
|
|
93
|
+
StampsSellerLabelProvider = "stamps_seller_label_provider",
|
|
94
|
+
Unknown = "unknown"
|
|
95
|
+
}
|
|
96
|
+
export type MetadataRegistrationRequirement = {
|
|
97
|
+
requirementType: MetadataRequirement;
|
|
98
|
+
satisfyingFormTypes: MetadataSatisfyingFormTypes[];
|
|
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
|
+
};
|
|
120
|
+
export interface CarrierRegistrationResponse {
|
|
121
|
+
carrierAttachmentResults: [
|
|
122
|
+
{
|
|
123
|
+
carrierId: string;
|
|
124
|
+
errorMessage: string;
|
|
125
|
+
fundingSourceId: string;
|
|
126
|
+
isSuccessful: boolean;
|
|
127
|
+
nickname: string;
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
export interface MetadataResponse {
|
|
132
|
+
defaultFundingSourceProfile: {
|
|
133
|
+
capabilities: MetadataCapability[] | null;
|
|
134
|
+
countryCode: string;
|
|
135
|
+
currencyCode: string;
|
|
136
|
+
registrationRequirements: MetadataRegistrationRequirement[];
|
|
137
|
+
requiredTerms: MetadataRequiredTerm[];
|
|
138
|
+
};
|
|
139
|
+
defaultRegionProfile: {
|
|
140
|
+
carrierProfiles: Array<{
|
|
141
|
+
capabilities: MetadataCapability[] | null;
|
|
142
|
+
carrierCode: string;
|
|
143
|
+
registrationRequirements: MetadataRegistrationRequirement[];
|
|
144
|
+
requiredTerms: MetadataRequiredTerm[];
|
|
145
|
+
}>;
|
|
146
|
+
countryCode: string;
|
|
147
|
+
currencyCode: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export type AddFundsResponse = {
|
|
151
|
+
balance: {
|
|
152
|
+
amount: number;
|
|
153
|
+
currency: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export type FundingSourceTransactionsResponse = {
|
|
157
|
+
transactions: FundingSourceTransaction[];
|
|
158
|
+
} & PageableResult;
|
|
159
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -2,19 +2,26 @@ export * as SE from "./types";
|
|
|
2
2
|
export * from "./account-settings";
|
|
3
3
|
export * from "./addresses";
|
|
4
4
|
export * from "./carriers";
|
|
5
|
+
export * from "./connections";
|
|
5
6
|
export * from "./client";
|
|
6
7
|
export * from "./custom-packages";
|
|
7
8
|
export * from "./dimensions";
|
|
8
9
|
export * from "./errors";
|
|
10
|
+
export * from "./funding-sources";
|
|
9
11
|
export * from "./insurance";
|
|
10
12
|
export * from "./labels";
|
|
11
13
|
export * from "./order-sources";
|
|
12
14
|
export * from "./payments";
|
|
13
15
|
export * from "./rates";
|
|
16
|
+
export * from "./rate-cards";
|
|
14
17
|
export * from "./relay-points";
|
|
15
18
|
export * from "./resources";
|
|
16
19
|
export * from "./sales-order-shipments";
|
|
17
20
|
export * from "./sales-orders";
|
|
18
21
|
export * from "./shipments";
|
|
22
|
+
export * from "./shipping-rules";
|
|
23
|
+
export * from "./utilities";
|
|
24
|
+
export * from "./themes";
|
|
19
25
|
export * from "./warehouses";
|
|
20
26
|
export * from "./weight";
|
|
27
|
+
export * from "./zones";
|