Delivery Date

When the delivery date is unknown, the LI can be created with a start_at date. That date will serve as a base to calculate the delivery date. For instance, if a template with a workflow of 50 days is provided, then the delivery date will be set to start_at + 50 working days.

When both start_at and deliver_at are provided, the start_at is used to apply the template, and then the deliver_at is used for the actual Project Line delivery date.

When no dates are provided, then start_at will be set to the current date.

Product

The product to be used for the new Project Line must be put in the product key of the request params.

It’s possible to put a name, a source_id or a Winddle ID in the product field to identify the Product.

It’s also possible to nest the creation of a completely new Product by using the same format as the creation of a new Product in the Product service

Workflow

The workflow to use when creating the Project Line must be set in the template field.

All of the options related to applying workflows can be set in the key template_options.

Either the Winddle ID of the template or its name can be used.

Milestones

If a workflow has a been selected, it’s possible to set the dates for the milestones in that workflow with an array milestones in the key template_options.

The milestones are identified either by their name or combination of master_checkpoint_id and master_checkpoint_index. As a reminder, the master_checkpoint_index is the index of occurence of a master checkpoint in the template, 0 being the first occurence.

Note: if the template has multiple milestones with the same name, only the first date provided will be used for all the milestones. It’s necessary to use the combination of master_checkpoint_id and master_checkpoint_index in those cases.

The date for the milestone is set in the field due_date.

The confirmed_date of the milestone will always be updated with the provided new date, however, the initial_date will only be updated when the update_milestones has been set to true (which is its default value).

Below is an example to set the dates for two different milestones, using both of the available format:

template_options: {
  milestones: [
    {
      name: "MilestoneName",
      due_date: "2015-01-01"
    },
    {
      master_checkpoint_id: 574,
      master_checkpoint_index: 0,
      due_date: "2015-02-01"
    }, ...
  ], other options
}

Checkpoints

If a workflow has a been selected, it’s possible to overwrite (and fix, in the case of a flexible workflows) the duration of specific checkpoints, when the template is applied, with an array checkpoints in the key template_options.

The checkpoints are identified either by their name or combination of master_checkpoint_id and master_checkpoint_index. As a reminder, the master_checkpoint_index is the index of occurence of a master checkpoint in the template, 0 being the first occurence.

Note: if the template has multiple checkpoints with the same name, only the first duration provided will be used for all the checkpoints. It’s necessary to use the combination of master_checkpoint_id and master_checkpoint_index in those cases.

The duration in working days for the checkpoint is set in the field duration.

Below is an example to set the dates for two different checkpoints, using both of the available format:

template_options: {
  checkpoints: [
    {
      name: "CheckpointName",
      duration: 3
    },
    {
      master_checkpoint_id: 574,
      master_checkpoint_index: 0,
      duration: 4
    }, ...
  ], other options
}

Invitations

When creating a Project Line, it’s possible to automatically create a few invitations for external partners.

See the example below for the format to be used:

invites: {
  users: [
    {
      "id": "user1@winddle.com",
      "position": "PositionA"
    },
    {
      "id": "user2@winddle.com"
      "position": "PositionA"
    }
  ],
  "workgroups": ["WorkgroupA"]
}

This would invite 2 users (with PositionA) as well as all the users in the WorkgroupA (with the correct position).

Variants

The variants to be used in the Project Line can be set in the variants key, as an array of Variant identifiers (id, name, source_id) or as an array of attributes (can be mixed).

The attributes are used to create new variants and assign them to this Project line.

For instance, assuming a product with two existing variants: BLUE and RED. To assign the variant BLUE and a new variant called GREEN, the following can be sent in the variants key:

variants: [
  "BLUE",
  {
    name: "GREEN"
  }
]

It’s also possible to use the id in the attribute format to select the variant, for instance:

variants: [
  {
    id: "BLUE"
  }
]

