Create Contract
Create a contract with invoice items and agreement settings. Draft description — behavior must be confirmed.
PUT /v1/Invoices/CustomAction/importcontract
Use the Test or Production base URL configured under Overview.
Headers and authentication
Use OAuth 2.0 Client Credentials and the Authorization header with a Bearer access token, as described under Overview.
Request body fields
Draft: Field descriptions are proposed from the supplied example. Mandatory fields, null handling, accepted values and validation rules are TBD. Types below reflect example JSON values; they are not a confirmed schema. The example uses date strings in YYYY-MM-DD form. All identifiers in the sample are demo values.
| Field path | Mandatory | Description |
|---|---|---|
| contracts | TBD | array Contracts included in this import request. |
| contracts[].contract | TBD | object Contract details for one imported record. |
| contracts[].contract.creditorreferencecode | TBD | string Creditor reference code. Use a code assigned to your integration. |
| contracts[].contract.customerguid | TBD | string Identifier of the customer associated with the contract. |
| contracts[].contract.active | TBD | boolean Indicates whether the contract is active. |
| contracts[].contract.contractrefno | TBD | string Contract reference number in the sending system. |
| contracts[].contract.description | TBD | string Description of the contract or invoice item. |
| contracts[].contract.note | TBD | string Additional note for the contract. |
| contracts[].contract.contractdate | TBD | string Date of the contract. |
| contracts[].contract.startdate | TBD | string Start date of the contract. |
| contracts[].contract.nextinvoicedate | TBD | string Next planned invoice date. |
| contracts[].contract.enddate | TBD | string End date of the contract. |
| contracts[].contract.intervaldays | TBD | integer Number of days used for the invoicing interval. Interaction with intervaltype is TBD. |
| contracts[].contract.intervaltype | TBD | string Interval calculation type. The supplied example uses physicaldays; other accepted values are TBD. |
| contracts[].contract.paymentcondition | TBD | integer Payment condition value. Whether this is a code or a number of days is TBD. |
| contracts[].contract.invoiceitem | TBD | array Invoice items included in the contract. |
| contracts[].contract.invoiceitem[].permanentitem | TBD | integer Integer flag for the item. Meaning of 0 and 1 and recurrence behavior are TBD. |
| contracts[].contract.invoiceitem[].itemnumber | TBD | string Item reference or number. |
| contracts[].contract.invoiceitem[].unittype | TBD | string Unit type for the item. The supplied example uses pcs; accepted values are TBD. |
| contracts[].contract.invoiceitem[].description | TBD | string Description of the contract or invoice item. |
| contracts[].contract.invoiceitem[].amount | TBD | number Amount for the item. Tax treatment and relationship to itemprincipal are TBD. |
| contracts[].contract.invoiceitem[].vatcode | TBD | string VAT code for the item. The supplied example uses SE25; accepted codes are TBD. |
| contracts[].contract.invoiceitem[].remainingcount | TBD | integer Remaining count for the item. Meaning of zero and counting rules are TBD. |
| contracts[].contract.invoiceitem[].itemcount | TBD | integer Quantity or count for the item. Calculation rules are TBD. |
| contracts[].contract.invoiceitem[].itemprincipal | TBD | number Principal amount for the item. Relationship to amount and quantity is TBD. |
| contracts[].contract.invoiceitem[].interval | TBD | integer Item interval value. Unit and interaction with the contract interval are TBD. |
| contracts[].contract.continuousagreement | TBD | integer Integer agreement flag. Meaning of 0 and 1 is TBD. |
| contracts[].contract.maxnumunpaidinvoices | TBD | integer Maximum number of unpaid invoices. Behavior when the limit is reached is TBD. |
| contracts[].contract.agreement | TBD | object Agreement settings for the contract. |
| contracts[].contract.agreement.numberofpayments | TBD | integer Number of payments in the agreement. |
| contracts[].contract.agreement.purchasable | TBD | boolean Indicates whether the agreement is eligible for purchase. Eligibility rules are TBD. |
| contracts[].contract.agreement.currency | TBD | string Currency code for the agreement; the supplied example uses SEK. |
Response fields
HTTP 200
A successful request returns the following fields. Mandatory remains TBD; a single example does not establish guaranteed presence or null handling.
| Field path | Mandatory | Description |
|---|---|---|
| result | TBD | string Operation result. The supplied successful response returns OK. |
| contractrefno | TBD | string Contract reference number. |
| contractguid | TBD | string Identifier of the created contract. |
Error responses
TBD: Error status codes and response fields have not been supplied.
