Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import everstox from "../../everstox.app.mjs";

export default {
key: "everstox-create-fulfillment-update-request",
name: "Create Fulfillment Update Request",
description:
"Creates a new fulfillment update request for a specific fulfillment."
+ " The fulfillment must be in `in_fulfillment` state."
+ " Use this to modify items, quantities, prices, addresses, or priority on an active fulfillment."
Comment thread
michelle0927 marked this conversation as resolved.
+ " `fulfillment_items` must include at least one item with a valid SKU; `price_set` quantities must sum to the item quantity."
+ " Address fields `first_name`/`last_name` or `company` are conditionally required (at least one set must be present)."
+ " [See the documentation](https://api.staging.everstox.com/api/v1/ui/#/Fulfillment-updates/district_core.api.shops.fulfillments.fulfillments.Fulfillments.create_fulfillment_update_request)",
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
everstox,
fulfillmentId: {
type: "string",
label: "Fulfillment ID",
description: "The UUID of the fulfillment to update. Must be in `in_fulfillment` state.",
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
},
fulfillmentItems: {
type: "string",
label: "Fulfillment Items",
description: "JSON array of fulfillment items to update. Must contain at least one item."
+ " Omit `id` when adding a new item; include it when updating an existing one."
+ " Each item requires a `product.sku` and a `price_set` with at least one entry."
+ " Example: `[{\"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"quantity\": 2, \"product\": {\"sku\": \"PROD-001\"}, \"price_set\": [{\"quantity\": 2, \"currency\": \"EUR\", \"price_net_after_discount\": \"19.99\", \"tax_amount\": \"3.80\", \"tax_rate\": \"0.19\"}]}]`",
},
shippingAddress: {
type: "string",
label: "Shipping Address",
Comment thread
michelle0927 marked this conversation as resolved.
description: "JSON object with the complete shipping address."
+ " Required fields: `country_code` (ISO 2-letter, e.g. `\"DE\"`), `country` (full country name, e.g. `\"Germany\"`), `city`, `zip`, `address_1`,"
+ " and at least one of `first_name`/`last_name` or `company`."
+ " Optional: `address_2`, `title`, `phone`, `province_code`, `address_type` (`private` or `business`)."
+ " Example: `{\"first_name\": \"John\", \"last_name\": \"Doe\", \"country_code\": \"DE\", \"country\": \"Germany\", \"city\": \"Berlin\", \"zip\": \"10115\", \"address_1\": \"Musterstra\\u00dfe 1\", \"address_type\": \"private\"}`",
},
billingAddress: {
type: "string",
label: "Billing Address",
Comment thread
michelle0927 marked this conversation as resolved.
description: "JSON object with the complete billing address."
+ " Required fields: `country_code` (ISO 2-letter, e.g. `\"DE\"`), `country` (full country name, e.g. `\"Germany\"`), `city`, `zip`, `address_1`,"
+ " and at least one of `first_name`/`last_name` or `company`."
+ " Optional: `address_2`, `title`, `phone`, `VAT_number`, `address_type` (`private` or `business`)."
+ " Example: `{\"first_name\": \"John\", \"last_name\": \"Doe\", \"country_code\": \"DE\", \"country\": \"Germany\", \"city\": \"Berlin\", \"zip\": \"10115\", \"address_1\": \"Musterstra\\u00dfe 1\", \"address_type\": \"private\"}`",
},
fulfillmentPriority: {
type: "integer",
label: "Fulfillment Priority",
description: "Priority level for the fulfillment. Must be between 1 (highest) and 99 (lowest).",
Comment thread
michelle0927 marked this conversation as resolved.
min: 1,
max: 99,
},
},
async run({ $ }) {
const fulfillmentItems = JSON.parse(this.fulfillmentItems);
const shippingAddress = JSON.parse(this.shippingAddress);
const billingAddress = JSON.parse(this.billingAddress);

const response = await this.everstox.createFulfillmentUpdateRequest({
$,
fulfillmentId: this.fulfillmentId,
data: {
fulfillment_items: fulfillmentItems,
shipping_address: shippingAddress,
billing_address: billingAddress,
fulfillment_priority: this.fulfillmentPriority,
},
});

$.export("$summary", `Successfully created fulfillment update request for fulfillment \`${this.fulfillmentId}\``);

return response;
},
};
95 changes: 95 additions & 0 deletions components/everstox/actions/list-products/list-products.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import everstox from "../../everstox.app.mjs";

export default {
key: "everstox-list-products",
name: "List Products",
description: "List products in an Everstox shop. [See the documentation](https://api.staging.everstox.com/api/v1/ui/#/Product/district_core.api.shops.products.products.Products.index)",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
everstox,
sku: {
type: "string",
label: "SKU",
description: "Filter products by SKU",
optional: true,
},
name: {
type: "string",
label: "Name",
description: "Filter products by name",
optional: true,
},
warehouseIds: {
propDefinition: [
everstox,
"warehouseIds",
],
optional: true,
},
createdDateGte: {
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
type: "string",
label: "Created Date Greater Than or Equal To",
description: "Filter products with a creation date greater than or equal to the provided date. Example: `2021-02-23`",
optional: true,
},
createdDateLte: {
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
type: "string",
label: "Created Date Less Than or Equal To",
description: "Filter products with a creation date less than or equal to the provided date. Example: `2021-02-23`",
optional: true,
},
updatedDateGte: {
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
type: "string",
label: "Updated Date Greater Than or Equal To",
description: "Filter products with an updated date greater than or equal to the provided date. Example: `2021-02-23`",
optional: true,
},
updatedDateLte: {
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
type: "string",
label: "Updated Date Less Than or Equal To",
description: "Filter products with an updated date less than or equal to the provided date. Example: `2021-02-23`",
optional: true,
},
limit: {
type: "integer",
label: "Limit",
description: "The number of products to return (default 10)",
optional: true,
},
offset: {
type: "integer",
label: "Offset",
description: "The number of products to skip before starting to collect the result set",
optional: true,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
},
async run({ $ }) {
const response = await this.everstox.listProducts({
$,
params: {
sku: this.sku,
name: this.name,
warehouse_ids: this.warehouseIds,
creation_date_gte: this.createdDateGte,
Comment thread
michelle0927 marked this conversation as resolved.
Outdated
creation_date_lte: this.createdDateLte,
updated_date_gte: this.updatedDateGte,
updated_date_lte: this.updatedDateLte,
limit: this.limit,
offset: this.offset,
},
});

const count = response.items?.length ?? 0;
$.export("$summary", `Successfully retrieved ${count} product${count === 1
? ""
: "s"}`);

return response;
},
};
15 changes: 15 additions & 0 deletions components/everstox/everstox.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,20 @@ export default {
...opts,
});
},
createFulfillmentUpdateRequest({
fulfillmentId, ...opts
}) {
return this._makeRequest({
method: "POST",
path: `/fulfillment/${fulfillmentId}/update-requests`,
...opts,
});
},
listProducts(opts = {}) {
return this._makeRequest({
path: "/products",
...opts,
});
},
},
};
2 changes: 1 addition & 1 deletion components/everstox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/everstox",
"version": "0.3.0",
"version": "0.4.0",
"description": "Pipedream Everstox Components",
"main": "everstox.app.mjs",
"keywords": [
Expand Down
Loading