Making Write Endpoints
When creating a Write endpoint, you have several different factors to consider in the way the endpoint will work:
- Failure Handling: Do you want an error on one line to cause the whole transaction to stop, as often is needed for Documents? Or would you prefer just the one line to be rejected, letting the others through? That’s the role of the Batch Mode vs Per Record options
- Table Connections: If you include more than one table in a write endpoint, the children will inherent values from the parent relationship. This allows you to easily do things such as create a Customer and several Ship-To Addresses at once, or a Sales Order with many lines.
- Data to show vs data to write. When you add fields to a Write endpoint, you can choose to include fields in the response that are not permitted to be written to (and more, see the Advanced section).
- Which Write transactions are allowed. On a Write endpoint, you can choose to fine tune control for Insert, Modify, and Delete. For example, you may want to permit an integration partner to create and update Items, but never delete them.
Creating a Write Endpoint
In this example, we will create an Endpoint for creating Vendors and Vendor Bank Accounts.
First, go to the Data Braider API Endpoints list. Choose the New action. This will open the API Endpoint Card. You need to start with the General information section:
- Code – the unique ID you want to use for this endpoint. We will enter
VENDBANK
. - Description – A note field for you to describe the intended purpose. We will enter
Vendor and Bank Accounts
. - What type of Endpoint. We will select
Write - Batch Mode
.
Now that the Endpoint is defined, we add which data should be made available in the Endpoint Line section. For our example, we’ll want to add the Vendor
and Vendor Bank Account
tables.
Because the Bank Accounts are per-Vendor, we’ll use the Move Right on the Vendor Bank Accounts
item to make it a child table of Vendor
.
Then, for each Endpoint Line, you will need to define Fields. With a Write endpoint, you can choose Included to select the field to include in the Response. You then select which fields are Write Enabled.
For our example, we could set the following
Vendor
- Included: No., Name, Currency Code, Purchaser Code, EMail
- Write: Name, Currency Code, Email
Vendor Bank Account
- Included: Code, Name, Currency Code, IBAN, SWIFT Code
- Write: Code, Name, Currency Code, IBAN, SWIFT Code
As a wrapping up step, we can also choose to not let our integration partner delete vendor bank account information, as we may need it for reporting on. So, in the Write-Back Enpoint Settings, we can uncheck the Delete Allowed option.