Purchase orders

Purchase orders represent a set of jobs that are to be completed by a supplier.

The Purchase order object

Properties

  • idstring

    Unique identifier for the object.

  • applyVATReverseChargeboolean

    True if the reverse charge applies.

  • archiveboolean

    True if the entity is archived.

  • currencyobject

    The currency.
  • customStatusobject

    The custom status of the purchase order, if it has one. A custom status belongs to one of the statuses of the purchase order and is only available with a Plus, Premium or Team subscription.
  • documentobject

    The document configuration.
  • filenameFormatstring

    The filename format.

  • internalNotesarray

    The notes
  • isConflictingNumberboolean

    True if the number is conflicting.

  • issueDatedate

    The issue date.

  • labelsarray

    The labels.
  • linesarray

    The lines.
  • notesstring

    The notes linked to the entity.

  • numberstring

    The purchase order number.

  • paymentTermsnumber

    The payment terms.

  • paymentTermsEndOfMonthboolean

    True if the payment terms end of month.

  • pinnedboolean

    True if the entity is pinned.

  • rappenRoundingboolean

    True if the rounding is in rappen (CHF currency only).

  • sentDatedate

    The date the entity was sent.

  • sentDateStatusobject

    sentDateStatus
  • statusnumber

    The status of the purchase order. Valid values are: 1 (draft), 2 (sent), 3 (finished).

  • supplierobject

    The supplier
  • tax1object

    he first tax.
  • tax2object

    The second tax
  • termsstring

    The terms and conditions.

  • totalobject

    The total.
  • userobject

    The user that created the purchase order.
  • createdAtdate

    The date and time the entity was created.

  • updatedAtdate

    The date and time the entity was last updated.

purchase order object

{
  "id": "673afe8023b8c71a21e16b95",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T08:44:48.349Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1350e27164043ce9f2f",
        "name": "First job",
        "isFixedPrice": false,
        "outsourcing": "6718a1a20e27164043cea544",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        },
        "value": 1000
      },
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "dueDate": "2024-10-24T06:00:00.000Z",
      "unitCost": 0.09,
      "discount": 0,
      "lineTotal": 90,
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673afe8023b8c71a21e16bfc"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "status": 1,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T08:44:48.349Z",
  "updatedAt": "2024-11-18T08:44:48.400Z"
}


GET/v2/purchase-orders

List all purchase orders

This endpoint allows you to retrieve all the purchase orders.

Filters

All the filters are optional and can be combined. See Pagination for the rules shared by all the list endpoints (multiple values, dates, keywords).

  • idstring

    Comma-separated list of purchase order ids.

  • statusstring

    Comma-separated list of statuses. Each value is a status of the purchase order (1 (draft), 2 (sent), 3 (finished)) or the id of a custom status.

  • numberstring

    Only the purchase orders whose number contains this text (not case sensitive).

  • supplier.idstring

    Comma-separated list of supplier ids.

  • projectManager.idstring

    Comma-separated list of user ids. Only the purchase orders for the jobs of the clients managed by these users (project managers) are returned.

  • lines.job.idstring

    Comma-separated list of job ids. Only the purchase orders that have a line for one of these jobs are returned.

  • lines.job.outsourcingstring

    Comma-separated list of outsourced job ids. Only the purchase orders that have a line for one of these outsourced jobs are returned.

  • lines.job.clientIdstring

    Comma-separated list of client ids. Only the purchase orders that have a line for a job of one of these clients are returned.

  • labels.idstring

    Comma-separated list of label ids. The purchase orders that have at least one of these labels are returned (see labels.all).

  • labels.allboolean

    Set to true to return only the purchase orders that have all the labels of labels.id.

  • currencystring

    The currency code (ISO, e.g., EUR).

  • totalnumber

    Only the purchase orders with this exact total.

  • archiveboolean

    true to retrieve only the archived purchase orders, false to exclude them. If not provided, both are returned.

  • issueDateFromdate

    Only the purchase orders whose issue date is on or after this date (ISO 8601).

  • issueDateTodate

    Only the purchase orders whose issue date is before this date (ISO 8601).

Sorting

  • sortstring

    The field to sort by. One of: number, status, supplier.name, issueDate, total. The default is issueDate.

  • directionstring

    The sort direction: asc or desc. The default is desc.

Request

