Create recipient
Create a recipient
1 | POST /recipients/
|
Response
HTTP/1.1 201 CREATED
Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | { "customerNumber": "12", "name": "Ole Nordman", "contact": { "address": { "address1": "Oslogata", "address2": "", "city": "OSLO", "country": "NORGE", "zip": "0194" }, "email": "ole@sendregning.no", "phone": "", "mobile": "", "fax": "", "web": "" }, "organisation": { "form": null, "icd": null, "number": null }, "settings": { "discount": 0.0, "creditDays": null, "attachPdf": false, "defaultShipment": "EMAIL", "currency": null }, "yourReference": null, "customFields": [ { "number": 1, "value": "some value" } ], "comment": "" } |
It’s also allowed to post an array of recipients
1 2 3 4 5 6 7 8 9 10 11 12 13 | [ { "customerNumber": "12", "name": "Ole Nordman", ... }, { "customerNumber": "13", "name": "Jon Nordman", ... } ] |
In this case response code will also be 201 HTTP/1.1 201 Created but links to all created entities will be listed in response body instead of Location header.
1 2 3 4 | [ "https://www.sendregning.no/recipients/26", "https://www.sendregning.no/recipients/27" ] |
Detailed property description
| Name | Description | Required | Type | Limitation | ||
|---|---|---|---|---|---|---|
| customerNumber | recipient's client number. This field must be present in order to link the invoice to an existing recipient. |
optional | String | 32 characters | ||
| name | recipient name | mandatory | String | 42 characters | ||
| contact | contact details | mandatory | object | |||
| address | postal address | mandatory | object | |||
| address1 | first address line | optional | String | 42 characters | ||
| address2 | second address line | optional | String | 42 characters | ||
| zip | mandatory | String | 8 characters | |||
| city | mandatory | String | 36 characters | |||
| country | valid country in SendRegning lookup: /common/public/countries |
optional - NORGE is default value | String | |||
| optional | String | 64 characters | ||||
| phone | optional | String | 64 characters | |||
| mobile | optional | String | 64 characters | |||
| fax | optional | String | 64 characters | |||
| web | optional | String | 128 characters | |||
| organisation | optional | object | ||||
| form | organisation form see organisation form list below |
String | ||||
| icd | icd code 9908 for Norway |
optional | number | 4 digits | ||
| number | valid Norwegian organisation number | optional | String | |||
| settings | optional | object | ||||
| discount | optional | number | decimal (5,2) | |||
| creditDays | invoice credit days | optional | number | |||
| attachPdf | should pdf be attached to invoices if not specified originator preference will be used |
optional | boolean | |||
| defaultShipment | default invoice shipment method valid values: SNAIL, EMAIL |
optional | String | |||
| autoDunningsEnabled | excluded from automatic dunning if not null and set to false | optional | boolean | |||
| currency | currency code valid options at /common/currency/exchangeRates |
optional | String | 3 characters | ||
| yourReference | default your reference | optional | String | 64 characters | ||
| comment | optional | String | ||||
| customFields | custom fields | optional | object | |||
| number | number defined in originator's custom field | mandatory | number | |||
| value | undergoes special validations depending on custom field type | mandatory if required in originator's custom field definition | ||||
Additional information
Allowed organisation form values:
ansAnsvarlig selskap med solidarisk ansvar (ANS)asAksjeselskap (AS)asaAllmenaksjeselskap (ASA)baSelskap med begrenset Ansvar (BA)bblbrlBoligbyggelag/Borettslag (BBL/BRL)daAnsvarlig selskap med delt ansvar (DA)enkEnkeltpersonforetak (ENK)esekEierseksjonssameie (ESEK)fliForening/lag/innretning (FLI)gfsGjensidig forsikringsselskap (GFS)iksInterkommunalt selskap (IKS)kffkfKommunalt/Fylkeskommunalt foretak (KF/FKF)ksKomandittselskap (KS)prePartrederi (PRE)prvPersonlig/Privat (trenger ikke org.nummer)saSamvirkeforetak (SA)stiStiftelse (STI)ueUtenlandsk enhet med norsk avdeling/representant (NUF)