Creates a sale document based on the DocumentType and returns a MB (multibanco) reference if a is provided and its a non draft document
Name | Description | Type | Additional information |
---|---|---|---|
EntityID | Target entity ID related to the sale sale | integer | Required |
SerieID | ID of the serie that you want to add. This serie must be ACTIVE and EndDate cannot be less than the SaleDate | integer | Required |
Observation | Observation of the sale | string | Max length: 1000 |
Reason | Reason of the document. Used in the credit note | string | Max length: 50 |
SaleDate | Date of the sale. Cannot be bigger than today's date | date | The selected date cannot be bigger than today's date |
DueDays | Due days of the sale. This is for the sale expiration date | integer | Range: inclusive between 0 and 2147483647 |
CurrencyID | CurrencyID of the sale | byte | Must be a valid currency |
ExchangeRate | Exchange rate of the currency that you selected | decimal number | Range: inclusive between 0 and 100 |
Products | List of products in the sale | Array of Details | No additional information available. |
RelatedDocumentIDs | Related document IDs for the sale. If you're doing a normal INVOICE, this will be null. Used in Credit notes (required at least one valid document) | Array of integer | No additional information available. |
IsDraft | Set to true if the document is finished and you want to set a number to it. After its saved it can't be edited | boolean | No additional information available. |
Reference | Sale reference. | string | Max length: 1000 |
RetentionIRC | Set to true if the retentions apply to the IRC or VAT | boolean | No additional information available. |
RetentionRate | Rate of the retention to apply to the tax | decimal number | No additional information available. |
RetentionAmount | Amount of the retention to apply | decimal number | No additional information available. |
SealAmount | Seal tax amout to apply to the sale | decimal number | No additional information available. |
ProviderID | Payment Provider ID if you want to generate a ATM (mb) Refence. NULL if you don't want to generate a payment reference. Required if IsDraft is FALSE | integer | No additional information available. |
Delivery | Delivery information for the invoice | Delivery | No additional information available. |
{
"entityID": 1,
"serieID": 2,
"observation": "sample string 3",
"reason": "sample string 4",
"saleDate": "2022-08-15T08:39:48.3079371+01:00",
"dueDays": 6,
"currencyID": 64,
"exchangeRate": 7.0,
"products": [
{
"productID": 1,
"description": "sample string 2",
"productDetail": "sample string 3",
"quantity": 4.0,
"unitID": 5,
"unitPrice": 6.0,
"discountRate": 7.0,
"taxID": 8,
"taxRate": 1.0,
"order": 9,
"applyRetention": true
},
{
"productID": 1,
"description": "sample string 2",
"productDetail": "sample string 3",
"quantity": 4.0,
"unitID": 5,
"unitPrice": 6.0,
"discountRate": 7.0,
"taxID": 8,
"taxRate": 1.0,
"order": 9,
"applyRetention": true
}
],
"relatedDocumentIDs": [
1,
2
],
"isDraft": true,
"reference": "sample string 9",
"retentionIRC": true,
"retentionRate": 11.0,
"retentionAmount": 12.0,
"sealAmount": 13.0,
"providerID": 1,
"delivery": {
"licensePlate": "sample string 1",
"sourceDate": "2022-08-15T08:39:48.3079371+01:00",
"targetDate": "2022-08-15T08:39:48.3079371+01:00",
"sourceAddress": {
"street": "sample string 1",
"city": "sample string 2",
"code": "sample string 3",
"region": "sample string 4",
"countryID": 64
},
"targetAddress": {
"street": "sample string 1",
"city": "sample string 2",
"code": "sample string 3",
"region": "sample string 4",
"countryID": 64
}
}
}
Returns a Sale ID of the sale you created. If a provider is sent it will also return an MB Reference. Within the location header there is a fully fledged URL to get the sale information
Name | Description | Type | Additional information |
---|---|---|---|
SaleID | ID of the sale to pay | integer | No additional information available. |
Entity | Payment target identifier | string | No additional information available. |
Reference | Payment reference identifier | string | No additional information available. |
TotalDue | Total payable amount | decimal number | No additional information available. |
{
"saleID": 1,
"entity": "sample string 2",
"reference": "sample string 3",
"totalDue": 4.0
}