marjory-logo

Pennylane

Table of Contents


Contexts

companyApiToken

Type Description isCrypt
string API key of your Pennylane account true

Actions

List Product(s)

List product(s)

Inputs

{
  "id": [ /*required if you want to retrieve a specific product*/
    "string",
  ]
  "page": 1, /*Products are paginated, this is the current page returned*/
  "extractInMarjoryFile": "boolean",
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "currentPage": "string",
    "products": [
        {
            "reference": "string",
            "createdAt": "string",
            "unit": "string",
            "vatRate": "string",
            "priceWithTax": "number",
            "substance": "string",
            "udpatedAt": "string",
            "description": "string",
            "priceWithoutTax": "number",
            "currency": "string",
            "label": "string",
            "id": "string"
        }
    ]
}
Http Code 500
{
    "message": "string"
}

Create Or Update Product

Create or update a product

Inputs

{
  "id": "0e67fc3c-c632-4feb-ad34-e18ed5fbf66a", /*required for an update, the source_id of the product*/
  "label": "Pack 1", /*Product label(required)*/
  "unit": "piece", /*The kind of unit which applies to the amount(required)*/
  "description": "This is the package", /*Product description*/
  "priceWithoutTax": 123, /*(required)*/
  "priceWithTax": 1234,
  "vatRate": "FR_200", /*A 20% VAT in France is FR_200(required)*/
  "currency": "EUR", /*Product currency (ISO 4217). Default is EUR.(required)*/
  "reference": "REF-453", /*Product reference*/
  "substance": "services | goods", /*Product substance. Can be services or goods*/
}

Outputs

Http Code 200
{
    "productId": "string"
}
Http Code 500
{
    "message": "string"
}

List Billing Subscription(s)

List billing subscription(s)

Inputs

{
  "id": [
    "string",
  ]
  "page": 1,
  "filter": [
    "string",
  ]
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "currentPage": "string",
    "billingSubscriptions": [
        {
            "emailSettings": "object",
            "activatedAt": "string",
            "start": "string",
            "mode": "string",
            "nextOccurence": "string",
            "stoppedAt": "string",
            "invoiceTemplates": {
                "amount": "string",
                "paymentCondition": "string",
                "currencyAmount": "string",
                "discount": "string",
                "language": "string",
                "label": "string",
                "currencyTax": "string",
                "lineItems": [
                    {
                        "unit": "string",
                        "amount": "string",
                        "quantity": "string",
                        "productId": "string",
                        "currencyPriceWithoutTax": "string",
                        "vatRate": "string",
                        "currencyAmount": "string",
                        "description": "string",
                        "id": "string",
                        "label": "string",
                        "currencyTax": "string"
                    }
                ],
                "specialMention": "string",
                "exchangeRate": "string",
                "currency": "string",
                "discountType": "string",
                "currencyAmountWithoutTax": "string",
                "updatedAt": "string"
            },
            "recurringRules": {
                "count": "number",
                "interval": "number",
                "until": "string",
                "type": "string",
                "dayOfMonth": "number",
                "ruleType": "string"
            },
            "paymentMethod": "string",
            "finish": "string",
            "id": "string",
            "prevOccurence": "string",
            "status": "string",
            "customer": "object"
        }
    ],
    "totalBillingSubscriptions": "number"
}
Http Code 500
{
    "message": "string"
}

Create Invoice

Create invoice

Inputs

