Contact payment

Requires authentication

HTTP Request

POST connector/api/contact-payment

Body Parameters

Parameter Type Status Description
contact_id integer required id of the contact
amount float required amount of the payment
method string optional payment methods ('cash', 'card', 'cheque', 'bank_transfer', 'other', 'custom_pay_1', 'custom_pay_2', 'custom_pay_3')
paid_on string optional transaction date format:Y-m-d H:i:s,
account_id integer optional account id
card_number string optional
card_holder_name string optional
card_transaction_number string optional
card_type string optional
card_month string optional
card_year string optional
card_security string optional
transaction_no_1 string optional
transaction_no_2 string optional
transaction_no_3 string optional
cheque_number string optional
bank_account_number string optional
note string optional payment note

Example request:

curl -X POST \
"http://erp.dstadvertising.com/connector/api/contact-payment" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"contact_id":17,"amount":453.13,"method":"cash","paid_on":"2020-07-22 15:48:29","account_id":10,"card_number":"rerum","card_holder_name":"repellendus","card_transaction_number":"mollitia","card_type":"earum","card_month":"a","card_year":"et","card_security":"quis","transaction_no_1":"sequi","transaction_no_2":"laboriosam","transaction_no_3":"repudiandae","cheque_number":"sapiente","bank_account_number":"reiciendis","note":"ut"}'

Example response (200):

{
"data": {
"amount": "20",
"method": "cash",
"paid_on": "2020-07-22 15:48:29",
"created_by": 1,
"payment_for": "19",
"business_id": 1,
"is_advance": 1,
"payment_ref_no": "SP2020\/0127",
"document": null,
"updated_at": "2020-07-22 15:48:29",
"created_at": "2020-07-22 15:48:29",
"id": 215
}
}

Example response (200):

const url = new URL(
"http://erp.dstadvertising.com/connector/api/contact-payment"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"contact_id": 17,
"amount": 453.13,
"method": "cash",
"paid_on": "2020-07-22 15:48:29",
"account_id": 10,
"card_number": "rerum",
"card_holder_name": "repellendus",
"card_transaction_number": "mollitia",
"card_type": "earum",
"card_month": "a",
"card_year": "et",
"card_security": "quis",
"transaction_no_1": "sequi",
"transaction_no_2": "laboriosam",
"transaction_no_3": "repudiandae",
"cheque_number": "sapiente",
"bank_account_number": "reiciendis",
"note": "ut"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));