GET
/v2/purchase-orders
curl -G https://api.lsp.expert/v2/purchase-orders \
  -u {key}: 

Response

{
  "items": [{
    "id": "673afe8023b8c71a21e16b95",
    "applyVATReverseCharge": false,
    "archive": false,
    "currency": {
      "code": "EUR",
      "symbol": "€"
    },
    "document": {
      "id": "6718a0b50e27164043ce915a",
      "name": "English"
    },
    "filename": "002.pdf",
    "filenameFormat": "[number]",
    "internalNotes": [],
    "isConflictingNumber": false,
    "issueDate": "2024-11-18T08:44:48.349Z",
    "labels": [],
    "lines": [
      {
        "job": {
          "id": "6718a1350e27164043ce9f2f",
          "name": "First job",
          "isFixedPrice": false,
          "outsourcing": "6718a1a20e27164043cea544",
          "clientId": "6718a1350e27164043ce9e80"
        },
        "service": {
          "id": "6718a0f90e27164043ce95c0",
          "name": "Translation"
        },
        "extraCharge": {
          "type": "percentage",
          "percentage": 0,
          "amount": 0
        },
        "quantity": {
          "quantityType": {
            "id": "6718a0f90e27164043ce96a7",
            "name": "Words"
          },
          "value": 1000
        },
        "totalDetails": {
          "extraCharge": {
            "amount": 0,
            "discount": 0,
            "total": 0
          },
          "subtotal": {
            "amount": 90,
            "discount": 0,
            "total": 90
          },
          "total": 90
        },
        "dueDate": "2024-10-24T06:00:00.000Z",
        "unitCost": 0.09,
        "discount": 0,
        "lineTotal": 90,
        "notIncludeInTaxes": false,
        "matches": [],
        "id": "673afe8023b8c71a21e16bfc"
      }
    ],
    "number": "002",
    "object": "purchaseOrder",
    "paymentTerms": 30,
    "paymentTermsEndOfMonth": false,
    "pinned": false,
    "rappenRounding": false,
    "status": 1,
    "supplier": {
      "id": "6718a1a20e27164043cea4e8",
      "name": "Caroline Dupont",
      "address": {
        "name": "Caroline Dupont"
      }
    },
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "value": 0.21
    },
    "total": {
      "subtotal": 90,
      "subtotalTaxable": 90,
      "subtotalWithoutTaxes": 90,
      "tax1": {
        "id": "6718a0fd0e27164043ce97ae",
        "name": "VAT",
        "amount": 18.9,
        "value": 0.21
      },
      "tax2": null,
      "total": 108.9
    },
    "user": {
      "id": "6718a0b50e27164043ce9130",
      "name": "Degallaix Corp."
    },
    "createdAt": "2024-11-18T08:44:48.349Z",
    "updatedAt": "2024-11-18T08:44:48.400Z"
  },
  {...},
  {...}
],
  "pageSize": 20,
  "page": 1,
  "totalPages": 1,
  "totalItems": 2,
  "hasNextPage": false,
  "hasPreviousPage": false
}

POST/v2/purchase-orders

Create a purchase order

This endpoint allows you to add a new purchase order.

Parameters

  • currencystring Required

    The currency code (ISO, e.g., EUR).

  • supplierstring Required

    The supplier id.

Request

POST
/v2/purchase-orders
curl https://api.lsp.expert/v2/purchase-orders \
  -u {key}: \
  -d supplier="6718a1a20e27164043cea4e8" \
  -d currency="EUR"

Response

{
  "id": "673b026923b8c71a21e16e7b",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "003.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:01:29.569Z",
  "labels": [],
  "lines": [],
  "number": "003",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "status": 1,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 0,
    "subtotalTaxable": 0,
    "subtotalWithoutTaxes": 0,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 0,
      "value": 0.21
    },
    "tax2": null,
    "total": 0
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:01:29.569Z",
  "updatedAt": "2024-11-18T09:01:29.574Z"
}


POST/v2/purchase-orders/multi

Create a purchase order for jobs

This endpoint allows you to add a new purchase order and automatically add several lines for jobs.

Parameters

  • jobsarray

    The list of jobs ids.

Request

POST
/v2/purchase-orders/multi
curl https://api.lsp.expert/v2/purchase-orders/multi \
  -u {key}: \
  -d ids=["671f9ec7fca5590b10414931", "6718a1ea0e27164043ceb62d"] 

