on 04-17-2018 9:09 PM
Hi,
Using the example from the "Service Layer API reference.html" I was able to post an incoming payment to Business One.
POST https://localhost:50000/b1s/v1/IncomingPayments
{"CardCode": "c001",
"CashAccount": "_SYS00000000002",
"CashFlowAssignments": [
{
"AmountLC": "110",
"PaymentMeans": "pmtCash"
}
],
"CashSum": "110"
}
That worked.
Next I need to post a check to a specific invoice but there is no example for this I could find in any documentation.
So I tried to guess the JSON properties based on the SDK DI-API documentation.
{"CardCode": "SWD",
"Checks": [
{
"CheckSum": "2756.68",
"BankCode": "B1"
}
],
"Invoices" : [
{ "DocEntry" : 9,
"SumApplied" : "2756.68"
}
],
"TransferSum": "2756.68"
}
The response comes back as "Data Checks not found". I also tried "Payments_Checks" and it failed as well.
1. What is the correct code to make this payment application.
2. Is there a better source detailed documentation for the Business One Service layer than "Service Layer API reference.html"?
That document does not always contain all the details of the property names as in this case. Especially when there are child tables.
Thanks for any help.
Regards,
Mel
Answering my own question:
To find the correct Service Layer spellings for the properties of any object just do a GET:
E.G.
GET
https://hanab1vm2:50000/b1s/v1/IncomingPayments(9).
Result shows all the properties:
{
"odata.metadata": "https://hanab1vm2:50000/b1s/v1/$metadata#IncomingPayments/@Element",
"DocNum": 9,
"DocType": "rCustomer",
"HandWritten": "tNO",
"Printed": "tNO",
"DocDate": "2019-03-23",
"CardCode": "CIS",
"CardName": "Complete Information Systems, LLC",
"Address": "222 E. Wisconsin Ave.\rSuite 309\rLake Forest, IL 60045-1723\rUSA",
"CashAccount": "_SYS00000000002",
"DocCurrency": "$",
"CashSum": 0,
"CheckAccount": "_SYS00000000006",
"TransferAccount": null,
"TransferSum": 0,
"TransferDate": null,
"TransferReference": null,
"LocalCurrency": "tNO",
"DocRate": 0,
"Reference1": "9",
"Reference2": null,
"CounterReference": null,
"Remarks": null,
"JournalRemarks": "Incoming Payments - CIS",
"SplitTransaction": "tNO",
"ContactPersonCode": null,
"ApplyVAT": "tNO",
"TaxDate": "2019-03-23",
"Series": 15,
"BankCode": null,
"BankAccount": null,
"DiscountPercent": 0,
"ProjectCode": null,
"CurrencyIsLocal": "tNO",
"DeductionPercent": 0,
"DeductionSum": 0,
"CashSumFC": 0,
"CashSumSys": 0,
"BoeAccount": null,
"BillOfExchangeAmount": 0,
"BillofExchangeStatus": null,
"BillOfExchangeAmountFC": 0,
"BillOfExchangeAmountSC": 0,
"BillOfExchangeAgent": null,
"WTCode": null,
"WTAmount": 0,
"WTAmountFC": 0,
"WTAmountSC": 0,
"WTAccount": null,
"WTTaxableAmount": 0,
"Proforma": "tNO",
"PayToBankCode": null,
"PayToBankBranch": null,
"PayToBankAccountNo": null,
"PayToCode": "CIS",
"PayToBankCountry": null,
"IsPayToBank": "tNO",
"DocEntry": 9,
"PaymentPriority": "bopp_Priority_6",
"TaxGroup": null,
"BankChargeAmount": 0,
"BankChargeAmountInFC": 0,
"BankChargeAmountInSC": 0,
"UnderOverpaymentdifference": 0,
"UnderOverpaymentdiffSC": 0,
"WtBaseSum": 0,
"WtBaseSumFC": 0,
"WtBaseSumSC": 0,
"VatDate": "2018-03-23",
"TransactionCode": "",
"PaymentType": "bopt_None",
"TransferRealAmount": 0,
"DocObjectCode": "bopot_IncomingPayments",
"DocTypte": "rCustomer",
"DueDate": "2019-03-23",
"LocationCode": null,
"Cancelled": "tNO",
"ControlAccount": "_SYS00000000010",
"UnderOverpaymentdiffFC": 0,
"AuthorizationStatus": "pasWithout",
"BPLID": null,
"BPLName": null,
"VATRegNum": null,
"BlanketAgreement": null,
"PaymentChecks": [
{
"LineNum": 0,
"DueDate": "2019-03-23",
"CheckNumber": 1,
"BankCode": "B1",
"Branch": "",
"AccounttNum": "",
"Details": null,
"Trnsfrable": "tYES",
"CheckSum": 343,
"Currency": "$",
"CountryCode": "US",
"CheckAbsEntry": 9,
"CheckAccount": "_SYS00000000006",
"ManualCheck": "tNO",
"FiscalID": null,
"OriginallyIssuedBy": null,
"Endorse": "tNO",
"EndorsableCheckNo": null
}
],
"PaymentInvoices": [
{
"LineNum": 0,
"DocEntry": 217,
"SumApplied": 100,
"AppliedFC": 0,
"AppliedSys": 100,
"DocRate": 0,
"DocLine": 0,
"InvoiceType": "it_Invoice",
"DiscountPercent": 0,
"PaidSum": 0,
"InstallmentId": 1,
"WitholdingTaxApplied": 0,
"WitholdingTaxAppliedFC": 0,
"WitholdingTaxAppliedSC": 0,
"LinkDate": null,
"DistributionRule": null,
"DistributionRule2": null,
"DistributionRule3": null,
"DistributionRule4": null,
"DistributionRule5": null,
"TotalDiscount": 0,
"TotalDiscountFC": 0,
"TotalDiscountSC": 0
},
{
"LineNum": 1,
"DocEntry": 219,
"SumApplied": 243,
"AppliedFC": 0,
"AppliedSys": 243,
"DocRate": 0,
"DocLine": 0,
"InvoiceType": "it_Invoice",
"DiscountPercent": 0,
"PaidSum": 0,
"InstallmentId": 1,
"WitholdingTaxApplied": 0,
"WitholdingTaxAppliedFC": 0,
"WitholdingTaxAppliedSC": 0,
"LinkDate": null,
"DistributionRule": null,
"DistributionRule2": null,
"DistributionRule3": null,
"DistributionRule4": null,
"DistributionRule5": null,
"TotalDiscount": 0,
"TotalDiscountFC": 0,
"TotalDiscountSC": 0
}
],
"PaymentCreditCards": [],
"PaymentAccounts": [],
"BillOfExchange": {},
"WithholdingTaxCertificatesCollection": [],
"CashFlowAssignments": [],
"Payments_ApprovalRequests": [],
"WithholdingTaxDataWTXCollection": []
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.