{
  "date": "2020-01-01", /*(required)*/
  "deadline": "2020-01-01", /*Invoice payment deadline(required)*/
  "draft": true, /*Do you wish to create a draft invoice (otherwise it is a finalized invoice) ? Reminder, once created, a finalized invoice cannot be edited !(required)*/
  "pdfInvoiceFreeText": "string",
  "pdfInvoiceSubject": "string",
  "currency": "string", /*Invoice Currency (ISO 4217). Default is EUR.*/
  "specialMention": "string",
  "discount": "number", /*Invoice discount Amount (total discounted amount on the invoice. Set to 0.0 if the invoice does not have any discount. If the discount is relative, set as a percentage value between 0 and 1)*/
  "language": "fr_FR | en_GB", /*fr_FR or en_GB*/
  "transactionReference": { /*By adding this field you can automatically reconciliate the newly created (or imported) invoice with a transaction using transactions payment reference (Currently only stripe and invoice_number matching is supported)*/
    "bankingProvider": "string",
    "providerFieldName": "string",
    "providerFieldValue": "string",
  }
  "customer": { /*(required)*/
    "source_id": "string", /*(required)*/
  }
  "lineItemsSectionsAttributes": [
    {
      "title": "string",
      "description": "string",
      "rank": "integer", /*Defines the order in which sections will be displayed on the invoice. Each section has to have a different rank, starting from 1 and incrementing next values by 1*/
    }
  ]
  "lineItems": [ /*(required)*/
    {
      "label": "string", /*Line item label (default is using the product label)*/
      "quantity": "number", /*Line item quantity (number of items)(required)*/
      "sectionRank": "integer", /*Has to correspond to the rank number of a line items section in which the line item should be*/
      "planLineNumber": "string", /*The accounting plan item for the invoice line (default is using the product plan item)*/
      "product": { /*(required)*/
        "id": "string",
      }
    }
  ]
  "categories": [
    {
      "id": "string",
      "weight": 0.8, /*Category weight (0.8 means 80%)*/
      "amount": 180, /*You can use this property to specify the proportion of the tag in amount of currency instead of percentages. If the currency is EUR, 180 means 180 EUR.*/
      "label": "string",
      "direction": "Must be cash_in or cash_out", /*cash_in | cash_out*/
      "createdAt": "string",
      "updatedAt": "string",
    }
  ]
}

Outputs

Http Code 200
{
    "invoiceId": "string"
}
Http Code 500
{
    "message": "string"
}

Create Or Update Supplier

Create or update supplier

Inputs

{
  "id": "string", /*required for an update, the source_id of the supplier*/
  "companyName": "string", /*(required)*/
  "registrationNumber": "string", /*SIREN*/
  "recipient": "string", /*Recipient displayed in the invoice*/
  "billingAddress": {
    "street": "string",
    "postalCode": "string",
    "city": "string",
    "countryCode": "FR | EN | DE", /*Country alpha-2 code*/
  }
  "emails": [
    "string",
  ]
  "iban": "string",
  "vatNumber": "string",
  "paymentCondition": "string", /*upon_receipt | custom | 15_days | 30_days | 45_days | 60_days*/
  "phone": 33642424242, /*country code + phone number, +33642424242*/
  "reference": "string", /*This reference doesn't appear on the invoice*/
  "notes": "string", /*Notes about the supplier*/
}

Outputs

Http Code 200
{
    "supplierId": "string"
}
Http Code 500
{
    "message": "string"
}

List Customer(s)

List customer(s)

Inputs

{
  "id": [ /*required if you want to retrieve a specific customer*/
    "string",
  ]
  "page": 1, /*customers are paginated, this is the current page returned*/
  "extractInMarjoryFile": "boolean",
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "totalCustomers": "number",
    "customers": {
        "individual": [
            "object"
        ],
        "company": [
            "object"
        ]
    },
    "currentPage": "string"
}
Http Code 500
{
    "message": "string"
}

List Supplier(s)

List supplier(s)

Inputs

{
  "id": [ /*required if you want to retrieve a specific supplier*/
    "string",
  ]
  "page": 1, /*suppliers are paginated, this is the current page returned*/
  "extractInMarjoryFile": "boolean",
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "totalCustomers": "number",
    "currentPage": "string",
    "suppliers": [
        {
            "customerAddress": {
                "city": "string",
                "countryCode": "string",
                "postalCode": "string"
            },
            "supplierAddress": {
                "city": "string",
                "countryCode": "string",
                "postalCode": "string"
            },
            "note": "string",
            "paymentCondition": "string",
            "companyName": "string",
            "planItem": {
                "number": "string",
                "description": "string",
                "vaRate": "string",
                "label": "string",
                "enabled": "boolean",
                "countryCode": "string"
            },
            "emails": [
                "string"
            ],
            "reference": "string",
            "phone": "string",
            "registrationNumber": "string",
            "iban": "string",
            "recipient": "string",
            "id": "string",
            "updatedAt": "string",
            "vatNumber": "string"
        }
    ]
}
Http Code 500
{
    "message": "string"
}

