Top

Customer Payments

List customer payments
GET /customerpayments
List all the payments made by your customer.
Get a customer payment
GET /customerpayments/:payment_id
Get the details of a customer payment.
Create a customer payment
POST /customerpayments
Create a payment made by your customer and you can also apply them to invoices either partially or fully.
Update a customer payment
PUT /customerpayments/:payment_id
Update an existing customer payment. You can also modify the amount applied to the invoices.
Delete a customer payment
DELETE /customerpayments/:payment_id
Delete an existing customer payment.

List customer payments

GET  /customerpayments

List all the payments made by your customer.

Parameters

customer_name string
[100]
Search payments by customer name.
Variants: customer_name_startswith and customer_name_contains
reference_number string
[100]
Search payments by reference number.
Variants: reference_number_startswith and reference_number_contains
date string
[yyyy-mm-dd]
Search payments by payment made date.
Variants: date_start, date_end, date_before and date_after
amount double Search payments by payment amount.
Variants: amount_less_than, amount_less_equals, amount_greater_than and amount_greater_equals
notes string Search payments by customer notes.
Variants: notes_startswith and notes_contains
payment_mode string
[100]
Search payments by payment mode.
Variants: payment_mode_startswith and payment_mode_contains
customer_id string Search payments by customer id.
invoice_id string Search payments by invoice id.
filter_by string Filter payments by mode.
Allowed Values: PaymentMode.All, PaymentMode.Check, PaymentMode.Cash, PaymentMode.BankTransfer, PaymentMode.Paypal, PaymentMode.CreditCard, PaymentMode.GoogleCheckout, PaymentMode.Credit, PaymentMode.Authorizenet, PaymentMode.BankRemittance, PaymentMode.Payflowpro, PaymentMode.Stripe, PaymentMode.TwoCheckout, PaymentMode.Braintree and PaymentMode.Others
search_text string
[100]
Search payments by reference number or customer name or payment description.
sort_column string Sort the payment list.
Allowed Values: customer_name, unused_amount, amount, bcy_amount, date, reference_number, account_name and payment_mode

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "customerpayments": [
    {
      "payment_id": "982000000567202",
      "payment_number": "8",
      "invoice_numbers": "INV-00001",
      "date": "2013-11-18",
      "payment_mode": "PayPal",
      "amount": 16.34,
      "bcy_amount": 16.34,
      "unused_amount": 0.00,
      "bcy_unused_amount": 0.00,
      "description": "",
      "reference_number": "78872356478",
      "customer_id": "982000000567001",
      "customer_name": "Bowman & Co"
    },
    {
      "payment_id": "982000000567190",
      "payment_number": "7",
      "invoice_numbers": "INV-00001",
      "date": "2013-11-18",
      "payment_mode": "Cash",
      "amount": 10.57,
      "bcy_amount": 10.57,
      "unused_amount": 0.00,
      "bcy_unused_amount": 0.00,
      "description": "",
      "reference_number": "99782374",
      "customer_id": "982000000567001",
      "customer_name": "Bowman & Co"
    }
  ],
  "page_context": {
    "page": 1,
    "per_page": 200,
    "has_more_page": false,
    "report_name": "Payments Received",
    "applied_filter": "PaymentMode.All",
    "sort_column": "date",
    "sort_order": "D"
  }
}

Get a customer payment

GET  /customerpayments/:payment_id

Get the details of a customer payment.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "payment": {
    "payment_id": "982000000567202",
    "customer_id": "982000000567001",
    "customer_name": "Bowman & Co",
    "payment_mode": "PayPal",
    "date": "2013-11-18",
    "exchange_rate": 1.00,
    "amount": 16.34,
    "bank_charges": 0.00,
    "tax_amount_withheld": 0.00,
    "description": "",
    "reference_number": "78872356478",
    "invoices": [
      {
        "invoice_number": "INV-00001",
        "invoice_payment_id": "982000000567204",
        "invoice_id": "982000000567036",
        "amount_applied": 16.34,
        "tax_amount_withheld": 0.00,
        "total": 153.00,
        "balance": 103.66,
        "date": "2013-11-18",
        "due_date": "2013-12-03"
      }
    ]
  }
}

Create a customer payment

POST  /customerpayments