Response

[
  {
    "id": "673b032123b8c71a21e1796e",
    "applyVATReverseCharge": false,
    "archive": false,
    "currency": {
      "code": "EUR",
      "symbol": "€"
    },
    "document": {
      "id": "6718a0b50e27164043ce915a",
      "name": "English"
    },
    "filename": "001.pdf",
    "filenameFormat": "[number]",
    "internalNotes": [],
    "isConflictingNumber": false,
    "issueDate": "2024-11-18T09:04:33.617Z",
    "labels": [],
    "lines": [
      {
        "job": {
          "id": "671f9ec7fca5590b10414931",
          "name": "Brochure 2024",
          "isFixedPrice": false,
          "outsourcing": "6736fc03503cd0c91070bc5f",
          "clientId": "6718a1350e27164043ce9e80"
        },
        "dueDate": "2024-10-28T15:00:00.000Z",
        "startDate": null,
        "service": {
          "id": "6718a0f90e27164043ce95c0",
          "name": "Translation"
        },
        "languagePair": {
          "id": "672c70b62a89c7102545773f",
          "source": {
            "code": "de",
            "name": "German"
          },
          "target": {
            "code": "de",
            "name": "German"
          },
          "bidirectional": true
        },
        "unitCost": 0.09,
        "discount": 0,
        "extraCharge": {
          "type": "percentage",
          "percentage": 0,
          "amount": 0
        },
        "quantity": {
          "value": 2000,
          "quantityType": {
            "id": "6718a0f90e27164043ce96a7",
            "name": "Words"
          }
        },
        "lineTotal": 180,
        "totalDetails": {
          "extraCharge": {
            "amount": 0,
            "discount": 0,
            "total": 0
          },
          "subtotal": {
            "amount": 180,
            "discount": 0,
            "total": 180
          },
          "total": 180
        },
        "notIncludeInTaxes": false,
        "matches": [
          {
            "match": {
              "id": "671f9eaafca5590b1041459f",
              "name": "0%"
            },
            "unitCost": 0.09,
            "quantity": 1500,
            "lineTotal": 135,
            "id": "673b032123b8c71a21e17972"
          },
          {
            "match": {
              "id": "671f9ea7fca5590b10414546",
              "name": "100%"
            },
            "unitCost": 0.09,
            "quantity": 200,
            "lineTotal": 18,
            "id": "673b032123b8c71a21e17974"
          },
          {
            "match": {
              "id": "671f9eaefca5590b104145fa",
              "name": "Fuzzies"
            },
            "unitCost": 0.09,
            "quantity": 300,
            "lineTotal": 27,
            "id": "673b032123b8c71a21e17976"
          }
        ],
        "id": "673b032123b8c71a21e17971"
      },
      {
        "job": {
          "id": "6718a1ea0e27164043ceb62d",
          "name": "Third job",
          "isFixedPrice": false,
          "outsourcing": "6718a1ea0e27164043ceb6c5",
          "clientId": "6718a1350e27164043ce9e80"
        },
        "dueDate": "2024-10-25T08:00:00.000Z",
        "service": {
          "id": "6718a0f90e27164043ce95c0",
          "name": "Translation"
        },
        "unitCost": 0.09,
        "discount": 0,
        "extraCharge": {
          "type": "percentage",
          "percentage": 0,
          "amount": 0
        },
        "quantity": {
          "value": 1000,
          "quantityType": {
            "id": "6718a0f90e27164043ce96a7",
            "name": "Words"
          }
        },
        "lineTotal": 90,
        "totalDetails": {
          "extraCharge": {
            "amount": 0,
            "discount": 0,
            "total": 0
          },
          "subtotal": {
            "amount": 90,
            "discount": 0,
            "total": 90
          },
          "total": 90
        },
        "notIncludeInTaxes": false,
        "matches": [],
        "id": "673b032123b8c71a21e1797d"
      }
    ],
    "number": "001",
    "object": "purchaseOrder",
    "paymentTerms": 30,
    "paymentTermsEndOfMonth": false,
    "pinned": false,
    "rappenRounding": false,
    "status": 1,
    "supplier": {
      "id": "6718a1a20e27164043cea4e8",
      "name": "Caroline Dupont",
      "address": {
        "name": "Caroline Dupont"
      }
    },
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "value": 0.21
    },
    "total": {
      "subtotal": 270,
      "subtotalTaxable": 270,
      "subtotalWithoutTaxes": 270,
      "tax1": {
        "id": "6718a0fd0e27164043ce97ae",
        "name": "VAT",
        "amount": 56.7,
        "value": 0.21
      },
      "tax2": null,
      "total": 326.7
    },
    "user": {
      "id": "6718a0b50e27164043ce912e",
      "name": "Cédric Doe"
    },
    "createdAt": "2024-11-18T09:04:33.617Z",
    "updatedAt": "2024-11-18T09:04:33.631Z"
  }
]


