Customers

Create a customer (company or individual)

Changed on

This endpoint creates a customer. The customer type is determined by the customer_type field.

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

post/api/external/v2/customers

Request

  • Base URL
    https://app.pennylane.com
  • URL
    https://app.pennylane.com/api/external/v2/customers
  • Auth
    OAuth 2
    Authorization code: https://app.pennylane.com/oauth/authorize
    Token URL: https://app.pennylane.com/oauth/oauth/token scopes: customers:all

Headers

X-Company-Idstring
Example:12345

Numeric ID of the company to act on. Required when authenticating with a firm token. Ignored when the token is already bound to a company.

Request body

OR

Example request

{
  "name": "My company",
  "vat_number": "FR12345678901",
  "reg_no": "123456789",
  "ledger_account": {
    "number": "411100344"
  },
  "phone": "+33612345678",
  "billing_address": {
    "address": "8 rue de la paix",
    "postal_code": "75002",
    "city": "Paris",
    "country_alpha2": "FR"
  },
  "delivery_address": {
    "address": "8 rue de la paix",
    "postal_code": "75002",
    "city": "Paris",
    "country_alpha2": "FR"
  },
  "billing_iban": "FR1420041010050500013M02606",
  "recipient": "John Doe",
  "reference": "REF-1234",
  "notes": "Some notes",
  "emails": [
    "hello@example.org"
  ],
  "external_reference": "0e67fc3c-c632-4feb-ad34-e18ed5fbf66a"
}

Response

Returns the created customer

OR

Example response

{
  "id": 42,
  "name": "My company",
  "billing_iban": "FR1420041010050500013M02606",
  "recipient": "John Doe",
  "phone": "+33612345678",
  "reference": "REF-1234",
  "notes": "Some notes",
  "vat_number": "FR12345678901",
  "reg_no": "123456789",
  "electronic_billing_address": "123456789_00012",
  "emails": [
    "hello@example.org"
  ],
  "created_at": "2023-08-30T10:08:08.146343Z",
  "updated_at": "2023-08-30T10:08:08.146343Z",
  "external_reference": "0e67fc3c-c632-4feb-ad34-e18ed5fbf66a",
  "mandates": {
    "url": "https://app.pennylane.com/api/external/v2/gocardless_mandates?filter=%5B%7B%5C\"field%5C\":%5C\"customer_id%5C\",%5C\"operator%5C\":%5C\"eq%5C\",%5C\"value%5C\":%5C\"42%5C\"%7D%5D"
  },
  "pro_account_mandates": {
    "url": "https://app.pennylane.com/api/external/v2/pro_account/mandates?filter=%5B%7B%22field%22%3A%22customer_id%22%2C%22operator%22%3A%22eq%22%2C%22value%22%3A%2242%22%7D%5D"
  },
  "contacts": {
    "url": "https://app.pennylane.com/api/external/v2/customers/42/contacts"
  }
}

Changes