/salesestimates/create v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Sales Estimates
postSalesEstimatesCreate
Code samples
const inputBody = '{
"type": "object",
"required": [
"number",
"customer"
],
"properties": {
"number": {
"type": "string",
"description": "The document number, must be a non-empty string."
},
"customer": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the customer."
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"lineNumber": {
"type": "number",
"description": "The line number of the item.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the item.",
"nullable": true
},
"price": {
"type": "number",
"format": "decimal",
"description": "The price of the item.",
"nullable": true
},
"unitOfMeasure": {
"type": "string",
"description": "The unit of measure for the item.",
"nullable": true
},
"itemType": {
"type": "string",
"description": "The type of the item.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the item.",
"nullable": true
}
}
},
"nullable": true
},
"taxes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the tax.",
"nullable": true
},
"ratePercent": {
"type": "number",
"format": "decimal",
"description": "The rate percent of the tax.",
"nullable": true
},
"amount": {
"type": "number",
"format": "decimal",
"description": "The amount of the tax.",
"nullable": true
}
}
},
"nullable": true
},
"currency": {
"type": "string",
"description": "The currency of the document.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the document.",
"nullable": true
},
"status": {
"type": "string",
"description": "The status of the document.",
"nullable": true
},
"revision": {
"type": "string",
"description": "The revision of the document.",
"nullable": true
},
"customerName": {
"type": "string",
"description": "The name of the customer.",
"nullable": true
},
"subTotalPrice": {
"type": "number",
"format": "decimal",
"description": "The subtotal price of the document.",
"nullable": true
},
"totalPrice": {
"type": "number",
"format": "decimal",
"description": "The total price of the document.",
"nullable": true
},
"documentDate": {
"type": "string",
"format": "date",
"description": "The date of the document.",
"nullable": true
},
"validUntilDate": {
"type": "string",
"format": "date",
"description": "The date until which the document is valid.",
"nullable": true
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/salesestimates/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /salesestimates/create
Create a sales estimate
Creates a sales estimate for the organization.
Body parameter
{
"type": "object",
"required": ["number", "customer"],
"properties": {
"number": {
"type": "string",
"description": "The document number, must be a non-empty string."
},
"customer": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the customer."
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"lineNumber": {
"type": "number",
"description": "The line number of the item.",
"nullable": true
},
"quantity": {
"type": "number",
"description": "The quantity of the item.",
"nullable": true
},
"price": {
"type": "number",
"format": "decimal",
"description": "The price of the item.",
"nullable": true
},
"unitOfMeasure": {
"type": "string",
"description": "The unit of measure for the item.",
"nullable": true
},
"itemType": {
"type": "string",
"description": "The type of the item.",
"nullable": true
},
"item": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the item.",
"nullable": true
}
}
},
"nullable": true
},
"taxes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the tax.",
"nullable": true
},
"ratePercent": {
"type": "number",
"format": "decimal",
"description": "The rate percent of the tax.",
"nullable": true
},
"amount": {
"type": "number",
"format": "decimal",
"description": "The amount of the tax.",
"nullable": true
}
}
},
"nullable": true
},
"currency": {
"type": "string",
"description": "The currency of the document.",
"nullable": true
},
"comments": {
"type": "string",
"description": "Comments about the document.",
"nullable": true
},
"status": {
"type": "string",
"description": "The status of the document.",
"nullable": true
},
"revision": {
"type": "string",
"description": "The revision of the document.",
"nullable": true
},
"customerName": {
"type": "string",
"description": "The name of the customer.",
"nullable": true
},
"subTotalPrice": {
"type": "number",
"format": "decimal",
"description": "The subtotal price of the document.",
"nullable": true
},
"totalPrice": {
"type": "number",
"format": "decimal",
"description": "The total price of the document.",
"nullable": true
},
"documentDate": {
"type": "string",
"format": "date",
"description": "The date of the document.",
"nullable": true
},
"validUntilDate": {
"type": "string",
"format": "date",
"description": "The date until which the document is valid.",
"nullable": true
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » number | body | string | true | The document number, must be a non-empty string. |
| » customer | body | string(mongo-id) | true | The MongoDB ID of the customer. |
| » items | body | [object]¦null | false | none |
| »» lineNumber | body | number¦null | false | The line number of the item. |
| »» quantity | body | number¦null | false | The quantity of the item. |
| »» price | body | number(decimal)¦null | false | The price of the item. |
| »» unitOfMeasure | body | string¦null | false | The unit of measure for the item. |
| »» itemType | body | string¦null | false | The type of the item. |
| »» item | body | string(mongo-id)¦null | false | The MongoDB ID of the item. |
| » taxes | body | [object]¦null | false | none |
| »» name | body | string¦null | false | The name of the tax. |
| »» ratePercent | body | number(decimal)¦null | false | The rate percent of the tax. |
| »» amount | body | number(decimal)¦null | false | The amount of the tax. |
| » currency | body | string¦null | false | The currency of the document. |
| » comments | body | string¦null | false | Comments about the document. |
| » status | body | string¦null | false | The status of the document. |
| » revision | body | string¦null | false | The revision of the document. |
| » customerName | body | string¦null | false | The name of the customer. |
| » subTotalPrice | body | number(decimal)¦null | false | The subtotal price of the document. |
| » totalPrice | body | number(decimal)¦null | false | The total price of the document. |
| » documentDate | body | string(date)¦null | false | The date of the document. |
| » validUntilDate | body | string(date)¦null | false | The date until which the document is valid. |
Example responses
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | the newly created item | None |
