Make a payable

Request Information
URL POST {{basepath}}/api/:project/payable
CategoryPayable

Description

Makes a payable.

Requires as PayableCreateRequest in the body.

Returns a PayableCreateResponse

Url variables
:project{{project}}
Header
Content-Typeapplication/json
JSON
{
    "currency": "EUR",
    "initialValue": 140.33,
    "remainingValue": 140.33,
    "referenceId": "{{invoicenumber}}",
    "process": "monthly",
    "crmId": "crm-2024093002",
    "autoKickoff": true,
    "toEmail": [
        "user@example.com",
        "user2@example.com"
    ],
    "to": [
        "Test User",
        "Test User2"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "metaregistrar.com",
        "firstname": "John",
        "lastname": "de Tester",
        "invoiceid": "{{invoicenumber}}",
        "street": "Noothoven van Goorstraat",
        "housenumber": "11E",
        "postalcode": "2806RA",
        "city": "Gouda",
        "state": "Zuid holland",
        "country": "NL",
        "phone": "+31.000000001",
        "cellphone":"31612345678",
        "bankaccount": "555",
        "companyName": "",
        "paymentPeriod": 30,
        "dunningPeriod": 21,
        "periodStart": "2021-05-01",
        "periodEnd": "2021-05-31",
        "invoicesent": {{invoicecreatedate}},
        "paybydate": {{invoicepaybydate}},
        "dunningfinaldate": {{invoicedunningfinaldate}},
        "email": "user@example.com",
        "invoice_pdf": "http://ds.metaregistrar.work/pr/documents/invoices/1/test.pdf",
        "allowSepaDirectDebit": true,
        "supportPerson": false
    }
}

Example responses