Create Or Update Customer

Create or update customer

Inputs

{
  "company": {
    "id": "string", /*required for an update, the source_id of the customer*/
    "name": "string", /*(required)*/
    "registrationNumber": "string", /*SIREN*/
    "recipient": "string", /*Recipient displayed in the invoice*/
    "VATnumber": "string",
    "billingAddress": { /*(required)*/
      "street": "string", /*(required)*/
      "postalCode": "string", /*(required)*/
      "city": "string", /*(required)*/
      "countryCode": "FR", /*Country alpha code(required)*/
    }
    "emails": [
      "string",
    ]
    "iban": "string",
    "deliveryAddress": {
      "street": "string",
      "postalCode": "string",
      "city": "string",
      "countryCode": "FR", /*Country alpha code*/
    }
    "paymentCondition": "custom", /*upon_receipt | custom | 15_days | 30_days | 45_days | 60_days*/
    "phone": "string",
    "reference": "string",
    "notes": "string",
    "planItem": {
      "number": "string", /*required for an update*/
      "label": "string",
      "enabled": "string",
      "vatRate": "string",
      "description": "string",
      "countryCode": "FR", /*Country alpha code*/
    }
  }
  "individual": {
    "id": "string", /*required for an update*/
    "firstName": "string", /*(required)*/
    "lastName": "string", /*(required)*/
    "gender": "string", /*mister | madam*/
    "billingAddress": { /*(required)*/
      "street": "string", /*(required)*/
      "postalCode": "string", /*(required)*/
      "city": "string", /*(required)*/
      "countryCode": "FR", /*Country alpha code(required)*/
    }
    "emails": [
      "string",
    ]
    "iban": "string",
    "deliveryAddress": {
      "street": "string",
      "postalCode": "string",
      "city": "string",
      "countryCode": "FR", /*Country alpha code*/
    }
    "paymentCondition": "upon_receipt", /*upon_receipt | custom | 15_days | 30_days | 45_days | 60_days*/
    "phone": "string",
    "reference": "string",
    "notes": "string",
    "planItem": {
      "number": "string", /*required for an update*/
      "label": "string",
      "enabled": "string",
      "vatRate": "string",
      "description": "string",
      "countryCode": "FR", /*Country alpha code*/
    }
  }
}

Outputs

Http Code 200
{
    "companyId": "string",
    "individualId": "string"
}
Http Code 500
{
    "message": "string"
}

List Category(ies)

List category(ies)

Inputs

{
  "id": [ /*required if you want to retrieve a specific category*/
    "string",
  ]
  "page": 1, /*Categories are paginated, this is the current page returned*/
  "perPage": 30, /*Categories are paginated. By default, you get 20 by page. You can specify another number of categories by page.*/
  "sort": "string", /*Categories are sorted by descending id, by default. Use the attribute names separated by commas. Sortable attributes are the following only: id, group_id, label, direction*/
  "extractInMarjoryFile": "boolean",
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "totalCategories": "number",
    "categories": [
        {
            "createdAt": "string",
            "isEditable": "boolean",
            "groupId": "string",
            "groupLabel": "string",
            "id": "string",
            "label": "string",
            "direction": "string",
            "updatedAt": "string"
        }
    ],
    "currentPage": "string"
}
Http Code 500
{
    "message": "string"
}

Create Or Update Category

Create or update category

Inputs

{
  "id": "string", /*required for an update, the source_id of the categories*/
  "groupSourceId": "string", /*Group identifier (is unique)(required)*/
  "groupLabel": "string", /*Category group name(required)*/
  "label": "string", /*Category name (is unique per group of categories)(required)*/
  "direction": "Must be cash_in or cash_out", /*cash_in | cash_out*/
  "isEditable": "true | false",
}

Outputs

Http Code 200
{
    "categoryId": "string"
}
Http Code 500
{
    "message": "string"
}

