要使用Acumatica的API来创建快速支票,您需要使用以下端点和代码示例:
创建支票头:
var client = new RestClient("https://your-acumatica-instance/entity/Default/17.200.001/CashTransactions");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer your_access_token");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"Type\": {\n \"value\": \"Check\"\n },\n \"ReferenceNbr\": {\n \"value\": \"CHECK001\"\n },\n \"Status\": {\n \"value\": \"Hold\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
创建支票明细:
var client = new RestClient("https://your-acumatica-instance/entity/Default/17.200.001/CashTransactions/{referenceNumber}/Transactions");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer your_access_token");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"Type\": {\n \"value\": \"Check\"\n },\n \"ReferenceNbr\": {\n \"value\": \"CHECK001\"\n },\n \"AccountID\": {\n \"value\": \"12345\"\n },\n \"Amount\": {\n \"value\": 100.00\n },\n \"Status\": {\n \"value\": \"Hold\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
请确保将上述代码示例中的your-acumatica-instance
替换为您的Acumatica实例的URL,并将your_access_token
替换为您的访问令牌。此外,还需要根据您的业务需求自定义请求正文的参数。
注意:上述代码示例使用的是C#和RestSharp库来执行HTTP请求。您可以使用任何适用于您的编程语言和HTTP客户端库来调用Acumatica的API。