Overview
The list page that contains the Receipt Agreements in Wisefish.
|
Endpoint name |
|
|
Source table |
|
|
Fixed view |
Only shows unposted purchases, i.e. where invoice has not been posted. |
|
Requests allowed |
GET, POST, PATCH, DELETE |
|
Primary key |
|
|
Record ID |
|
|
Procedures |
|
Data
Field List
|
Property |
Type |
Max Len |
Description |
|
|
|---|---|---|---|---|---|
|
1 |
|
string uuid |
|
The record ID must be used when reading only one entry or when using procedures on the endpoint. |
RECORD ID |
|
2 |
|
string |
|
Options:
See Wisefish user manuals for more info. |
Primary key |
|
3 |
|
string |
20 |
The unique id within each “Document Type” |
Primary key |
|
4 |
|
string |
|
Status shows if the agreement is still open or has been released |
|
|
5 |
|
date |
|
Order Date |
|
|
6 |
|
string |
20 |
Vendor Order No. |
|
|
7 |
|
string |
20 |
This field is related to table Vendor. |
Mandatory |
|
8 |
|
string |
100 |
Vendor information |
|
|
9 |
|
string |
50 |
Vendor information |
|
|
10 |
|
string |
100 |
Vendor information |
|
|
11 |
|
string |
50 |
Vendor information |
|
|
12 |
|
string |
20 |
Vendor information |
|
|
13 |
|
string |
30 |
Vendor information |
|
|
14 |
|
string |
|
Vendor information |
|
|
15 |
|
string |
10 |
Vendor information |
|
|
16 |
|
string |
10 |
|
|
|
17 |
|
string |
10 |
After posting, the items will be on this Location |
|
|
18 |
|
string |
20 |
After posting, the items will be on this Stock Center |
|
|
19 |
|
string |
20 |
|
|
|
20 |
|
string |
10 |
Fields regarding shipping |
|
|
21 |
|
string |
10 |
Fields regarding shipping |
|
|
22 |
|
string |
10 |
Fields regarding shipping |
|
|
23 |
|
string |
|
Fields regarding shipping |
|
|
24 |
|
string |
10 |
Fields regarding shipping |
|
|
25 |
|
date |
|
Fields regarding shipping |
|
|
26 |
|
decimal |
|
The total amount of this purchase |
|
|
27 |
|
string |
10 |
|
|
|
28 |
|
date |
|
This date will be used for the ledger entries created when this is posted. |
|
|
29 |
|
string |
20 |
|
|
|
30 |
|
true/false |
|
|
|
|
31 |
|
integer |
|
Number of lines on this agreement |
|
|
32 |
|
decimal |
|
Total number of trade items on this agreement |
|
|
33 |
|
decimal |
|
|
|
|
34 |
|
decimal |
|
|
|
|
35 |
|
date-time UTC |
|
Automatic time stamp of last modification. |
|
Example Object
The response with only the properties from the “Purchase Agreement Header” (not the lines, looks like this);
{
"@odata.context": "https://api.businesscentral.dynamics.com/v2.0/b33a6a3b-244c-4295-84b3-0ad90823c736/AB_Test_191125/api/wisefish/base/v1.0/$metadata#companies(1691e98a-6a95-f011-b41a-6045bde126e9)/purchaseAgreements/$entity",
"@odata.etag": "W/\"JzIwOzExMTg5ODcyMDAwMzUyNTUzMzI0MTswMDsn\"",
"systemId": "b443a749-239a-f011-b41a-000d3adf9fc2",
"documentType": "Receipt",
"documentNo": "RA2000004",
"status": "Released",
"orderDate": "2025-09-25",
"vendorOrderNo": "",
"buyFromVendorNo": "4203690429",
"buyFromVendorName": "Þorbjörn hf.",
"buyFromVendorName2": "",
"buyFromAddress": "",
"buyFromAddress2": "",
"buyFromPostCode": "240",
"buyFromCity": "GRINDAVÍK",
"buyFromCounty": "",
"buyFromCountry": "IS",
"languageCode": "ISL",
"locationCode": "",
"stockCenterCode": "",
"externalProducer": "",
"placeofLoading": "",
"placeofDischarge": "",
"placeofDelivery": "",
"transporter": "",
"transportMethodCode": "",
"expectedReceiptDate": "2025-09-25",
"amount": 10000,
"currencyCode": "",
"postingDate": "2025-09-25",
"vendorInvoiceNo": "",
"getBCTIInvoice": false,
"noOfLines": 1,
"noOfTradeItems": 100,
"noOfTradeItemsAllocated": 0,
"noOfTradeItemsReceived": 0,
"lastModified": "2025-09-30T17:14:22.093Z",
}
Usage
Read one agreement with lines
Reading one entry of this table must be done with the record Id which is in this case the systemId.
Lines are shown by adding to the URL $expand=purchaseAgreementLines
GET ... purchaseAgreements([system-id])?$expand=purchaseAgreementLines
Create an agreement with lines
POST .../purchaseAgreements?$expand=purchaseAgreementLines
Body:
{
"orderDate": "2025-12-02",
"buyFromVendorNo": "4203690429",
"locationCode": "001",
"vendorInvoiceNo": "AFH-001",
"purchaseAgreementLines": [
{
"itemNo": "ZZZ1003",
"tradeItems": 300,
"tradeItemUnitOfMeasure": "KG",
"productionDate": "2025-12-02"
}
]
}
The response contains the the new entry, both header and lines.
Procedures
Service-enabled procedures are the following, see below.
If there is anything important to say about these procedures
If the request is successful, the response is 200 OK and could also possibly contain something in the value property:
{
"@odata.context": "https://api.businesscentral.dynamics.com/v2.0/b33a6a3b-244c-4295-84b3-0ad90823c736/AB_Test_191125/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Success"
}
Release
This will release the agreement, same as clicking on the Release button within BC.
Usage
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/purchaseAgreements([record-id])/Microsoft.NAV.release
(no parameters)
After a successful request:
-
The Status becomes Released.
Reopen
If an already released agreement needs to be reopened, in order to do some changes.
Usage
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/purchaseAgreements([record-id])/Microsoft.NAV.reopen
(no parameters)
After a successful request:
-
The Status becomes Open.
Create Posting Document
When all lines have been registered on the purchase agreement, the posting document can be created, i.e. either a Purchase Order or a Purchase Invoice.
Before this is run, the agreement must be released.
Usage
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/purchaseAgreements([record-id])/Microsoft.NAV.createPostingDocument
(no parameters)
After a successful request:
-
A purchase document (Purchase Order or Purchase Invoice, depends on settings) has been created for the agreement.
Receive Items
This method can be used if the API user is allowed to both created the posting document and then immediately post the items into inventory.
Usage
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/purchaseAgreements([record-id])/Microsoft.NAV.receiveItems
(no parameters)
This method does both:
-
Creates a a Purchase Order for the agreement.
-
The purchase order is posted with the “receipt” option, which means that items are in stock, and the order waits for the invoice to be created later.