Create Estimate

Create estimate

Inputs

{
  "date": "2023-12-21", /*The date format must "year-month-day", the separator is a "-"*/
  "deadline": "date",
  "pdfInvoiceFreeText": "string",
  "pdfInvoiceSubject": "string",
  "specialMention": "string",
  "customerId": "string",
  "lineItemsSectionsAttributes": [
    {
      "title": "string",
      "description": "string",
      "rank": "integer", /*Defines the order in which sections will be displayed on the invoice. Each section has to have a different rank, starting from 1 and incrementing next values by 1*/
    }
  ]
  "lineItems": [
    {
      "key": "string",
      "description": "string",
      "rank": "integer", /*Defines the order in which sections will be displayed on the invoice. Each section has to have a different rank, starting from 1 and incrementing next values by 1*/
    }
  ]
}

Outputs

Http Code 200
{
    "estimateId": "string"
}
Http Code 500
{
    "message": "string"
}

Update Invoice

Update invoice

Inputs

{
  "id": "string", /*(required)*/
  "transactionsReference": { /*(required)*/
    "bankingProvider": "string", /*(required)*/
    "providerFieldName": "string", /*(required)*/
    "providerFieldValue": "string", /*(required)*/
  }
  "lineItems": [ /*(required)*/
    {
      "label": "string",
      "quantity": 100, /*(required)*/
      "sectionRank": 10,
      "planItemNumber": 3,
      "product": { /*(required)*/
        "id": "string",
      }
    }
  ]
  "categories": [ /*(required)*/
    {
      "id": "string", /*(required)*/
      "weight": 45,
      "amount": 25,
    }
  ]
}

Outputs

Http Code 200
{
    "invoiceUpdated": "string"
}
Http Code 500
{
    "message": "string"
}

List Estimate(s)

List estimate(s)

Inputs

{
  "id": [
    "string",
  ]
  "page": 1,
  "filter": [
    "string",
  ]
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "currentPage": "string",
    "estimates": [
        {
            "amount": "string",
            "estimateNumber": "string",
            "pdfInvoiceFreeText": "string",
            "currencyAmount": "string",
            "discount": "string",
            "language": "string",
            "label": "string",
            "source": "string",
            "currencyTax": "string",
            "pdfInvoiceSubject": "string",
            "lineItems": [
                {
                    "unit": "string",
                    "amount": "string",
                    "quantity": "string",
                    "productId": "string",
                    "currencyPriceWithoutTax": "string",
                    "vatRate": "string",
                    "currencyAmount": "string",
                    "description": "string",
                    "id": "string",
                    "label": "string",
                    "currencyTax": "string"
                }
            ],
            "estimateType": "string",
            "exchangeRate": "string",
            "fileUrl": "string",
            "currency": "string",
            "discountType": "string",
            "id": "string",
            "issueDate": "string",
            "deadline": "string",
            "currencyAmountWithoutTax": "string",
            "updatedAt": "string",
            "customer": "object",
            "status": "string",
            "relatedInvoices": [
                {
                    "Amount": "string",
                    "currencyAmount": "string",
                    "paid": "boolean",
                    "currency": "string",
                    "id": "string",
                    "label": "string",
                    "quotegroupUuid": "string"
                }
            ]
        }
    ]
}
Http Code 500
{
    "message": "string"
}

List Invoice(s)

List invoice(s)

Inputs

{
  "id": "string", /*required if you want to retrieve a specific product, the other fields are not to fill if you want to retrieve a specific invoice*/
  "page": 1,
  "perPage": 10,
  "filter": [
    {
      "key": "string",
    }
  ]
  "extractInMarjoryFile": "boolean",
}

Outputs

