Create and update
In addition to creating/updating a draft, there are a few other side effects that could occur:
- A new recipient could be created. However, using an existing recipient is also possible. More details on how this works are found in the descriptions below.
- A new product could be created. Again, you can find more details on how to achieve this effect in the details below.
1 | POST /offer/drafts
|
Request
HTTP/1.1 200 OK
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 39 40 41 42 43 44 45 46 47 48 49 50 | { "number": 7, "ourReference": "This is our ref", "yourReference": "This is your ref", "creditDays": 14, "freeText": "My free text", "deliveryDate": "2016-02-13", "offerDate": "2016-02-15", "expiryDate": "2016-02-25", "recipient": { "number": 3, "customerNumber": "2", "name": "adam", "email": "rec@sendregning.no", "organisationNumber": "976098897", "icd": "9908", "address": { "address1": "add1", "address2": "add2", "zip": "2040", "city": "OSLO", "country": "NORGE" } }, "deliveryAddress": { "address": "Gjerderumsveien 23", "zip": "0212", "city": "OSLO", "country": "NORGE" }, "items": [{ "number": 1, "quantity": 2, "productCode": "my product", "description": "This my description", "unitPrice": 12.00, "discount": 25, "taxRate": 10, "total": 23.43 }, { "number": 2, "quantity": 2, "productCode": "my product nr 2", "description": "This my description", "unitPrice": 12.00, "discount": 25, "taxRate": 10, "total": 23.43 }] } |
Response
HTTP/1.1 200 OK
The response body contains number of created offer.
Detailed property description
Name | Description | Required | Type | Limitation | |||
---|---|---|---|---|---|---|---|
number | Draft offer number |
For update only | Number | ||||
ourReference | Originator's reference. | String | 30 characters | ||||
yourReference | Recipient's reference | String | 30 characters | ||||
creditDays | Number | ||||||
freeText | String | ||||||
deliveryDate | String | Valid ISO date | |||||
offerDate | String | Valid ISO date | |||||
expiryDate | String | Valid ISO date | |||||
recipient | Details about recipient of the invoice This object can be used in two ways 1. Use the `number` property to reference an existing recipient. 2. Use the other property to create a new recipient when issuing the offer. |
Object | |||||
number | The number that reference an existing recipient. If provided, the recipient with this number will be the recipient of this offer. Other properties in this recipient object will be ignored |
conditioned | Integer | ||||
name | The number that reference an existing recipient. If provided, the recipient with this number will be the recipient of this offer. Other properties in this recipient object will be ignored |
conditioned | String | ||||
customerNumber | If number is null, this property will be used to create a new recipient. |
conditioned | String | 32 characters | |||
If number is null, this property will be used to create a new recipient. |
conditioned | String | 64 characters | ||||
organisationNumber | If number is null, this property will be used to create a new recipient.Organisation number must be present either on this property or on `shipment.ehf.organisationNumber` to be eligible for sending the invoice by EHF. |
conditioned | String | 9 characters | |||
address | If number is null, this property will be used to create a new recipient. |
conditioned | Object | ||||
address1 | If number is null, this property will be used to create a new recipient. |
conditioned | String | 42 characters | |||
address2 | If number is null, this property will be used to create a new recipient. |
conditioned | String | 42 characters | |||
zip | If number is null, this property will be used to create a new recipient. |
conditioned | String | 8 characters | |||
city | If number is null, this property will be used to create a new recipient. |
conditioned | String | 36 characters | |||
country | If number is null, this property will be used to create a new recipient. |
conditioned | String | 42 characters | |||
items | Details of the offer. Maximum 18 items allowed |
yes | Array | ||||
number | A unique number defining where in the order the item belong. If omitted, a number will given based on where the item is in the array. If the number is omitted from one item, then the number must be omitted from all items and vice versa. |
Integer | Between 1-18 for Norwegian invoices and 34 for international invoices | ||||
quantity | Quantity is used together with the unit price to find the line total, which means that (quantity * unit price) - discount + VAT is equal to the line total, which in this case is 2109.38. Quantity can only be omitted if unit price is omitted. |
Number | 6 characters, including punctuation marks and signs. Can't be negative. | ||||
productCode | Used to distinguish between the various products that are invoiced, this means that you can run reports in the meantime that tell how much you have invoiced of a given product. A product will be created in the product list when specifying a product code. If it already exists a product with this product code, the product will NOT be updated. | String | 9 characters | ||||
description | Describes the service/goods you are invoicing. This property can also be used for extra information that there isn't space for elsewhere. If this is the only element in a line that contains data, only this text will be printed out on the line. | String | 75 characters | ||||
unitPrice | Unit price is used together with the quantity to find the line total, which means that (quantity * unit price) - discount + VAT is equal to the line total, which in this case is 2109.38. Unit price can only be omitted if quantity is omitted. |
Number | 9 characters, including punctuation marks and signs | ||||
discount | A valid value for this element is a decimal number from 0 to 100. Note that the % sign must NOT be included and will generate an error message. If no items contain a discount, the discount column will be hidden on the invoice. |
Number | 5 characters, including punctuation marks. Must be >= 0 and <= 100 | ||||
taxRate | This rate can be changed by the authorities and will be automatically updated by SendRegning.no. The tax rate must be a valid tax rate. |
yes | Integer | 2 characters |