问题
Has anyone tried to change the "fixed amount" of a "payment item" using the DocuSign rest API?
I'm using a template that's been designed and setup via the DocuSign web page.
The template consists of 2 template roles, one of which is the "Customer". It contains a payment item in which I would like to pre-fill the dollar amount, payment description item code, and payment description item details.
I found this in the documentation under 'formulaTabs':
"<paymentDetails>" +
"<lineItems>" +
"<paymentLineItem>" +
"<amountReference>\\*txtPayment</amountReference>" +
"<description>" + polNum + "</description>" +
"<itemCode>" + custId + "</itemCode>" +
"</paymentLineItem>" +
"</lineItems>" +
"</paymentDetails>" +
but, I'm not sure where to place it, I've tried using it within
<envelopeDefinition> </envelopeDefinition>
and
<text> </text>
But, I keep coming up with a PAYMENTTABS_LINEITEM_AMOUNT_IS_MISSING
error.
I have a text field on the template labeled txtPayment
(which I don't really need).
The payment item is labeled txtPaymentItem
.
I'm open to using other means if necessary.
Thanks,
回答1:
I am hoping that you are able to use Payment using WEBApp but struggling in using API, so the correct JSON structure to use DocuSignPayment API is,
"formulaTabs": [{
"ConcealValueOnDocument": "false",
"Formula": "([PaymentItem1]) * 100",
"IsPaymentAmount": "false",
"Locked": "true",
"Name": "paymentsFormulaTab",
"PaymentDetails": {
"currencyCode": "USD",
"gatewayAccountId": "a7dcd60d-d963-4a81-bc72-68b71aad2062",
"lineItems": [{
"amountReference": "PaymentItem1",
"description": "951900;Tims 6.2;4444;1002",
"itemCode": "base",
"name": "salesDeposit"
}
]
},
"Required": "true",
"RoundDecimalPlaces": "2"
}
],
"numberTabs": [{
"FontColor": "DarkRed",
"IsPaymentAmount": "true",
"Locked": "true",
"TabLabel": "PaymentItem1",
"Value": "2500.00"
}
]
If you see above JSON structure, it has two tabs, formula and Number Tab and formula Tab uses the Number Tab reference. In this case, it refers to PaymentItem1. Hope above JSON will resolve your issue.
回答2:
Thanks to Amit K Bist this worked to update a payment item
tab after it's dropped into a template.
When creating a Template, add your Payment Item, select "Signer Entered" option under Payment Amount and put a value of 0.
Then capture the data label from the Payment Item. It should look similar to this: PaymentCustom 5e7e552c-2d0e-4364-b4d2-bb1784330191
Then add this to your request body:
"<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<status>sent</status>" +
"<emailSubject>Turner Pest Control - Termite Bond Quote</emailSubject>" +
"<templateId>" + templateId + "</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<name>" + custName + "</name>" +
"<email>" + custEmail + "</email>" +
"<roleName>Customer</roleName>" +
"<tabs>" +
"<numberTabs>" +
"<number>" +
"<fontColor>DarkRed</fontColor>" +
"<locked>true</locked>" +
"<tabLabel>PaymentCustom 5e7e552c-2d0e-4364-b4d2-bb1784330191</tabLabel>" +
"<value>" + txtPayment + "</value>" +
"</number>" +
"</numberTabs>" +
"</tabs>" +
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";
How a Payment Item gets turned into a number tab is beyond me, but, it works!
I'm still working on updating the payment details via API. Getting a Card declined error so I can't confirm if the payment details are getting updated.
来源:https://stackoverflow.com/questions/46456851/keep-getting-error-paymenttabs-lineitem-amount-is-missing