v1

latestOpenAPI 3.0.12026-07-141671231.8 MB
Purchase Requests

Import a purchase order.

Import a purchase order. This will create a purchase request with an existing purchase order attached. The purchase request will be automatically validated.

ℹ️ This endpoint requires the following scope: purchase_requests:all

post/api/external/v2/purchase_requests/imports

Request body

file_attachment_idinteger required

File attachment id. This file attachment must contain the purchase order to import.

reasonstring required

Reason of the purchase request

estimated_delivery_datestring date

Estimated delivery date (ISO 8601)

supplier_idinteger required

Supplier identifier

purchase_order_numberstring required

Purchase order number

currency'EUR' | 'USD' | 'GBP' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'FJD' | 'FKP' | 'GEL' | 'GGP' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'IMP' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SLE' | 'SOS' | 'SRD' | 'STD' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VEF' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XDR' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWL'
currency_amount_before_taxstring required

Purchase request currency amount before tax (total value before tax of the purchase request in the currency of the purchase request)

currency_amountstring required

Purchase request currency amount (total value of the purchase request in the currency of the purchase request)

amountstring

Purchase request amount in euros (total value of the purchase request in euros). If the currency is euro, currency_amount and amount are identical.

currency_taxstring required

Purchase request taxable amount (in purchase request currency)

taxstring

Purchase request taxable amount (in euros). If the currency is euro, currency_tax and tax are identical.

Example request

{
  "file_attachment_id": 42,
  "reason": "I need a computer to be able to create purchase requests",
  "estimated_delivery_date": "2023-08-30",
  "supplier_id": 42,
  "purchase_order_number": "PR20230001",
  "currency_amount_before_tax": "100.00",
  "currency_amount": "120.00",
  "amount": "120.00",
  "currency_tax": "20.00",
  "tax": "20.00",
  "delivery_address": {
    "address": "8 rue de la paix",
    "postal_code": "75002",
    "city": "Paris",
    "country_alpha2": "FR"
  },
  "purchase_request_lines": [
    {
      "currency_amount": "120.00",
      "amount": "120.00",
      "currency_tax": "20.00",
      "tax": "20.00",
      "label": "Demo label",
      "quantity": 12,
      "unit_price": "8.34",
      "vat_rate": "FR_200"
    }
  ]
}

Response

The imported Purchase Request

idinteger required

Purchase request identifier

purchase_order_numberstring nullable required

Purchase order number

status'to_be_validated' | 'approved' | 'rejected' | 'invoiced' required
currency'EUR' | 'USD' | 'GBP' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'FJD' | 'FKP' | 'GEL' | 'GGP' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'IMP' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SLE' | 'SOS' | 'SRD' | 'STD' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VEF' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XDR' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWL' required
reasonstring required

Reason of the request

estimated_delivery_datestring date nullable required

Estimated delivery date for the purchase request

amountstring string required
currency_amountstring required

Purchase Request currency amount (total value of the purchase request in the currency of the purchase request)

currency_amount_before_taxstring required

Purchase Request currency amount before tax (total value before tax of the purchase request in the currency of the purchase request)

exchange_ratestring required

Purchase request exchange rate (used to convert the purchase request to euros. If the purchase request currency is euro it will be 1.0)

currency_taxstring required

Purchase request taxable amount (in euros. If the currency is euro, currency_amount and amount are identical)

taxstring required

Purchase request taxable amount (in purchase request currency)

created_atstring date-time required

The time the purchase request has been created

updated_atstring date-time required

The last time the purchase request has been updated

Example response

{
  "id": 1,
  "purchase_order_number": "PR20230001",
  "supplier": {
    "id": 2,
    "url": "https://app.pennylane.com/api/external/v2/suppliers/2"
  },
  "delivery_address": {
    "address": "8 rue de la paix",
    "postal_code": "75002",
    "city": "Paris",
    "country_alpha2": "FR"
  },
  "reason": "I need a computer to be able to create purchase requests",
  "estimated_delivery_date": "2023-12-31",
  "amount": "1234.56",
  "currency_amount": "1234.56",
  "currency_amount_before_tax": "1200.23",
  "exchange_rate": "1.0",
  "currency_tax": "34.33",
  "tax": "34.33",
  "purchase_order": {
    "filename": "Bon-de-commande_n°2025-1.pdf",
    "url": "https://www.pennylane.com/Bon-de-commande_n%C2%B02025-1.pdf"
  },
  "linked_invoices": {
    "items": [
      {
        "id": 42,
        "url": "https://app.pennylane.com/api/external/v2/supplier_invoices/42"
      }
    ]
  },
  "created_at": "2023-08-30T10:08:08.146343Z",
  "updated_at": "2023-08-30T10:08:08.146343Z"
}