GET/v2/purchase-orders/:id

Retrieve a purchase order

This endpoint allows you to retrieve a purchase order by providing their id.

Request

GET
/v2/purchase-orders/:id
curl https://api.lsp.expert/v2/purchase-orders/673afe8023b8c71a21e16b95 \
  -u {key}:

Response

{
  "id": "673afe8023b8c71a21e16b95",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T08:44:48.349Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1350e27164043ce9f2f",
        "name": "First job",
        "isFixedPrice": false,
        "outsourcing": "6718a1a20e27164043cea544",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        },
        "value": 1000
      },
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "dueDate": "2024-10-24T06:00:00.000Z",
      "unitCost": 0.09,
      "discount": 0,
      "lineTotal": 90,
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673afe8023b8c71a21e16bfc"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "status": 1,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T08:44:48.349Z",
  "updatedAt": "2024-11-18T08:44:48.400Z"
}


GET/v2/purchase-orders/generate

Retrieve a purchase order as PDF

This endpoint allows you to retrieve a PDF for one or multiple purchase orders.

Request

GET
/v2/purchase-orders/generate
curl https://api.lsp.expert/v2/purchase-orders/generate/ids=673afe8023b8c71a21e16b95 \
  -u {key}:

PUT/v2/purchase-orders/:id

Update a purchase order

This endpoint allows you to perform an update on a purchase order. Any parameters not provided will be left unchanged.

Parameters

  • applyVATReverseChargeboolean

    True if the reverse charge applies.

  • customStatusstring,null

    The id of a custom status, or null to remove the current one. Setting a custom status also sets the status of the purchase order to the status the custom status belongs to, and it takes precedence over status if both are provided. If the purchase order ends up in another status (for example because of an automatic rule), the custom status is removed. Custom statuses are only available with a Plus, Premium or Team subscription.

  • documentstring

    The document id.

  • filenameFormatstring

    The filename format.

  • issueDatestring

    The issue date.

  • notesstring,

    The notes linked to the entity.

  • numberstring

    The number of the entity.

  • pinnedboolean

    True if the entity is pinned.

  • rappenRoundingboolean

    True if the rounding is in rappen.

  • sentDatestring,

    The sent date.

  • statusnumber

    One of the following value: 1 (draft), 2 (sent), 3 (finished).

  • supplierAddressCitystring,

    The city of the supplier address.

  • supplierAddressCountrystring,

    The country of the supplier address.

  • supplierAddressLine1string,

    The first line of the supplier address.

  • supplierAddressLine2string,

    The second line of the supplier address.

  • supplierAddressNamestring,

    The name of the supplier address.

  • supplierAddressPostalCodestring,

    The postal code of the supplier address.

  • supplierAddressStatestring,

    The state of the supplier address.

  • supplierDetailsstring,

    Any details about the supplier.

  • supplierNationalIdentificationNumberstring,

    The national identification number of the supplier.

  • supplierVatNumberstring,

    The VAT number of the supplier.

  • tax1string,

    The first tax id.

  • tax2string,

    The second tax id.

  • termsstring,

    The terms of the entity.

Request

PUT
/v2/purchase-orders/:id
curl -X PUT https://api.lsp.expert/v2/purchase-orders/673afe8023b8c71a21e16b95 \
  -u {key}: \
  -d status=2

Response

{
  "id": "673afe8023b8c71a21e16b95",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1350e27164043ce9f2f",
        "name": "First job",
        "isFixedPrice": false,
        "outsourcing": "6718a1a20e27164043cea544",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        },
        "value": 1000
      },
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "dueDate": "2024-10-24T06:00:00.000Z",
      "unitCost": 0.09,
      "discount": 0,
      "lineTotal": 90,
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673b04d923b8c71a21e184e2"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:11:56.374Z"
}

