Add Payment

Last updated 5 months ago

post
Add Payment

[PlatformAddress]/api/1.0
/invoice?action=AddPayment
Add a payment against a specific invoice within iVvy. Payments will only be accepted if that amount is outstanding on the invoice. Over pays will not be accepted.
Request
Response
Form Data Parameters
invoiceId
required
integer
The unique id of the invoice to which the payment is applied
paidDate
required
string
The date & time of the payment (datetime)
amountPaid
required
number
The payment amount
paymentMethod
required
integer
The payment method
receiptNum
required
string
A receipt number
reconciledDate
optional
string
The date & time the payment was reconciled
cardType
required
string
The credit card type Required if paymentMethod = credit card
feePercentage
optional
number
The credit card fee percentage. The fee amount must be included in amountPaid
feeExcludedTaxIds
optional
array
An array of tax ids which will be excluded from the payment.
chequeNumber
required
string
The cheque number Required if paymentMethod = "cheque"
chequeDrawerName
optional
string
The cheque drawer number If paymentMethod = “cheque”
chequeBankBranch
optional
string
The cheque bank branch If paymentMethod = “cheque”
eftTransferDate
optional
string
The payment transfer date (datetime) If paymentMethod = “direct deposit”
eftPaymentReference
optional
string
The payment reference If paymentMethod = “direct deposit”
200: OK
{
"Success": true,
"Id": 5452
}

Example Request

Example: Add Payment to an invoice
{
"invoiceId": "156",
"paidDate": "2018-07-24 00:00:00",
"amountPaid": 10,
"paymentMethod": 8,
"receiptNum": "123",
"feePercentage": 10
}

paymentMethod

0 = Unknown 1 = Credit Card 2 = BPay 3 = Direct Deposit 4 = PayPal 5 = Cheque 6 = Cash 8 = Accounts Receivable 9 = EFTPOS 10 = WriteOff 11 = Point of Sale 12 = Wire Transfer

cardType

0 = Unknown 1 = Visa 2 = Master Card 3 = Amex 4 = Diners

Returns

Property

Description

success

Whether or not the payment was added to the invoice

id

The unique identifier of the payment

Throws

Code

Description

24235

The request is empty

24236

Invalid payment method

24237

Cannot use "gateway" or "paymentId" to make the invoice payment

24238

Unable to find invoice

24239

The payment details are invalid

24240

An unknown error has occurred