Http Code 200
{
    "totalPages": "string",
    "currentPage": "string",
    "invoices": [
        {
            "date": "string",
            "fileName": "string",
            "isDraft": "boolean",
            "currencyAmount": "string",
            "quoteGroupUuid": "string",
            "discount": "string",
            "language": "string",
            "source": "string",
            "lineItems": [
                {
                    "unit": "string",
                    "amount": "string",
                    "quantity": "string",
                    "productId": "string",
                    "currencyPriceWithoutTax": "string",
                    "vatRate": "string",
                    "currencyAmount": "string",
                    "description": "string",
                    "id": "string",
                    "label": "string",
                    "currencyTax": "string"
                }
            ],
            "remainingAmount": "string",
            "specialMention": "string",
            "invoices": [
                {
                    "externalId": "string",
                    "transactionreference": {
                        "bankingProvider": "string",
                        "providerFieldName": "string",
                        "providerFieldValue": "string"
                    },
                    "matchedTransactions": [
                        {
                            "date": "string",
                            "amount": "string",
                            "currency": "string",
                            "label": "string",
                            "groupUuid": "string",
                            "fee": "string"
                        }
                    ],
                    "billingSubsciption": {
                        "id": "string"
                    },
                    "invoices": [
                        {
                            "pdfInvoiceFreeText": "string",
                            "pdfInvoiceSubject": "string"
                        }
                    ],
                    "payments": [
                        {
                            "currencyAmount": "string",
                            "createdAt": "string",
                            "label": "string"
                        }
                    ]
                }
            ],
            "isEstimate": "boolean",
            "exchangeRate": "number",
            "invoiceNumber": "string",
            "currency": "string",
            "discountType": "string",
            "fileUrl": "string",
            "id": "string",
            "categories": [
                {
                    "weigth": "string",
                    "createdAt": "string",
                    "id": "string",
                    "label": "string",
                    "direction": "string",
                    "updatedAt": "string"
                }
            ],
            "updatedAt": "string",
            "amount": "string",
            "fullyPaidAt": "string",
            "label": "string",
            "currencyTax": "string",
            "paid": "boolean",
            "currencyAmountWithoutTax": "string",
            "status": "string",
            "customer": "string"
        }
    ],
    "totalInvoices": "number"
}
Http Code 500
{
    "message": "string"
}

Update Estimate Status

Update estimate status

Inputs

{
  "id": "string", /*(required)*/
  "status": "string", /*(required)*/
}

Outputs

Http Code 200
{
    "estimateUpdated": "string"
}
Http Code 500
{
    "message": "string"
}

Create Or Update Billing Subscription

Create a subscription with a customer and an existing product. You need to create a product first.

Inputs

{
  "id": "string", /*required for an update*/
  "currency": "string", /*Invoice Currency (ISO 4217). Default is EUR*/
  "mode": "email", /*Mode in which the new invoices will be created. "awaiting_validation" means draft invoices will be created. "finalized" means finalized invoices will be created. "email" means finalized invoices will be created and automatically sent to the client at each new occurrence.(required)*/
  "start": "string", /*(required)*/
  "paymentConditions": "upon_receipt", /*"upon_receipt"|"15_days"|"30_days"|"45_days"|"60_days"(required)*/
  "paymentMethod": "offline", /*offline" means the subscription is not linked to a payment method. "gocardless_direct-debit" means at each new occurrence the client will be automatically debited thanks to GoCardless(required)*/
  "recurringRule": { /*Recurrence of the billing subscription(required)*/
    "type": "monthly", /* "monthly"|"weekly"|"yearly"(required)*/
    "dayOfMonth": 1,
    "dayOfWeek": 5,
    "dayOfYear": 4,
  }
  "specialMention": "string",
  "customer": { /*(required)*/
    "id": "string", /*(required)*/
  }
  "invoiceLines": [ /*(required)*/
    {
      "label": "string", /*default is using the product label*/
      "quantity": 3, /*number of items(required)*/
      "sectionRank": 2, /*Has to correspond to the rank number of a line items section in which the line item should be*/
      "planItemNumber": "string", /*The accounting plan item for the invoice line (default is using the product plan item)*/
      "product": { /*(required)*/
        "id": "string", /*(required)*/
      }
    }
  ]
  "stop": "boolean", /*only for an update To stop an in_progress billing subscription use value true. To resume a stopped billing subscription use value false*/
}

Outputs

Http Code 200
{
    "billingSubscriptionId": "string"
}
Http Code 500
{
    "message": "string"
}
Version(s)
1.5.4