Create a payment made by your customer and you can also apply them to invoices either partially or fully.

Request attributes

customer_id string ID of the customer.
invoices array Invoice Payment details.
invoice_id string ID of the invoice to which payment is to be applied.
amount_applied double Amount applied to the invoice.
tax_amount_withheld double Amount withheld for tax.
payment_mode string
[50]
Mode of payment for the amount received.
description string
[2000]
Description for the customer payment.
date* string
[yyyy-mm-dd]
Date the payment is made.
reference_number string
[50]
Reference number for the customer payment.
exchange_rate double Exchange rate of the currency.
amount* double Payment amount made by the customer.
bank_charges double Bank charges incurred.
contact_persons array IDs of contact persons the thank you mail has to be triggered.

Sample Request

{
  "customer_id": "982000000567001",
  "invoices": [
    {
      "invoice_id": "982000000567036",
      "amount_applied": 16.34,
      "tax_amount_withheld": 0.00
    }
  ],
  "payment_mode": "PayPal",
  "description": "",
  "date": "2013-11-18",
  "reference_number": "78872356478",
  "exchange_rate": 1.00,
  "amount": 16.34,
  "bank_charges": 0.00
}

Sample Response


Status: 201 Created
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The payment from the customer has been recorded",
  "payment": {
    "payment_id": "982000000567202",
    "customer_id": "982000000567001",
    "customer_name": "Bowman & Co",
    "payment_mode": "PayPal",
    "date": "2013-11-18",
    "exchange_rate": 1.00,
    "amount": 16.34,
    "bank_charges": 0.00,
    "tax_amount_withheld": 0.00,
    "description": "",
    "reference_number": "78872356478",
    "invoices": [
      {
        "invoice_number": "INV-00001",
        "invoice_payment_id": "982000000567204",
        "invoice_id": "982000000567036",
        "amount_applied": 16.34,
        "tax_amount_withheld": 0.00,
        "total": 153.00,
        "balance": 103.66,
        "date": "2013-11-18",
        "due_date": "2013-12-03"
      }
    ]
  }
}

Update a customer payment

PUT  /customerpayments/:payment_id

Update an existing customer payment. You can also modify the amount applied to the invoices.

Request attributes

customer_id string ID of the customer.
invoices array Invoice Payment details.
invoice_id string ID of the invoice to which payment is to be applied.
amount_applied double Amount applied to the invoice.
tax_amount_withheld double Amount withheld for tax.
payment_mode string
[50]
Mode of payment for the amount received.
description string
[2000]
Description for the customer payment.
date string
[yyyy-mm-dd]
Date the payment is made.
reference_number string
[50]
Reference number for the customer payment.
exchange_rate double Exchange rate of the currency.
amount* double Payment amount made by the customer.
bank_charges double Bank charges incurred.

Sample Request

{
  "customer_id": "982000000567001",
  "invoices": [
    {
      "invoice_payment_id": "982000000567204",
      "invoice_id": "982000000567036",
      "amount_applied": 16.34,
      "tax_amount_withheld": 0.00
    }
  ],
  "payment_mode": "PayPal",
  "description": "",
  "date": "2013-11-18",
  "reference_number": "78872356478",
  "exchange_rate": 1.00,
  "amount": 16.34,
  "bank_charges": 0.00
}

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The details of the payment received from the customer has been updated",
  "payment": {
    "payment_id": "982000000567202",
    "customer_id": "982000000567001",
    "customer_name": "Bowman & Co",
    "payment_mode": "PayPal",
    "date": "2013-11-18",
    "exchange_rate": 1.00,
    "amount": 16.34,
    "bank_charges": 0.00,
    "tax_amount_withheld": 0.00,
    "description": "",
    "reference_number": "78872356478",
    "invoices": [
      {
        "invoice_number": "INV-00001",
        "invoice_payment_id": "982000000567204",
        "invoice_id": "982000000567036",
        "amount_applied": 16.34,
        "tax_amount_withheld": 0.00,
        "total": 153.00,
        "balance": 103.66,
        "date": "2013-11-18",
        "due_date": "2013-12-03"
      }
    ]
  }
}

Delete a customer payment

DELETE  /customerpayments/:payment_id

Delete an existing customer payment.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The payment has been deleted."
}