Skip to main content
POST
/
api
/
external
/
v2
/
purchase_requests
/
imports
Import a purchase request
curl --request POST \
  --url https://app.pennylane.com/api/external/v2/purchase_requests/imports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "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": "EUR",
  "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",
      "unit": "piece",
      "vat_rate": "FR_200",
      "description": "<string>"
    }
  ]
}'
{
  "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"
  },
  "status": "to_be_validated",
  "currency": "EUR",
  "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"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
file_attachment_id
integer
required

File attachment id

Example:

42

reason
string
required

Reason of the purchase request

Example:

"I need a computer to be able to create purchase requests"

supplier_id
integer
required

Supplier identifier

Example:

42

purchase_order_number
string
required

Purchase order number

Example:

"PR20230001"

currency_amount_before_tax
string
required

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

Example:

"100.00"

currency_amount
string
required

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

Example:

"120.00"

currency_tax
string
required

Purchase request taxable amount (in purchase request currency)

Example:

"20.00"

delivery_address
object
required
purchase_request_lines
object[]
required
Minimum length: 1
estimated_delivery_date
string<date>

Estimated delivery date (ISO 8601)

Example:

"2023-08-30"

currency
enum<string>
default:EUR
Available options:
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,
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,
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,
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
amount
string

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

Example:

"120.00"

tax
string

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

Example:

"20.00"

Response

The imported Purchase Request

id
integer
required

Purchase request identifier

Example:

1

purchase_order_number
string | null
required

Purchase order number

Example:

"PR20230001"

supplier
object
required
delivery_address
object
required
status
enum<string>
required
Available options:
to_be_validated,
approved,
rejected,
invoiced
currency
enum<string>
default:EUR
required
Available options:
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,
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,
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,
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
reason
string
required

Reason of the request

Example:

"I need a computer to be able to create purchase requests"

estimated_delivery_date
string<date> | null
required

Estimated delivery date for the purchase request

Example:

"2023-12-31"

amount
string<string>
required
Example:

"1234.56"

currency_amount
string
required

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

Example:

"1234.56"

currency_amount_before_tax
string
required

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

Example:

"1200.23"

exchange_rate
string
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)

Example:

"1.0"

currency_tax
string
required

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

Example:

"34.33"

tax
string
required

Purchase request taxable amount (in purchase request currency)

Example:

"34.33"

purchase_order
object | null
required
linked_invoices
object
required
created_at
string<date-time>
required

The time the purchase request has been created

Example:

"2023-08-30T10:08:08.146343Z"

updated_at
string<date-time>
required

The last time the purchase request has been updated

Example:

"2023-08-30T10:08:08.146343Z"

I