JouloDocs

Create a concept account

Creates a concept account for one connection: the signatory, the address and the EAN. The account has no machtiging yet, so it does not count. The call is idempotent on cpo_external_ref: a repeat returns the existing account, stores a new iban if you send one, and ignores the rest of the body.

POST
/v1/accounts
AuthorizationBearer <token>

OAuth 2.0 client credentials for a CPO client bound to one partner. Request a token with grant_type client_credentials and send client_id and client_secret in the body, as JSON or form data. The token endpoint does not accept HTTP Basic client authentication. The token lasts one hour and has no refresh token. Omit scope to get every scope your client holds. The /v1 routes refuse user tokens and personal API tokens.

In: header

Scope: cpo:accounts:write

type?CpoAccountType

Account type: a private household, a business, or a homeowners' association (VvE).

Default"particulier"
Value in"particulier" | "zakelijk" | "vve"
display_name?string

Display name of the account. Trimmed to 120 characters.

cpo_external_ref?string

Your own customer number. It is the idempotency key: a repeat with the same value returns the existing account. Trimmed to 120 characters.

payout_handler?CpoPayoutHandler

joulo_pays_customer: Joulo pays the customer. via_cpo_invoicing: the payout settles through the CPO.

Default"joulo_pays_customer"
Value in"joulo_pays_customer" | "via_cpo_invoicing"
iban?null | string

IBAN of the customer. The server removes whitespace and converts it to upper case, then requires 15 to 34 letters and digits. There is no checksum test. Every account needs an IBAN to become ERE-eligible, whatever the payout_handler. Omit it, or send null or an empty string, to add it later with a repeat.

personCpoPerson

The natural person who signs the machtiging.

connectionCpoConnectionInput

The connection and its address. Joulo checks the EAN against the address.

Response Body

curl -X POST "https://api.joulo.nl/functions/v1/api/v1/accounts" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "particulier",
    "display_name": "Jan de Vries",
    "cpo_external_ref": "CUST-100482",
    "payout_handler": "joulo_pays_customer",
    "iban": "NL91ABNA0417164300",
    "person": {
      "full_name": "Jan de Vries",
      "email": "[email protected]",
      "phone": "+31612345678"
    },
    "connection": {
      "ean_code": "871685920000123456",
      "street": "Dorpsstraat",
      "house_number": "1",
      "postal_code": "6971AB",
      "city": "Brummen"
    }
  }'
{
  "ok": true,
  "idempotent": true,
  "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
  "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
  "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
  "ean_validation_status": "matched",
  "iban_stored": true,
  "mandate_status": "pending",
  "account": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "particulier",
    "display_name": null,
    "payout_handler": "joulo_pays_customer",
    "cpo_external_ref": null,
    "created_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "invalid_json",
  "detail": "string"
}
{
  "error": "Missing or invalid API token"
}
{
  "error": "Insufficient scope",
  "detail": "string",
  "required_scope": "string"
}
{
  "error": "ean_in_use",
  "detail": "string"
}
{
  "error": "ean_address_mismatch",
  "detail": "string"
}
{
  "error": "Too many requests",
  "retry_after_seconds": 0
}
{
  "error": "account_create_failed",
  "detail": "string"
}
{
  "error": "string"
}