PUT/v2/purchase-orders/:id/sync-client

Sync purchase order with client info

This endpoint allows you to sync the purchase order with the latest client info.

Parameters

Request

PUT
/v2/purchase-orders/:id/sync-client
curl -X PUT https://api.lsp.expert/v2/purchase-orders/673afe8023b8c71a21e16b95/sync-client \
  -u {key}: 

Response

{
  "id": "673afe8023b8c71a21e16b95",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1350e27164043ce9f2f",
        "name": "First job",
        "isFixedPrice": false,
        "outsourcing": "6718a1a20e27164043cea544",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        },
        "value": 1000
      },
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "dueDate": "2024-10-24T06:00:00.000Z",
      "unitCost": 0.09,
      "discount": 0,
      "lineTotal": 90,
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673b04d923b8c71a21e184e2"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:11:56.374Z"
}

DELETE/v2/purchase-orders/:id

Delete a purchase order

This endpoint allows you to delete a purchase order.

Request

DELETE
/v2/purchase-orders/:id
curl -X DELETE https://api.lsp.expert/v2/purchase-orders/673afe8023b8c71a21e16b95 \
  -u {key}:

POST/v2/purchase-orders/email

Send via email

This endpoint allows you to send a purchase order via email.

Parameters

  • ccContactsarray

    The list of contact ids to cc (if not provided, use the default cc contacts of the supplier).

  • contactsarray

    The list of contact ids to send the emails to (if not provided, use the default to contacts of the supplier).

  • contentstring

    The content of the email (if not provided, use the default content of the document configuration for the supplier).

  • documentSettingsstring

    The document id to use for the email (if not provided, use the default document of the supplier).

  • subjectstring

    The subject of the email (if not provided, use the default subject of the document configuration for the supplier).

  • tostring

    The email to send the email to (if not provided, use the default email of the supplier).

Request

POST
/v2/purchase-orders/:id
curl https://api.lsp.expert/v2/purchase-orders/673afe8023b8c71a21e16b95 \
  -u {key}: 

Response

{
  "id": "673afe8023b8c71a21e16b95",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1350e27164043ce9f2f",
        "name": "First job",
        "isFixedPrice": false,
        "outsourcing": "6718a1a20e27164043cea544",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        },
        "value": 1000
      },
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "dueDate": "2024-10-24T06:00:00.000Z",
      "unitCost": 0.09,
      "discount": 0,
      "lineTotal": 90,
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673b04d923b8c71a21e184e2"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:11:56.374Z"
}

POST/v2/purchase-orders/:id/lines/job

Add line for a job

This endpoint allows you to add a line on the purchase order for a job.

Parameters

  • jobIdstring Required

    The job id.

  • outsourcingIdstring Required

    The outsourcing id.

Request

POST
/v2/purchase-orders/:id/lines/job
curl https://api.lsp.expert/v2/purchase-orders/673b04d923b8c71a21e1847b/lines/job \
  -u {key}: \
  -d jobId="6718a1ea0e27164043ceb62d"
  -d outsourcingId="6718a1ea0e27164043ceb6c5"

Response

{
  "id": "673b04d923b8c71a21e1847b",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1ea0e27164043ceb62d",
        "name": "Third job",
        "isFixedPrice": false,
        "outsourcing": "6718a1ea0e27164043ceb6c5",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "dueDate": "2024-10-25T08:00:00.000Z",
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "unitCost": 0.09,
      "discount": 0,
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "value": 1000,
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        }
      },
      "lineTotal": 90,
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673b065923b8c71a21e18708"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:18:17.418Z"
}

PUT/v2/purchase-orders/:id/lines/:line-id/sync

Sync a purchase order line with the job

This endpoint allows you to sync a line with the related job (quantity, unit cost, etc.).

Parameters

Request

PUT
/v2/purchase-orders/:id/lines/:line-id/sync
curl -X PUT https://api.lsp.expert/v2/purchase-orders/673b04d923b8c71a21e1847b/lines/6718a1ea0e27164043ceb62d/sync \
  -u {key}: 

Response

