Skip to content

Commit 45ef1cb

Browse files
committed
picqer init
1 parent 163ad45 commit 45ef1cb

File tree

11 files changed

+708
-6
lines changed

11 files changed

+708
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import picqer from "../../picqer.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "picqer-check-return-receipt",
6+
name: "Check Return Receipt",
7+
description: "Check the return receipt in Picqer. [See the documentation](https://picqer.com/en/api/returns)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
picqer,
12+
returnId: {
13+
propDefinition: [
14+
picqer,
15+
"returnId",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.picqer.checkReturnReceipt({
21+
returnId: this.returnId,
22+
});
23+
$.export("$summary", `Successfully retrieved return receipt for Return ID: ${this.returnId}`);
24+
return response;
25+
},
26+
};
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import picqer from "../../picqer.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "picqer-create-order",
6+
name: "Create Picqer Order",
7+
description: "Create a new order in Picqer with customer details, products, and optional warehouse assignment. [See the documentation](https://picqer.com/en/api/orders)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
picqer,
12+
customerDetails: {
13+
propDefinition: [
14+
picqer,
15+
"customerDetails",
16+
],
17+
},
18+
products: {
19+
propDefinition: [
20+
picqer,
21+
"products",
22+
],
23+
},
24+
warehouseId: {
25+
propDefinition: [
26+
picqer,
27+
"warehouseId",
28+
],
29+
optional: true,
30+
},
31+
idcustomer: {
32+
type: "integer",
33+
label: "Customer ID",
34+
description: "Linked to resource Customers. When idcustomer is not given, a guest-order will be created.",
35+
optional: true,
36+
},
37+
idtemplate: {
38+
type: "integer",
39+
label: "Template ID",
40+
description: "Linked to resource Templates, if null the default template will be selected.",
41+
optional: true,
42+
},
43+
idshippingprovider_profile: {
44+
type: "integer",
45+
label: "Shipping Provider Profile ID",
46+
description: "The preferred shipping provider profile for this order.",
47+
optional: true,
48+
},
49+
reference: {
50+
type: "string",
51+
label: "Reference",
52+
description: "Reference for customer, will be printed on invoice and picking list.",
53+
optional: true,
54+
},
55+
customer_remarks: {
56+
type: "string",
57+
label: "Customer Remarks",
58+
description: "Remarks from the customer, will be printed on picking and packing list.",
59+
optional: true,
60+
},
61+
partialdelivery: {
62+
type: "boolean",
63+
label: "Partial Delivery",
64+
description: "If Picqer AutoSplit is enabled, order can be split over multiple picklists over multiple warehouses. If disabled, it will wait for all products to be available.",
65+
optional: true,
66+
},
67+
discount: {
68+
type: "float",
69+
label: "Discount",
70+
description: "Discount percentage of order.",
71+
optional: true,
72+
},
73+
invoiced: {
74+
type: "boolean",
75+
label: "Invoiced",
76+
description: "If this order is already invoiced, set this to true. This will ensure Picqer will not invoice this order.",
77+
optional: true,
78+
},
79+
preferred_delivery_date: {
80+
type: "string",
81+
label: "Preferred Delivery Date",
82+
description: "Customer supplied preferred delivery date, in format yyyy-mm-dd.",
83+
optional: true,
84+
},
85+
language: {
86+
type: "string",
87+
label: "Language",
88+
description: "Language used for communication with customer, 'nl' or 'en'.",
89+
optional: true,
90+
},
91+
},
92+
async run({ $ }) {
93+
const response = await this.picqer.createOrder({
94+
idcustomer: this.idcustomer,
95+
idtemplate: this.idtemplate,
96+
idshippingprovider_profile: this.idshippingprovider_profile,
97+
reference: this.reference,
98+
customer_remarks: this.customer_remarks,
99+
partialdelivery: this.partialdelivery,
100+
discount: this.discount,
101+
invoiced: this.invoiced,
102+
preferred_delivery_date: this.preferred_delivery_date,
103+
language: this.language,
104+
customerDetails: this.customerDetails,
105+
products: this.products.map(JSON.parse),
106+
warehouses: this.warehouseId
107+
? [
108+
this.warehouseId,
109+
]
110+
: undefined,
111+
});
112+
113+
$.export("$summary", `Order created successfully with ID ${response.idorder}`);
114+
return response;
115+
},
116+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import picqer from "../../picqer.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "picqer-get-return-receipt-data",
6+
name: "Get Return Receipt Data",
7+
description: "Get the data of a return receipt in Picqer. [See the documentation](https://picqer.com/en/api/returns)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
picqer,
12+
returnId: {
13+
propDefinition: [
14+
picqer,
15+
"returnId",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.picqer.getReturnReceiptData({
21+
returnId: this.returnId,
22+
});
23+
24+
$.export("$summary", `Successfully retrieved return receipt data for ID: ${this.returnId}`);
25+
return response;
26+
},
27+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import picqer from "../../picqer.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "picqer-get-shipment-data",
6+
name: "Get Shipment Data",
7+
description: "Retrieve the data of a shipment in Picqer. [See the documentation](https://picqer.com/en/api/picklist-shipments)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
picqer,
12+
shipmentId: {
13+
propDefinition: [
14+
picqer,
15+
"shipmentId",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.picqer.getShipmentData({
21+
shipmentId: this.shipmentId,
22+
});
23+
$.export("$summary", `Successfully retrieved shipment data for shipment ID: ${this.shipmentId}`);
24+
return response;
25+
},
26+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import picqer from "../../picqer.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "picqer-get-shipment-status",
6+
name: "Get Shipment Status",
7+
description: "Get the status of a shipment in Picqer. [See the documentation](https://picqer.com/en/api/picklist-shipments#h-get-single-shipment)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
picqer,
12+
shipmentId: {
13+
propDefinition: [
14+
picqer,
15+
"shipmentId",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.picqer.getShipmentStatus({
21+
shipmentId: this.shipmentId,
22+
});
23+
$.export("$summary", `Successfully retrieved status for shipment ID: ${this.shipmentId}`);
24+
return response;
25+
},
26+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import picqer from "../../picqer.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "picqer-update-stock",
6+
name: "Update Product Stock",
7+
description: "Update the stock level of a product in a specific warehouse. [See the documentation](https://picqer.com/en/api)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
picqer,
12+
productCode: {
13+
propDefinition: [
14+
picqer,
15+
"productCode",
16+
],
17+
},
18+
warehouseId: {
19+
propDefinition: [
20+
picqer,
21+
"warehouseId",
22+
],
23+
},
24+
stock: {
25+
type: "integer",
26+
label: "Stock Level",
27+
description: "The new stock level for the product in the specified warehouse.",
28+
},
29+
},
30+
async run({ $ }) {
31+
const response = await this.picqer.updateProductStock({
32+
productCode: this.productCode,
33+
warehouseId: this.warehouseId,
34+
stock: this.stock,
35+
});
36+
37+
$.export("$summary", `Successfully updated the stock for product ${this.productCode} in warehouse ${this.warehouseId}`);
38+
return response;
39+
},
40+
};

components/picqer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
"publishConfig": {
1313
"access": "public"
1414
}
15-
}
15+
}

0 commit comments

Comments
 (0)