- API-Referenz
- Vertrag
- Update InvoiceSettings of a Customer
Update InvoiceSettings of a Customer
Request
- customerIdstringrequired
- additionalEmailRecipientsArray von string (email)
- Array[
- *string (email)
]
- invoicePeriodinteger (≥ 0)required
- paymentSettingseine von 2 Alternativenrequired
- Alternativeobject
- accountHolderstringrequired
- bicstring
Optional. Required for payments outside of the European Union.
- ibanstringrequired
- method"debit"required
- Alternativeobject
- method"invoice"required
- printedInvoicesboolean
- recipientobject
- addressobjectrequired
- streetstringrequired
- houseNumberstringrequired
- citystringrequired
- zipstringrequired
- countryCodestringrequired
ISO 3166-1 alpha-2 country code
- addressPrefixstring
- companystring
- emailAddressstring (email)
- firstNamestring
- lastNamestring
- leitwegIdstring (≤ 46 Zeichen)
German electronic invoicing routing ID (XRechnung). Only allowed for public authorities and requires a company.
- phoneNumbersArray von string
- Array[
- *string
]
- purchaseOrderReferencestring (≤ 200 Zeichen)
Purchase order reference printed on the invoice. Not allowed together with a leitwegId.
- salutationstring (einer von: mr, ms, other)required
- titlestring
- useFormalTermboolean
- recipientSameAsOwnerboolean
- targetDayinteger (≥ 0)deprecated
parameter is deprecated and will be ignored
Content-Type: application/json
{
"additionalEmailRecipients": [
"hallo@test.de"
],
"invoicePeriod": 1,
"paymentSettings": {
"accountHolder": "Ada Lovelace",
"bic": "DEUTDEDB123",
"iban": "DE12345678901234567890",
"method": "debit"
},
"printedInvoices": true,
"recipient": {
"address": {
"street": "Königsberger Straße",
"houseNumber": "4-6",
"city": "Espelkamp",
"zip": "32339",
"countryCode": "DE",
"addressPrefix": "c/o Ada Lovelace"
},
"company": "Mittwald CM Service GmbH & Co. KG",
"emailAddress": "email@mittwald.example",
"firstName": "Ada",
"lastName": "Lovelace",
"leitwegId": "string",
"phoneNumbers": [
"+49 123 4567890"
],
"purchaseOrderReference": "string",
"salutation": "mr",
"title": "Dr.",
"useFormalTerm": true
},
"recipientSameAsOwner": true
}
{
"properties": {
"additionalEmailRecipients": {
"example": [
"hallo@test.de"
],
"items": {
"format": "email",
"type": "string"
},
"type": "array"
},
"invoicePeriod": {
"example": 1,
"minimum": 0,
"type": "integer"
},
"paymentSettings": {
"oneOf": [
{
"properties": {
"accountHolder": {
"example": "Ada Lovelace",
"type": "string"
},
"bic": {
"description": "Optional. Required for payments outside of the European Union.",
"example": "DEUTDEDB123",
"type": "string"
},
"iban": {
"example": "DE12345678901234567890",
"type": "string"
},
"method": {
"enum": [
"debit"
],
"type": "string"
}
},
"required": [
"method",
"iban",
"accountHolder"
],
"type": "object"
},
{
"properties": {
"method": {
"enum": [
"invoice"
],
"type": "string"
}
},
"required": [
"method"
],
"type": "object"
}
]
},
"printedInvoices": {
"type": "boolean"
},
"recipient": {
"properties": {
"address": {
"type": "object",
"properties": {
"street": {
"type": "string",
"example": "Königsberger Straße"
},
"houseNumber": {
"type": "string",
"example": "4-6"
},
"city": {
"type": "string",
"example": "Espelkamp"
},
"zip": {
"type": "string",
"example": "32339"
},
"countryCode": {
"type": "string",
"example": "DE",
"description": "ISO 3166-1 alpha-2 country code"
},
"addressPrefix": {
"type": "string",
"example": "c/o Ada Lovelace"
}
},
"required": [
"street",
"houseNumber",
"city",
"zip",
"countryCode"
]
},
"company": {
"example": "Mittwald CM Service GmbH & Co. KG",
"type": "string"
},
"emailAddress": {
"format": "email",
"type": "string"
},
"firstName": {
"example": "Ada",
"type": "string"
},
"lastName": {
"example": "Lovelace",
"type": "string"
},
"leitwegId": {
"description": "German electronic invoicing routing ID (XRechnung). Only allowed for public authorities and requires a company.",
"maxLength": 46,
"type": "string"
},
"phoneNumbers": {
"items": {
"example": "+49 123 4567890",
"type": "string"
},
"type": "array"
},
"purchaseOrderReference": {
"description": "Purchase order reference printed on the invoice. Not allowed together with a leitwegId.",
"maxLength": 200,
"type": "string"
},
"salutation": {
"type": "string",
"enum": [
"mr",
"ms",
"other"
]
},
"title": {
"example": "Dr.",
"type": "string"
},
"useFormalTerm": {
"type": "boolean"
}
},
"required": [
"address",
"salutation"
],
"type": "object"
},
"recipientSameAsOwner": {
"type": "boolean"
},
"targetDay": {
"deprecated": true,
"description": "parameter is deprecated and will be ignored",
"example": 15,
"maximum": 28,
"minimum": 0,
"type": "integer"
}
},
"required": [
"invoicePeriod",
"paymentSettings"
],
"type": "object"
}
Responses
- additionalEmailRecipientsArray von string (email)
- Array[
- *string (email)
]
- debitPaymentStopUntilstring (date-time)
- idstringrequired
- invoicePeriodinteger
- lastBankingInformationobject
- accountHolderstringrequired
- bicstring
- ibanstringrequired
- paymentSettingseine von 2 Alternativen
- Alternativeobject
- accountHolderstringrequired
- bicstring
Optional. Required for payments outside of the European Union.
- ibanstringrequired
- method"debit"required
- Alternativeobject
- method"invoice"required
- printedInvoicesboolean
- recipientobject
- addressobjectrequired
- streetstringrequired
- houseNumberstringrequired
- citystringrequired
- zipstringrequired
- countryCodestringrequired
ISO 3166-1 alpha-2 country code
- addressPrefixstring
- companystring
- emailAddressstring (email)
- firstNamestring
- lastNamestring
- leitwegIdstring (≤ 46 Zeichen)
German electronic invoicing routing ID (XRechnung). Only allowed for public authorities and requires a company.
- phoneNumbersArray von string
- Array[
- *string
]
- purchaseOrderReferencestring (≤ 200 Zeichen)
Purchase order reference printed on the invoice. Not allowed together with a leitwegId.
- salutationstring (einer von: mr, ms, other)required
- titlestring
- useFormalTermboolean
- recipientSameAsOwnerboolean
- statusArray von object
- Array[
- *object
- messagestringrequired
- severitystring (einer von: success, info, warning, error)required
- typestring (einer von: returnDebitNote, returnDebitNoteWaitingForPayment, debtWrittenOff, bankrupt, notReachable)required
]
- targetDayinteger
Content-Type: application/json
{
"additionalEmailRecipients": [
"email@mittwald.example"
],
"debitPaymentStopUntil": "1985-10-26T01:21:00.000Z",
"id": "5f9b9b9b-9b9b-9b9b-9b9b-9b9b9b9b9b9b",
"invoicePeriod": 1,
"lastBankingInformation": {
"accountHolder": "Ada Lovelace",
"bic": "DEUTDEDB123",
"iban": "DE12345678901234567890"
},
"paymentSettings": {
"accountHolder": "Ada Lovelace",
"bic": "DEUTDEDB123",
"iban": "DE12345678901234567890",
"method": "debit"
},
"printedInvoices": true,
"recipient": {
"address": {
"street": "Königsberger Straße",
"houseNumber": "4-6",
"city": "Espelkamp",
"zip": "32339",
"countryCode": "DE",
"addressPrefix": "c/o Ada Lovelace"
},
"company": "Mittwald CM Service GmbH & Co. KG",
"emailAddress": "email@mittwald.example",
"firstName": "Ada",
"lastName": "Lovelace",
"leitwegId": "string",
"phoneNumbers": [
"+49 123 4567890"
],
"purchaseOrderReference": "string",
"salutation": "mr",
"title": "Dr.",
"useFormalTerm": true
},
"recipientSameAsOwner": true,
"status": [
{
"message": "Unfortunately, we were unable to debit your account. Please update your account details.",
"severity": "success",
"type": "returnDebitNote"
}
],
"targetDay": 15
}
{
"properties": {
"additionalEmailRecipients": {
"items": {
"format": "email",
"type": "string"
},
"type": "array"
},
"debitPaymentStopUntil": {
"format": "date-time",
"type": "string"
},
"id": {
"example": "5f9b9b9b-9b9b-9b9b-9b9b-9b9b9b9b9b9b",
"type": "string"
},
"invoicePeriod": {
"example": 1,
"type": "integer"
},
"lastBankingInformation": {
"properties": {
"accountHolder": {
"example": "Ada Lovelace",
"type": "string"
},
"bic": {
"example": "DEUTDEDB123",
"type": "string"
},
"iban": {
"example": "DE12345678901234567890",
"type": "string"
}
},
"required": [
"iban",
"accountHolder"
],
"type": "object"
},
"paymentSettings": {
"oneOf": [
{
"properties": {
"accountHolder": {
"example": "Ada Lovelace",
"type": "string"
},
"bic": {
"description": "Optional. Required for payments outside of the European Union.",
"example": "DEUTDEDB123",
"type": "string"
},
"iban": {
"example": "DE12345678901234567890",
"type": "string"
},
"method": {
"enum": [
"debit"
],
"type": "string"
}
},
"required": [
"method",
"iban",
"accountHolder"
],
"type": "object"
},
{
"properties": {
"method": {
"enum": [
"invoice"
],
"type": "string"
}
},
"required": [
"method"
],
"type": "object"
}
]
},
"printedInvoices": {
"type": "boolean"
},
"recipient": {
"properties": {
"address": {
"type": "object",
"properties": {
"street": {
"type": "string",
"example": "Königsberger Straße"
},
"houseNumber": {
"type": "string",
"example": "4-6"
},
"city": {
"type": "string",
"example": "Espelkamp"
},
"zip": {
"type": "string",
"example": "32339"
},
"countryCode": {
"type": "string",
"example": "DE",
"description": "ISO 3166-1 alpha-2 country code"
},
"addressPrefix": {
"type": "string",
"example": "c/o Ada Lovelace"
}
},
"required": [
"street",
"houseNumber",
"city",
"zip",
"countryCode"
]
},
"company": {
"example": "Mittwald CM Service GmbH & Co. KG",
"type": "string"
},
"emailAddress": {
"format": "email",
"type": "string"
},
"firstName": {
"example": "Ada",
"type": "string"
},
"lastName": {
"example": "Lovelace",
"type": "string"
},
"leitwegId": {
"description": "German electronic invoicing routing ID (XRechnung). Only allowed for public authorities and requires a company.",
"maxLength": 46,
"type": "string"
},
"phoneNumbers": {
"items": {
"example": "+49 123 4567890",
"type": "string"
},
"type": "array"
},
"purchaseOrderReference": {
"description": "Purchase order reference printed on the invoice. Not allowed together with a leitwegId.",
"maxLength": 200,
"type": "string"
},
"salutation": {
"type": "string",
"enum": [
"mr",
"ms",
"other"
]
},
"title": {
"example": "Dr.",
"type": "string"
},
"useFormalTerm": {
"type": "boolean"
}
},
"required": [
"address",
"salutation"
],
"type": "object"
},
"recipientSameAsOwner": {
"type": "boolean"
},
"status": {
"items": {
"properties": {
"message": {
"example": "Unfortunately, we were unable to debit your account. Please update your account details.",
"type": "string"
},
"severity": {
"enum": [
"success",
"info",
"warning",
"error"
],
"type": "string"
},
"type": {
"enum": [
"returnDebitNote",
"returnDebitNoteWaitingForPayment",
"debtWrittenOff",
"bankrupt",
"notReachable"
],
"type": "string"
}
},
"required": [
"severity",
"type",
"message"
],
"type": "object"
},
"type": "array"
},
"targetDay": {
"example": 15,
"type": "integer"
}
},
"required": [
"id"
],
"type": "object"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
The requested resource was not found
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-X PUT \
-d '{"additionalEmailRecipients":["hallo@test.de"],"invoicePeriod":1,"paymentSettings":{"accountHolder":"Ada Lovelace","bic":"DEUTDEDB123","iban":"DE12345678901234567890","method":"debit"},"printedInvoices":true,"recipient":{"address":{"street":"Königsberger Straße","houseNumber":"4-6","city":"Espelkamp","zip":"32339","countryCode":"DE","addressPrefix":"c/o Ada Lovelace"},"company":"Mittwald CM Service GmbH & Co. KG","emailAddress":"email@mittwald.example","firstName":"Ada","lastName":"Lovelace","leitwegId":"string","phoneNumbers":["+49 123 4567890"],"purchaseOrderReference":"string","salutation":"mr","title":"Dr.","useFormalTerm":true},"recipientSameAsOwner":true}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/customers/string/invoice-settings
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.contract.invoiceUpdateInvoiceSettings({
"customerId": "string",
"data": {
"additionalEmailRecipients": [
"hallo@test.de"
],
"invoicePeriod": 1,
"paymentSettings": {
"accountHolder": "Ada Lovelace",
"bic": "DEUTDEDB123",
"iban": "DE12345678901234567890",
"method": "debit"
},
"printedInvoices": true,
"recipient": {
"address": {
"street": "Königsberger Straße",
"houseNumber": "4-6",
"city": "Espelkamp",
"zip": "32339",
"countryCode": "DE",
"addressPrefix": "c/o Ada Lovelace"
},
"company": "Mittwald CM Service GmbH & Co. KG",
"emailAddress": "email@mittwald.example",
"firstName": "Ada",
"lastName": "Lovelace",
"leitwegId": "string",
"phoneNumbers": [
"+49 123 4567890"
],
"purchaseOrderReference": "string",
"salutation": "mr",
"title": "Dr.",
"useFormalTerm": true
},
"recipientSameAsOwner": true
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Contract\InvoiceUpdateInvoiceSettings\InvoiceUpdateInvoiceSettingsRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Contract\InvoiceUpdateInvoiceSettings\InvoiceUpdateInvoiceSettingsRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// InvoiceUpdateInvoiceSettingsRequestBody to learn how to construct a valid instance
$body = new InvoiceUpdateInvoiceSettingsRequestBody(/* TODO: ... */);
$request = (new InvoiceUpdateInvoiceSettingsRequest(
customerId: "string",
body: $body
));
$response = $client->contract()->invoiceUpdateInvoiceSettings($request);
var_dump($response->getBody();