{
  "id": "673b04d923b8c71a21e1847b",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1ea0e27164043ceb62d",
        "name": "Third job",
        "isFixedPrice": false,
        "outsourcing": "6718a1ea0e27164043ceb6c5",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "dueDate": "2024-10-25T08:00:00.000Z",
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "unitCost": 0.09,
      "discount": 0,
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "value": 1000,
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        }
      },
      "lineTotal": 90,
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673b065923b8c71a21e18708"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:18:17.418Z"
}

PUT/v2/purchase-orders/:id/lines/:line-id/move/:new-position

Move a purchase order line

This endpoint allows you to move a line to a new position.

Parameters

Request

PUT
/v2/purchase-orders/:id/lines/:line-id/move/:new-position
curl -X PUT https://api.lsp.expert/v2/purchase-orders/673b04d923b8c71a21e1847b/lines/673b065923b8c71a21e18708/move/1 \
  -u {key}: 

Response

  {
  "id": "673b04d923b8c71a21e1847b",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [
    {
      "job": {
        "id": "6718a1ea0e27164043ceb62d",
        "name": "Third job",
        "isFixedPrice": false,
        "outsourcing": "6718a1ea0e27164043ceb6c5",
        "clientId": "6718a1350e27164043ce9e80"
      },
      "dueDate": "2024-10-25T08:00:00.000Z",
      "service": {
        "id": "6718a0f90e27164043ce95c0",
        "name": "Translation"
      },
      "unitCost": 0.09,
      "discount": 0,
      "extraCharge": {
        "type": "percentage",
        "percentage": 0,
        "amount": 0
      },
      "quantity": {
        "value": 1000,
        "quantityType": {
          "id": "6718a0f90e27164043ce96a7",
          "name": "Words"
        }
      },
      "lineTotal": 90,
      "totalDetails": {
        "extraCharge": {
          "amount": 0,
          "discount": 0,
          "total": 0
        },
        "subtotal": {
          "amount": 90,
          "discount": 0,
          "total": 90
        },
        "total": 90
      },
      "notIncludeInTaxes": false,
      "matches": [],
      "id": "673b065923b8c71a21e18708"
    }
  ],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 90,
    "subtotalTaxable": 90,
    "subtotalWithoutTaxes": 90,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 18.9,
      "value": 0.21
    },
    "tax2": null,
    "total": 108.9
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:18:17.418Z"
}

DELETE/v2/purchase-orders/:id/lines/:line-id

Delete a purchase order line

This endpoint allows you to delete a purchase order line.

Request

DELETE
/v2/purchase-orders/:id/lines/:line-id
curl -X DELETE https://api.lsp.expert/v2/purchase-orders/673b04d923b8c71a21e1847b/lines/673b065923b8c71a21e18708 \
  -u {key}:

Response

{
  "id": "673b04d923b8c71a21e1847b",
  "applyVATReverseCharge": false,
  "archive": false,
  "currency": {
    "code": "EUR",
    "symbol": "€"
  },
  "document": {
    "id": "6718a0b50e27164043ce915a",
    "name": "English"
  },
  "filename": "002.pdf",
  "filenameFormat": "[number]",
  "internalNotes": [],
  "isConflictingNumber": false,
  "issueDate": "2024-11-18T09:11:53.150Z",
  "labels": [],
  "lines": [],
  "number": "002",
  "object": "purchaseOrder",
  "paymentTerms": 30,
  "paymentTermsEndOfMonth": false,
  "pinned": false,
  "rappenRounding": false,
  "sentDate": "2024-11-18T09:11:56.368Z",
  "status": 2,
  "supplier": {
    "id": "6718a1a20e27164043cea4e8",
    "name": "Caroline Dupont",
    "address": {
      "name": "Caroline Dupont"
    }
  },
  "tax1": {
    "id": "6718a0fd0e27164043ce97ae",
    "name": "VAT",
    "value": 0.21
  },
  "total": {
    "subtotal": 0,
    "subtotalTaxable": 0,
    "subtotalWithoutTaxes": 0,
    "tax1": {
      "id": "6718a0fd0e27164043ce97ae",
      "name": "VAT",
      "amount": 0,
      "value": 0.21
    },
    "tax2": null,
    "total": 0
  },
  "user": {
    "id": "6718a0b50e27164043ce9130",
    "name": "Degallaix Corp."
  },
  "createdAt": "2024-11-18T09:11:53.150Z",
  "updatedAt": "2024-11-18T09:22:09.322Z"
}