Make a payable - without kicking it off
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 20.6,
    "remainingValue": 20.6,
    "referenceId": "{{invoicenumber}}",
    "process": "dd-dunning",
    "crmId": "crm-23",
    "autoKickoff": false,
    "toEmail": [
        "user@example.com"
    ],
    "to": [
        "Test User"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "mijndomein.nl",
        "firstname": "Test",
        "lastname": "User",
        "invoiceid": "{{invoicenumber}}",
        "street": "Zuidelijk Halfrond",
        "housenumber": "1",
        "postalcode": "2801DD",
        "city": "Gouda",
        "state": "Zuid holland",
        "country": "NL",
        "phone": "+31.000000001",
        "cellphone": "+31.000000001",
        "bankaccount": "555",
        "companyName": "",
        "email": "user@example.com",
        "invoice_pdf": "http:\/\/ds.metaregistrar.work\/pr\/documents\/invoices\/1\/MTR-000029998.pdf"
    }
}
Url variables
:project{{project}}
Response Code:
200 OK
Response Body:
{
    "responseId": "2_41b6dbbe5452bbae6dd9455bcff4b61337998942",
    "status": "new",
    "message": "Payable has been created",
    "identifier": "9_2_aaf88d59b96bfb5d330b7adfc16140603e0dadc81637851171",
    "payableId": "9_2_aaf88d59b96bfb5d330b7adfc16140603e0dadc81637851171"
}
Make a payable - with kicking off
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 20.6,
    "remainingValue": 20.6,
    "referenceId": "{{invoicenumber}}",
    "process": "dd-dunning",
    "crmId": "crm-23",
    "autoKickoff": true,
    "toEmail": [
        "user@example.com"
    ],
    "to": [
        "Test User"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "mijndomein.nl",
        "firstname": "Test",
        "lastname": "User",
        "invoiceid": "{{invoicenumber}}",
        "street": "Zuidelijk Halfrond",
        "housenumber": "1",
        "postalcode": "2801DD",
        "city": "Gouda",
        "state": "Zuid holland",
        "country": "NL",
        "phone": "+31.000000001",
        "cellphone": "+31.000000001",
        "bankaccount": "555",
        "companyName": "",
        "email": "user@example.com",
        "invoice_pdf": "http:\/\/ds.metaregistrar.work\/pr\/documents\/invoices\/1\/MTR-000029998.pdf"
    }
}
Url variables
:project{{project}}
Response Code:
200 OK
Response Body:
{
    "responseId": "2_2f834db410db02c0266513fb70697e5bfa5abd09",
    "status": "pending_kickoff",
    "message": "Payable has been created",
    "identifier": "10_2_c89f792a350d67b30af616a764896a7b1c9536901637851552",
    "payableId": "10_2_c89f792a350d67b30af616a764896a7b1c9536901637851552"
}
Make a payable - with all required parameters for a dunning process
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 13.37,
    "remainingValue": 13.37,
    "referenceId": "MD123456",
    "process": "monthly",
    "crmId": "crm-23",
    "autoKickoff": true,
    "toEmail": [
        "user@example.com"
    ],
    "to": [
        "Test User"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "metaregistrar.com",
        "firstname": "John",
        "lastname": "Thetester",
        "invoiceid": "MD123456",
        "iscompany": true,
        "companyName": "Metaregistrar BV",
        "street": "Noothoven van Goorstraat",
        "housenumber": "11e",
        "postalcode": "2806RA",
        "city": "Gouda",
        "state": "Zuid holland",
        "country": "NL",
        "phone": "+31.000000000",
        "cellphone": "+31.600000000",
        "bankaccount": "IBANGOESHERE",
        "paymentPeriod": 30,
        "dunningPeriod": 21,
        "periodStart": "2022-08-01",
        "periodEnd": "2022-08-31",
        "invoicesent": "2022-09-12",
        "paybydate": "2022-09-12",
        "dunningfinaldate": "",
        "email": "user@example.com",
        "invoiceLink": "https:\/\/link\/to\/invoice\/page\/in\/your\/interface",
        "supportPerson": false
    }
}
Url variables
:project{{project}}
Response Code:
200 OK
Response Body:
{
    "responseId": "2_2f834db410db02c0266513fb70697e5bfa5abd09",
    "status": "pending_kickoff",
    "message": "Payable has been created",
    "identifier": "10_2_c89f792a350d67b30af616a764896a7b1c9536901637851552",
    "payableId": "10_2_c89f792a350d67b30af616a764896a7b1c9536901637851552"
}
Error - Mismatching addressees
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 20.6,
    "remainingValue": 20.6,
    "referenceId": "{{invoicenumber}}",
    "process": "dd-dunning",
    "crmId": "crm-23",
    "autoKickoff": true,
    "toEmail": [
        "user@example.com"
    ],
    "to": [
        "Test User",
        "john2"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "mijndomein.nl",
        "firstname": "Test",
        "lastname": "User",
        "invoiceid": "{{invoicenumber}}",
        "street": "Zuidelijk Halfrond",
        "housenumber": "1",
        "postalcode": "2801DD",
        "city": "Gouda",
        "state": "Zuid holland",
        "country": "NL",
        "phone": "+31.000000001",
        "cellphone": "+31.000000001",
        "bankaccount": "555",
        "companyName": "",
        "email": "user@example.com",
        "invoice_pdf": "http:\/\/ds.metaregistrar.work\/pr\/documents\/invoices\/1\/MTR-000029998.pdf"
    }
}
Url variables
:project{{project}}
Response Code:
400 Bad Request
Response Body:
{
    "responseId": "2_71b12076b7504cb436104436ef3198ab47deb274",
    "status": "error",
    "errorCode": "invalid_input",
    "errorMessage": "the field to and toEmail do not match up",
    "validation": "email address count does not match up in field to\/toEmail"
}
Error - invalid e-mail
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 20.6,
    "remainingValue": 20.6,
    "referenceId": "{{invoicenumber}}",
    "process": "dd-dunning",
    "crmId": "crm-23",
    "autoKickoff": false,
    "toEmail": [
        "john"
    ],
    "to": [
        "Test User"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "mijndomein.nl",
        "firstname": "Test",
        "lastname": "User",
        "invoiceid": "{{invoicenumber}}",
        "street": "Zuidelijk Halfrond",
        "housenumber": "1",
        "postalcode": "2801DD",
        "city": "Gouda",
        "state": "Zuid holland",
        "country": "NL",
        "phone": "+31.000000001",
        "cellphone": "+31.000000001",
        "bankaccount": "555",
        "companyName": "",
        "email": "user@example.com",
        "invoice_pdf": "http:\/\/ds.metaregistrar.work\/pr\/documents\/invoices\/1\/MTR-000029998.pdf"
    }
}
Url variables
:project{{project}}
Response Code:
400 Bad Request
Response Body:
{
    "responseId": "2_65998b693b955580a07439357e2bbc7f4385dfbb",
    "status": "error",
    "errorCode": "invalid_input",
    "errorMessage": "You have supplied an invalid email address",
    "validation": "the email address \"john\" is not a valid e-mail address"
}
Error - creating a payable with missing fields
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 20.6,
    "remainingValue": 20.6,
    "referenceId": "{{invoicenumber}}",
    "process": "dd-dunning",
    "crmId": "crm-23",
    "autoKickoff": true,
    "toEmail": [
        "user@example.com"
    ],
    "to": [
        "Test User"
    ],
    "parameters": {
        "locale": "nl"
    }
}
Url variables
:project{{project}}
Response Code:
400 Bad Request
Response Body:
{
    "responseId": "2_f7e6c19fb86ddc632155b54e14711dc149f3583e",
    "status": "error",
    "errorCode": "invalid_input",
    "errorMessage": "invalid json input for process",
    "validation": "Parameter firstname must be filled with type string"
}
make a payable to pay into a balance
Request Method & URL
POST {{basepath}}/api/:project/payable
Request Body:
{
    "currency": "EUR",
    "initialValue": 140.33,
    "remainingValue": 140.33,
    "referenceId": "{{balanceaddref}}",
    "process": "payin",
    "crmId": "5",
    "autoKickoff": true,
    "toEmail": [
        "user@example.com"
    ],
    "to": [
        "Test User"
    ],
    "parameters": {
        "locale": "nl",
        "domain": "metaregistrar.com",
        "firstname": "John",
        "lastname": "de Tester",
        "description": "Potatopay:{{balanceaddref}}",
        "email": "user@example.com"
    }
}
Url variables
:project{{project}}
Response Code:
200 OK
Response Body:
{
    "responseId": "1_c1cceb2772ff0ca5e3daeab40dac6009763e30e0",
    "status": "pending_kickoff",
    "message": "Payable has been created",
    "identifier": "375_1_9a802cdcbb92e6247d0e89ff21ae587cf8d803abt18r7c",
    "payableId": "375_1_9a802cdcbb92e6247d0e89ff21ae587cf8d803abt18r7c"
}