Note that when using the attribute format, if no id has been specified, it’s assumed that a new variant must be created. If the id has been set, it will be used to identify the variant, all the other fields will be ignored (it will not be used to update the variant).

Price Quantity

When creating a Project Line, it’s possible to set the total_price and total_quantity by sending the following data:

"price_quantity": {
  "prices": <em>Total Price</em>,
  "quantities": <em>Total Quantity</em>
}

This follows the same format as the PriceQuantity service, please refer to it for more details on the format of complex prices/quantities.

Examples

Example of a Project Line creation, nesting the creation of a Product.

{
  "reference": "ProjectLine-001",
  "template": "ExampleWorkflow",
  "template_options": {
    "keep_duration": true,
    "keep_fixed": false
  },
  "deliver_at": "2015-01-01",
  "product": {
     "name": "NewProduct",
     "reference": "NewProduct-001"
  }
}

Params

Param name Description
project_id
required

Project id, name or source_id

Must be a String or an Integer
source_id
optional

ID in Customer’s source system (optional, max 255 char.)

Must be a String
reference
optional

internal reference - length must be 255 characters maximum and unique in the scope of the company

Must be a String
manufacturer
optional

length must be 255 characters maximum

Must be a String
packing_conditions
optional
Must be one of: mix, single.
deliver_at
optional

LI expected delivery date, format Y-m-d

Must be a String
customs
optional

Custom values for the Project Line

An array of Custom Values for the Product.

Each element of this array should have the following format:

{
 field: The Winddle ID or the Name of the Custom Field
 value: The value for this field
}

Not providing a value for a Field will leave it as blank or keep its current value if any has been set.

variants
optional

Array of Winddle variants (name or ID) - must be part of the used product’s variants

Must be an array of any type
template
optional

The workflow to apply on the Project Line when it’s created

A Winddle Workflow (Checkpoints+Roles) templates. Can be either an ID (unique integer) or the name of the template.
template_options
optional

Used to apply template

Must be a Hash
template_options[end_at]
optional

End date for the workflow, default to deliver_at, format Y-m-d

Must be a String
template_options[start_at]
optional

Start date for the workflow, format Y-m-d

Must be a String
template_options[keep_duration]
optional

Default to false - keep duration of existing CPs

Boolean (true/false)
template_options[keep_fixed]
optional

Default to false - keep starting date of fixed CPs

Boolean (true/false)
template_options[milestones]
optional

Milestones due date constraints

Must be an Array of nested elements
template_options[milestones][name]
optional

Name of the milestone

Must be a String
template_options[milestones][due_date]
required

Due date, format YYYY-MM-DD

Must be a String
template_options[milestones][master_checkpoint_index]
optional

Master checkpoint index in the template for the milestone’s reference checkpoint

Must be a Integer
template_options[milestones][master_checkpoint_id]
optional

Master checkpoint ID for the milestone’s reference checkpoint

Must be a Integer
template_options[checkpoints]
optional

Checkpoints duration constraints

Must be an Array of nested elements
template_options[checkpoints][name]
optional

Name of the checkpoint

Must be a String
template_options[checkpoints][duration]
required

Duration in working days

Must be a Integer
template_options[checkpoints][master_checkpoint_index]
optional

Master checkpoint index in the template

Must be a Integer
template_options[checkpoints][master_checkpoint_id]
optional

Master checkpoint ID

Must be a Integer
product
required
A Winddle Product. Can be either a product ID (unique integer) or a product Name (which must be unique within the company).
invites
optional
An object that describes invitations on a line item. To describe an invitation, you need a parameter to indentify a user (id or email) and a position (id or name). Hopefully, that's also the structure of a workgroup, so workgroups can also be used in invitations. Format: { workgroups: [, ...], users: [{ id: , position: }, ...] }
price_quantity
optional
See LineItem::PriceQuantity
locked
optional

True means no CP params can be updated (default to false)

Boolean (true/false)