flexops 1.0.0 → 1.0.2
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.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/flexops/errors.rb +35 -35
- data/lib/flexops/resources/analytics.rb +85 -85
- data/lib/flexops/resources/api_keys.rb +40 -40
- data/lib/flexops/resources/auth.rb +57 -57
- data/lib/flexops/resources/carriers.rb +129 -129
- data/lib/flexops/resources/insurance.rb +48 -48
- data/lib/flexops/resources/inventory.rb +39 -39
- data/lib/flexops/resources/orders.rb +67 -67
- data/lib/flexops/resources/pickups.rb +40 -40
- data/lib/flexops/resources/returns.rb +61 -61
- data/lib/flexops/resources/rules.rb +48 -48
- data/lib/flexops/resources/scan_forms.rb +36 -36
- data/lib/flexops/resources/shipping.rb +84 -84
- data/lib/flexops/resources/wallet.rb +41 -41
- data/lib/flexops/resources/webhooks.rb +59 -59
- data/lib/flexops/resources/workspaces.rb +53 -53
- data/lib/flexops/version.rb +11 -11
- data/lib/flexops.rb +35 -35
- metadata +6 -3
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
module FlexOps
|
|
10
|
-
module Resources
|
|
11
|
-
class Carriers
|
|
12
|
-
attr_reader :usps, :ups, :fedex, :dhl
|
|
13
|
-
|
|
14
|
-
def initialize(http)
|
|
15
|
-
@http = http
|
|
16
|
-
@usps = UspsCarrier.new(http)
|
|
17
|
-
@ups = UpsCarrier.new(http)
|
|
18
|
-
@fedex = FedExCarrier.new(http)
|
|
19
|
-
@dhl = DhlCarrier.new(http)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
class UspsCarrier
|
|
24
|
-
PROXY = "/api/ApiProxy"
|
|
25
|
-
|
|
26
|
-
def initialize(http)
|
|
27
|
-
@http = http
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def validate_address(params) = @http.get("#{PROXY}/api/v3/AddressValidation/getUspsValidateAndCorrectAddress", query: params)
|
|
31
|
-
def city_state_lookup(zip_code) = @http.get("#{PROXY}/api/v3/AddressValidation/getUspsCityStateLookupByZipCode", query: { zipCode: zip_code })
|
|
32
|
-
def zip_code_lookup(params) = @http.get("#{PROXY}/api/v3/AddressValidation/getUspsZipCodeLookupByAddress", query: params)
|
|
33
|
-
def get_domestic_rates(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchDomesticBaseRates", body: body)
|
|
34
|
-
def get_domestic_products(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchEligibleDomesticProducts", body: body)
|
|
35
|
-
def get_domestic_prices(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchEligibleDomesticPrices", body: body)
|
|
36
|
-
def get_international_rates(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchInternationalBaseRates", body: body)
|
|
37
|
-
def get_international_prices(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchEligibleInternationalPrices", body: body)
|
|
38
|
-
def create_domestic_label(body) = @http.post("#{PROXY}/api/v3/Shipping/postUspsGenerateDomesticShippingLabel", body: body)
|
|
39
|
-
def create_return_label(body) = @http.post("#{PROXY}/api/v3/Shipping/postUspsGenerateDomesticReturnsShippingLabel", body: body)
|
|
40
|
-
def create_international_label(body) = @http.post("#{PROXY}/api/v3/Shipping/postUspsGenerateInternationalShippingLabel", body: body)
|
|
41
|
-
def cancel_domestic_label = @http.delete("#{PROXY}/api/v3/Shipping/cancelUspsDomesticShipmentLabel")
|
|
42
|
-
def cancel_international_label = @http.delete("#{PROXY}/api/v3/Shipping/cancelUspsInternationalShipmentLabel")
|
|
43
|
-
def track_summary(params) = @http.get("#{PROXY}/api/v3/Tracking/getUspsTrackingSummaryInformation", query: params)
|
|
44
|
-
def track_detail(params) = @http.get("#{PROXY}/api/v3/Tracking/getUspsTrackingDetailInformation", query: params)
|
|
45
|
-
def create_pickup(body) = @http.post("#{PROXY}/api/v3/CarrierPickup/postUspsCreateCarrierPickupSchedule", body: body)
|
|
46
|
-
def cancel_pickup = @http.delete("#{PROXY}/api/v3/CarrierPickup/cancelUspsCarrierPickupSchedule")
|
|
47
|
-
def create_scan_form(body) = @http.post("#{PROXY}/api/v3/ScanForm/postUspsCreateScanFormLabelShipment", body: body)
|
|
48
|
-
def delivery_standards(params) = @http.get("#{PROXY}/api/v3/ServiceStandards/getUspsGetDeliveryStandardsEstimates", query: params)
|
|
49
|
-
def find_drop_off_locations(params) = @http.get("#{PROXY}/api/v3/LocationSearch/getUspsFindValidDropOffLocations", query: params)
|
|
50
|
-
def find_post_offices(params) = @http.get("#{PROXY}/api/v3/LocationSearch/getUspsFindValidPostOfficeLocations", query: params)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
class UpsCarrier
|
|
54
|
-
PROXY = "/api/ApiProxy"
|
|
55
|
-
|
|
56
|
-
def initialize(http)
|
|
57
|
-
@http = http
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def validate_address(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsVerifyAddress", body: body)
|
|
61
|
-
def get_rates(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsRateCheck", body: body)
|
|
62
|
-
def create_label(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/generateNewUpsShipLabel", body: body)
|
|
63
|
-
def track(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getSingleUpsTrackingDetail", query: params)
|
|
64
|
-
def create_pickup(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsCreatePickup", body: body)
|
|
65
|
-
def cancel_pickup = @http.delete("#{PROXY}/api/v2/ShippingLabel/deleteUpsPickup")
|
|
66
|
-
def get_transit_times(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsGetTransitTimes", body: body)
|
|
67
|
-
def get_landed_cost(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsGetLandedCostQuote", body: body)
|
|
68
|
-
def search_locations(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsSearchLocations", body: body)
|
|
69
|
-
def upload_document(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsUploadPaperlessDocument", body: body)
|
|
70
|
-
def create_freight_shipment(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsCreateFreightShipment", body: body)
|
|
71
|
-
def get_freight_rate(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsGetFreightRate", body: body)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
class FedExCarrier
|
|
75
|
-
PROXY = "/api/ApiProxy"
|
|
76
|
-
|
|
77
|
-
def initialize(http)
|
|
78
|
-
@http = http
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
def validate_address(body) = @http.post("#{PROXY}/api/v3/AddressValidation/postFedExValidateAndCorrectDomesticAddress", body: body)
|
|
82
|
-
def validate_postal_code(body) = @http.post("#{PROXY}/api/v3/AddressValidation/postFedExValidatePostalCode", body: body)
|
|
83
|
-
def get_rates(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postRetrieveFedExRateAndTransitTimesAsync", body: body)
|
|
84
|
-
def create_shipment(body) = @http.post("#{PROXY}/api/v3/Shipping/postFedExCreateNewShipment", body: body)
|
|
85
|
-
def cancel_shipment(body) = @http.put("#{PROXY}/api/v3/Shipping/putFedExCancelShipment", body: body)
|
|
86
|
-
def validate_shipment(body) = @http.post("#{PROXY}/api/v3/Shipping/postFedExValidateShipment", body: body)
|
|
87
|
-
def create_return_shipment(body) = @http.post("#{PROXY}/api/v3/Shipping/postFedExCreateNewReturnShipment", body: body)
|
|
88
|
-
def track(body) = @http.post("#{PROXY}/api/v3/Tracking/postFedExRetrieveTrackingInfoByTrackingNumber", body: body)
|
|
89
|
-
def track_multi_piece(body) = @http.post("#{PROXY}/api/v3/Tracking/postFedExRetrieveTrackingInfoForMultiPieceShipment", body: body)
|
|
90
|
-
def register_tracking_notification(body) = @http.post("#{PROXY}/api/v3/Tracking/postFedExRegisterForTrackingNotification", body: body)
|
|
91
|
-
def create_pickup(body) = @http.post("#{PROXY}/api/v3/CarrierPickup/postFedExCreateCarrierPickupRequest", body: body)
|
|
92
|
-
def cancel_pickup(body) = @http.put("#{PROXY}/api/v3/CarrierPickup/putFedExCancelCarrierPickupRequest", body: body)
|
|
93
|
-
def search_locations(body) = @http.post("#{PROXY}/api/v3/LocationSearch/postFedExSearchValidLocations", body: body)
|
|
94
|
-
def get_service_standards(body) = @http.post("#{PROXY}/api/v3/ServiceStandards/postFedExRetrieveServicesAndTransitTimes", body: body)
|
|
95
|
-
def get_freight_rate(body) = @http.post("#{PROXY}/api/v3/Freight/postFedExGetFreightRateQuote", body: body)
|
|
96
|
-
def create_freight_shipment(body) = @http.post("#{PROXY}/api/v3/Freight/postFedExCreateFreightShipment", body: body)
|
|
97
|
-
def ground_close(body) = @http.post("#{PROXY}/api/v3/GroundClose/postFedExCloseWithDocuments", body: body)
|
|
98
|
-
def upload_trade_documents(body) = @http.post("#{PROXY}/api/v3/Trade/postFedExUploadTradeDocuments", body: body)
|
|
99
|
-
def create_open_shipment(body) = @http.post("#{PROXY}/api/v3/OpenShip/postFedExCreateOpenShipment", body: body)
|
|
100
|
-
def add_packages_to_open_shipment(body) = @http.post("#{PROXY}/api/v3/OpenShip/postFedExAddPackagesToOpenShipment", body: body)
|
|
101
|
-
def confirm_open_shipment(body) = @http.post("#{PROXY}/api/v3/OpenShip/postFedExConfirmOpenShipment", body: body)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
class DhlCarrier
|
|
105
|
-
PROXY = "/api/ApiProxy"
|
|
106
|
-
|
|
107
|
-
def initialize(http)
|
|
108
|
-
@http = http
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
def validate_address(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlValidateAddress", query: params)
|
|
112
|
-
def get_rates(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlRates", query: params)
|
|
113
|
-
def get_multi_piece_rates(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlMultiPieceRates", body: body)
|
|
114
|
-
def get_products(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlProducts", query: params)
|
|
115
|
-
def create_shipment(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlCreateShipment", body: body)
|
|
116
|
-
def track(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlTrackSingleShipment", query: params)
|
|
117
|
-
def track_multiple(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlTrackMultipleShipments", query: params)
|
|
118
|
-
def create_pickup(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlCreatePickup", body: body)
|
|
119
|
-
def update_pickup(body) = @http.patch("#{PROXY}/api/v2/ShippingLabel/patchDhlUpdatePickup", body: body)
|
|
120
|
-
def cancel_pickup = @http.delete("#{PROXY}/api/v2/ShippingLabel/deleteDhlPickup")
|
|
121
|
-
def calculate_landed_cost(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlCalculateLandedCost", body: body)
|
|
122
|
-
def screen_shipment(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlScreenShipment", body: body)
|
|
123
|
-
def upload_invoice(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlUploadInvoice", body: body)
|
|
124
|
-
def get_proof_of_delivery(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlElectronicProofOfDelivery", query: params)
|
|
125
|
-
def get_reference_data(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlReferenceData", query: params)
|
|
126
|
-
def find_service_points(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlServicePoints", query: params)
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
module FlexOps
|
|
10
|
+
module Resources
|
|
11
|
+
class Carriers
|
|
12
|
+
attr_reader :usps, :ups, :fedex, :dhl
|
|
13
|
+
|
|
14
|
+
def initialize(http)
|
|
15
|
+
@http = http
|
|
16
|
+
@usps = UspsCarrier.new(http)
|
|
17
|
+
@ups = UpsCarrier.new(http)
|
|
18
|
+
@fedex = FedExCarrier.new(http)
|
|
19
|
+
@dhl = DhlCarrier.new(http)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class UspsCarrier
|
|
24
|
+
PROXY = "/api/ApiProxy"
|
|
25
|
+
|
|
26
|
+
def initialize(http)
|
|
27
|
+
@http = http
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def validate_address(params) = @http.get("#{PROXY}/api/v3/AddressValidation/getUspsValidateAndCorrectAddress", query: params)
|
|
31
|
+
def city_state_lookup(zip_code) = @http.get("#{PROXY}/api/v3/AddressValidation/getUspsCityStateLookupByZipCode", query: { zipCode: zip_code })
|
|
32
|
+
def zip_code_lookup(params) = @http.get("#{PROXY}/api/v3/AddressValidation/getUspsZipCodeLookupByAddress", query: params)
|
|
33
|
+
def get_domestic_rates(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchDomesticBaseRates", body: body)
|
|
34
|
+
def get_domestic_products(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchEligibleDomesticProducts", body: body)
|
|
35
|
+
def get_domestic_prices(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchEligibleDomesticPrices", body: body)
|
|
36
|
+
def get_international_rates(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchInternationalBaseRates", body: body)
|
|
37
|
+
def get_international_prices(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postUspsSearchEligibleInternationalPrices", body: body)
|
|
38
|
+
def create_domestic_label(body) = @http.post("#{PROXY}/api/v3/Shipping/postUspsGenerateDomesticShippingLabel", body: body)
|
|
39
|
+
def create_return_label(body) = @http.post("#{PROXY}/api/v3/Shipping/postUspsGenerateDomesticReturnsShippingLabel", body: body)
|
|
40
|
+
def create_international_label(body) = @http.post("#{PROXY}/api/v3/Shipping/postUspsGenerateInternationalShippingLabel", body: body)
|
|
41
|
+
def cancel_domestic_label = @http.delete("#{PROXY}/api/v3/Shipping/cancelUspsDomesticShipmentLabel")
|
|
42
|
+
def cancel_international_label = @http.delete("#{PROXY}/api/v3/Shipping/cancelUspsInternationalShipmentLabel")
|
|
43
|
+
def track_summary(params) = @http.get("#{PROXY}/api/v3/Tracking/getUspsTrackingSummaryInformation", query: params)
|
|
44
|
+
def track_detail(params) = @http.get("#{PROXY}/api/v3/Tracking/getUspsTrackingDetailInformation", query: params)
|
|
45
|
+
def create_pickup(body) = @http.post("#{PROXY}/api/v3/CarrierPickup/postUspsCreateCarrierPickupSchedule", body: body)
|
|
46
|
+
def cancel_pickup = @http.delete("#{PROXY}/api/v3/CarrierPickup/cancelUspsCarrierPickupSchedule")
|
|
47
|
+
def create_scan_form(body) = @http.post("#{PROXY}/api/v3/ScanForm/postUspsCreateScanFormLabelShipment", body: body)
|
|
48
|
+
def delivery_standards(params) = @http.get("#{PROXY}/api/v3/ServiceStandards/getUspsGetDeliveryStandardsEstimates", query: params)
|
|
49
|
+
def find_drop_off_locations(params) = @http.get("#{PROXY}/api/v3/LocationSearch/getUspsFindValidDropOffLocations", query: params)
|
|
50
|
+
def find_post_offices(params) = @http.get("#{PROXY}/api/v3/LocationSearch/getUspsFindValidPostOfficeLocations", query: params)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class UpsCarrier
|
|
54
|
+
PROXY = "/api/ApiProxy"
|
|
55
|
+
|
|
56
|
+
def initialize(http)
|
|
57
|
+
@http = http
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def validate_address(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsVerifyAddress", body: body)
|
|
61
|
+
def get_rates(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsRateCheck", body: body)
|
|
62
|
+
def create_label(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/generateNewUpsShipLabel", body: body)
|
|
63
|
+
def track(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getSingleUpsTrackingDetail", query: params)
|
|
64
|
+
def create_pickup(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsCreatePickup", body: body)
|
|
65
|
+
def cancel_pickup = @http.delete("#{PROXY}/api/v2/ShippingLabel/deleteUpsPickup")
|
|
66
|
+
def get_transit_times(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsGetTransitTimes", body: body)
|
|
67
|
+
def get_landed_cost(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsGetLandedCostQuote", body: body)
|
|
68
|
+
def search_locations(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsSearchLocations", body: body)
|
|
69
|
+
def upload_document(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsUploadPaperlessDocument", body: body)
|
|
70
|
+
def create_freight_shipment(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsCreateFreightShipment", body: body)
|
|
71
|
+
def get_freight_rate(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postUpsGetFreightRate", body: body)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class FedExCarrier
|
|
75
|
+
PROXY = "/api/ApiProxy"
|
|
76
|
+
|
|
77
|
+
def initialize(http)
|
|
78
|
+
@http = http
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def validate_address(body) = @http.post("#{PROXY}/api/v3/AddressValidation/postFedExValidateAndCorrectDomesticAddress", body: body)
|
|
82
|
+
def validate_postal_code(body) = @http.post("#{PROXY}/api/v3/AddressValidation/postFedExValidatePostalCode", body: body)
|
|
83
|
+
def get_rates(body) = @http.post("#{PROXY}/api/v3/RateCalculator/postRetrieveFedExRateAndTransitTimesAsync", body: body)
|
|
84
|
+
def create_shipment(body) = @http.post("#{PROXY}/api/v3/Shipping/postFedExCreateNewShipment", body: body)
|
|
85
|
+
def cancel_shipment(body) = @http.put("#{PROXY}/api/v3/Shipping/putFedExCancelShipment", body: body)
|
|
86
|
+
def validate_shipment(body) = @http.post("#{PROXY}/api/v3/Shipping/postFedExValidateShipment", body: body)
|
|
87
|
+
def create_return_shipment(body) = @http.post("#{PROXY}/api/v3/Shipping/postFedExCreateNewReturnShipment", body: body)
|
|
88
|
+
def track(body) = @http.post("#{PROXY}/api/v3/Tracking/postFedExRetrieveTrackingInfoByTrackingNumber", body: body)
|
|
89
|
+
def track_multi_piece(body) = @http.post("#{PROXY}/api/v3/Tracking/postFedExRetrieveTrackingInfoForMultiPieceShipment", body: body)
|
|
90
|
+
def register_tracking_notification(body) = @http.post("#{PROXY}/api/v3/Tracking/postFedExRegisterForTrackingNotification", body: body)
|
|
91
|
+
def create_pickup(body) = @http.post("#{PROXY}/api/v3/CarrierPickup/postFedExCreateCarrierPickupRequest", body: body)
|
|
92
|
+
def cancel_pickup(body) = @http.put("#{PROXY}/api/v3/CarrierPickup/putFedExCancelCarrierPickupRequest", body: body)
|
|
93
|
+
def search_locations(body) = @http.post("#{PROXY}/api/v3/LocationSearch/postFedExSearchValidLocations", body: body)
|
|
94
|
+
def get_service_standards(body) = @http.post("#{PROXY}/api/v3/ServiceStandards/postFedExRetrieveServicesAndTransitTimes", body: body)
|
|
95
|
+
def get_freight_rate(body) = @http.post("#{PROXY}/api/v3/Freight/postFedExGetFreightRateQuote", body: body)
|
|
96
|
+
def create_freight_shipment(body) = @http.post("#{PROXY}/api/v3/Freight/postFedExCreateFreightShipment", body: body)
|
|
97
|
+
def ground_close(body) = @http.post("#{PROXY}/api/v3/GroundClose/postFedExCloseWithDocuments", body: body)
|
|
98
|
+
def upload_trade_documents(body) = @http.post("#{PROXY}/api/v3/Trade/postFedExUploadTradeDocuments", body: body)
|
|
99
|
+
def create_open_shipment(body) = @http.post("#{PROXY}/api/v3/OpenShip/postFedExCreateOpenShipment", body: body)
|
|
100
|
+
def add_packages_to_open_shipment(body) = @http.post("#{PROXY}/api/v3/OpenShip/postFedExAddPackagesToOpenShipment", body: body)
|
|
101
|
+
def confirm_open_shipment(body) = @http.post("#{PROXY}/api/v3/OpenShip/postFedExConfirmOpenShipment", body: body)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
class DhlCarrier
|
|
105
|
+
PROXY = "/api/ApiProxy"
|
|
106
|
+
|
|
107
|
+
def initialize(http)
|
|
108
|
+
@http = http
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def validate_address(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlValidateAddress", query: params)
|
|
112
|
+
def get_rates(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlRates", query: params)
|
|
113
|
+
def get_multi_piece_rates(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlMultiPieceRates", body: body)
|
|
114
|
+
def get_products(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlProducts", query: params)
|
|
115
|
+
def create_shipment(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlCreateShipment", body: body)
|
|
116
|
+
def track(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlTrackSingleShipment", query: params)
|
|
117
|
+
def track_multiple(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlTrackMultipleShipments", query: params)
|
|
118
|
+
def create_pickup(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlCreatePickup", body: body)
|
|
119
|
+
def update_pickup(body) = @http.patch("#{PROXY}/api/v2/ShippingLabel/patchDhlUpdatePickup", body: body)
|
|
120
|
+
def cancel_pickup = @http.delete("#{PROXY}/api/v2/ShippingLabel/deleteDhlPickup")
|
|
121
|
+
def calculate_landed_cost(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlCalculateLandedCost", body: body)
|
|
122
|
+
def screen_shipment(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlScreenShipment", body: body)
|
|
123
|
+
def upload_invoice(body) = @http.post("#{PROXY}/api/v2/ShippingLabel/postDhlUploadInvoice", body: body)
|
|
124
|
+
def get_proof_of_delivery(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlElectronicProofOfDelivery", query: params)
|
|
125
|
+
def get_reference_data(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlReferenceData", query: params)
|
|
126
|
+
def find_service_points(params) = @http.get("#{PROXY}/api/v2/ShippingLabel/getDhlServicePoints", query: params)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
module FlexOps
|
|
10
|
-
module Resources
|
|
11
|
-
class Insurance
|
|
12
|
-
def initialize(http, ws_id_proc)
|
|
13
|
-
@http = http
|
|
14
|
-
@ws_id = ws_id_proc
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def get_providers
|
|
18
|
-
@http.get("#{ws_path}/insurance/providers")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def get_quote(carrier:, declared_value:, provider: nil)
|
|
22
|
-
body = { carrier: carrier, declaredValue: declared_value }
|
|
23
|
-
body[:provider] = provider if provider
|
|
24
|
-
@http.post("#{ws_path}/insurance/quote", body: body)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def purchase(tracking_number:, carrier:, declared_value:, provider: nil)
|
|
28
|
-
body = { trackingNumber: tracking_number, carrier: carrier, declaredValue: declared_value }
|
|
29
|
-
body[:provider] = provider if provider
|
|
30
|
-
@http.post("#{ws_path}/insurance/purchase", body: body)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def void(policy_id)
|
|
34
|
-
@http.delete("#{ws_path}/insurance/policies/#{policy_id}")
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def file_claim(policy_id, description:, claim_amount:)
|
|
38
|
-
@http.post("#{ws_path}/insurance/policies/#{policy_id}/claims", body: { description: description, claimAmount: claim_amount })
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
private
|
|
42
|
-
|
|
43
|
-
def ws_path
|
|
44
|
-
"/api/workspaces/#{@ws_id.call}"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
module FlexOps
|
|
10
|
+
module Resources
|
|
11
|
+
class Insurance
|
|
12
|
+
def initialize(http, ws_id_proc)
|
|
13
|
+
@http = http
|
|
14
|
+
@ws_id = ws_id_proc
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get_providers
|
|
18
|
+
@http.get("#{ws_path}/insurance/providers")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def get_quote(carrier:, declared_value:, provider: nil)
|
|
22
|
+
body = { carrier: carrier, declaredValue: declared_value }
|
|
23
|
+
body[:provider] = provider if provider
|
|
24
|
+
@http.post("#{ws_path}/insurance/quote", body: body)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def purchase(tracking_number:, carrier:, declared_value:, provider: nil)
|
|
28
|
+
body = { trackingNumber: tracking_number, carrier: carrier, declaredValue: declared_value }
|
|
29
|
+
body[:provider] = provider if provider
|
|
30
|
+
@http.post("#{ws_path}/insurance/purchase", body: body)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def void(policy_id)
|
|
34
|
+
@http.delete("#{ws_path}/insurance/policies/#{policy_id}")
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def file_claim(policy_id, description:, claim_amount:)
|
|
38
|
+
@http.post("#{ws_path}/insurance/policies/#{policy_id}/claims", body: { description: description, claimAmount: claim_amount })
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
private
|
|
42
|
+
|
|
43
|
+
def ws_path
|
|
44
|
+
"/api/workspaces/#{@ws_id.call}"
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
module FlexOps
|
|
10
|
-
module Resources
|
|
11
|
-
class Inventory
|
|
12
|
-
PROXY = "/api/ApiProxy"
|
|
13
|
-
|
|
14
|
-
def initialize(http)
|
|
15
|
-
@http = http
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def post_asn_receipt(receipt)
|
|
19
|
-
@http.post("#{PROXY}/api/v1/Inventory/postNewAsnReceipt", body: receipt)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def get_warehouse_snapshot(params = nil)
|
|
23
|
-
@http.get("#{PROXY}/api/v1/Inventory/getWarehouseInventorySnapshot", query: params)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def get_complete_snapshot(params = nil)
|
|
27
|
-
@http.get("#{PROXY}/api/v1/Inventory/getCompleteInventorySnapshot", query: params)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def get_part_numbers(params = nil)
|
|
31
|
-
@http.get("#{PROXY}/api/v1/Inventory/getPartNumberList", query: params)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def update_inventory(data)
|
|
35
|
-
@http.post("#{PROXY}/api/v2/Inventory/postCustomerInventoryUpdate", body: data)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
module FlexOps
|
|
10
|
+
module Resources
|
|
11
|
+
class Inventory
|
|
12
|
+
PROXY = "/api/ApiProxy"
|
|
13
|
+
|
|
14
|
+
def initialize(http)
|
|
15
|
+
@http = http
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def post_asn_receipt(receipt)
|
|
19
|
+
@http.post("#{PROXY}/api/v1/Inventory/postNewAsnReceipt", body: receipt)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def get_warehouse_snapshot(params = nil)
|
|
23
|
+
@http.get("#{PROXY}/api/v1/Inventory/getWarehouseInventorySnapshot", query: params)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_complete_snapshot(params = nil)
|
|
27
|
+
@http.get("#{PROXY}/api/v1/Inventory/getCompleteInventorySnapshot", query: params)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def get_part_numbers(params = nil)
|
|
31
|
+
@http.get("#{PROXY}/api/v1/Inventory/getPartNumberList", query: params)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def update_inventory(data)
|
|
35
|
+
@http.post("#{PROXY}/api/v2/Inventory/postCustomerInventoryUpdate", body: data)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
module FlexOps
|
|
10
|
-
module Resources
|
|
11
|
-
class Orders
|
|
12
|
-
BASE = "/api/ApiProxy/api/v1/Order"
|
|
13
|
-
|
|
14
|
-
def initialize(http)
|
|
15
|
-
@http = http
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def create(order)
|
|
19
|
-
@http.post("#{BASE}/postNewOrder", body: order)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def get_new_orders(params = nil)
|
|
23
|
-
@http.get("#{BASE}/getNewOrderList", query: params)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def get_by_status(params = nil)
|
|
27
|
-
@http.get("#{BASE}/getAllOrderListByStatus", query: params)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def get_details(order_number)
|
|
31
|
-
@http.get("#{BASE}/getCompleteOrderDetailsByOrderNumber", query: { orderNumber: order_number })
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def get_extended_details(order_number)
|
|
35
|
-
@http.get("#{BASE}/getExtendedOrderDetailsByOrderNumber", query: { orderNumber: order_number })
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def get_status(order_number)
|
|
39
|
-
@http.get("#{BASE}/getIndividualOrderStatusByOrderNumber", query: { orderNumber: order_number })
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def cancel(order_number)
|
|
43
|
-
@http.post("#{BASE}/cancelOrderByOrderNumber", body: { orderNumber: order_number })
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def get_items(order_number)
|
|
47
|
-
@http.get("#{BASE}/getAllOrderItemsByOrderNumber", query: { orderNumber: order_number })
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def get_ship_methods
|
|
51
|
-
@http.get("#{BASE}/getAvailableShipMethodsList")
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def get_warehouses
|
|
55
|
-
@http.get("#{BASE}/getActiveWarehouseList")
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def get_country_codes
|
|
59
|
-
@http.get("#{BASE}/getCountryNameCodeList")
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def get_status_types
|
|
63
|
-
@http.get("#{BASE}/getOrderStatusTypesList")
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
module FlexOps
|
|
10
|
+
module Resources
|
|
11
|
+
class Orders
|
|
12
|
+
BASE = "/api/ApiProxy/api/v1/Order"
|
|
13
|
+
|
|
14
|
+
def initialize(http)
|
|
15
|
+
@http = http
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def create(order)
|
|
19
|
+
@http.post("#{BASE}/postNewOrder", body: order)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def get_new_orders(params = nil)
|
|
23
|
+
@http.get("#{BASE}/getNewOrderList", query: params)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_by_status(params = nil)
|
|
27
|
+
@http.get("#{BASE}/getAllOrderListByStatus", query: params)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def get_details(order_number)
|
|
31
|
+
@http.get("#{BASE}/getCompleteOrderDetailsByOrderNumber", query: { orderNumber: order_number })
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def get_extended_details(order_number)
|
|
35
|
+
@http.get("#{BASE}/getExtendedOrderDetailsByOrderNumber", query: { orderNumber: order_number })
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def get_status(order_number)
|
|
39
|
+
@http.get("#{BASE}/getIndividualOrderStatusByOrderNumber", query: { orderNumber: order_number })
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def cancel(order_number)
|
|
43
|
+
@http.post("#{BASE}/cancelOrderByOrderNumber", body: { orderNumber: order_number })
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def get_items(order_number)
|
|
47
|
+
@http.get("#{BASE}/getAllOrderItemsByOrderNumber", query: { orderNumber: order_number })
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def get_ship_methods
|
|
51
|
+
@http.get("#{BASE}/getAvailableShipMethodsList")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def get_warehouses
|
|
55
|
+
@http.get("#{BASE}/getActiveWarehouseList")
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def get_country_codes
|
|
59
|
+
@http.get("#{BASE}/getCountryNameCodeList")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def get_status_types
|
|
63
|
+
@http.get("#{BASE}/getOrderStatusTypesList")
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|