API Reference

Order updates

Once an order has been created, you may want to make additional updates to the processing order ie. if a customer wants to reduce the ordered quantity or if they have paid for upgraded priority shipping.

Fulfil allows for seamlessly making such updates through the same Create an order API.

Adding a new line item to an order

In the order data payload, send the order channel_identifier along with the sale line objects to add. The sale lines must each have an associated unique channel_identifier.

[
    {
       
        "channel_identifier": "O-ID11",
        "sale_lines": [
            {
                "sku": "PROD-001",
                "description": "a test item",
                "quantity": 1,
                "unit_price": {
                    "decimal": "39.98",
                    "__class__": "Decimal"
                },
                "channel_identifier": "723"
            }
        ]
    }
]

Updating the sale line unit price

An existing sale line unit price can be updated by specifying the order channel_identifier along with the sale line channel_identifier to update:

🚧

If the sale line has already been invoiced. The request will result in an error, preventing the unit price from being updated.

[
  {
        "channel_identifier": "O-ID11",
        "sale_lines": [
            {
                "sku": "PROD-001",
                "unit_price": {
                    "decimal": "25.98",
                    "__class__": "Decimal"
                },
                "channel_identifier": "723"
            }
        ]
    }
]

Line reductions or cancellations

To reduce or cancel the sale line quantity, send the sale line channel_identifier along with the quantity_canceled value to reduce by.

For example, if the sale line below originally had 10 quantity ordered, and the customer canceled 5, the quantity_canceled would be 5 and the remaining quantity still to fulfil would then be lowered to 5.

For cancellations, send the entire quantity as the quantity_canceled value.

[
    {
        "channel_identifier": "O-ID11",
        "sale_lines": [
            {
                "sku": "PROD-001",
                "quantity": 5,
                "quantity_canceled": 5,
                "channel_identifier": "723",
                
            }
        ]
       
    }
]

Adding/updating a shipping line

If for example a customer has upgraded to priority shipping, you can adjust or create the shipping line on the order data. If updating, send the shipping line channel_identifier value which will be used to deduplicate the existing shipping line.

[
    {
        "channel_identifier": "O-ID11",
        "sale_lines": [],
         "shipping_lines": [
            {
                "carrier_service_code": "priority_three",
                "channel_identifier": "123456",
                "amount": "45.50"
            }
        ]
    }
]

Updating requested shipping service

For any open order, the requested shipping service can be updated. Sending the new requested_shipping_service code.

[
    {
        "channel_identifier": "O-ID11",
        "sale_lines": [],
        "requested_shipping_service": "two_day_shipping"
    }
]

🚧

Updating the requested shipping service will not update the carrier and carrier service on related shipments.

We recommend using an automation rule which uses the requested shipping service as a condition and sets the carrier and carrier service for such cases.