Customer Payment POST
URI
https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}/accounting-service/customer-payment Refer to our documentation on URI syntax for more information on how to construct URIs.
Description
Field description
| Field | Data type | Description | Required | Notes |
|---|---|---|---|---|
| transactionRef | String | Your unique reference for this payment. | no | Max length 64. If provided a check of the uniqueness of transactionRef AND paymentMethodCode is triggered. |
| transactionCode | String | A code used to link transactions; Link VOIDs or CAPTUREs to an AUTH An AUTH will be considered fully CAPTUREd when the sum of CAPTUREs with the same transactionCode equals the amount of the AUTH. |
no | Max length 64 |
| paymentMethodCode | String | The code of the Brightpearl Payment Method | yes | Max length 36 |
| paymentType | String | yes | AUTH, CAPTURE, PAYMENT, RECEIPT or VOID | |
| orderId | Integer | yes | ||
| currencyIsoCode | String | yes | Must be length 3 | |
| exchangeRate | Decimal | no | Must be greater than 0, rounded to 6dp | |
| amountAuthorized | Decimal | no* | Non negative values are required. Ignored unless paymentType is AUTH or VOID. | |
| amountPaid | Decimal | Valid for CAPTURE, PAYMENT, RECEIPT | no | Defaults to 0 |
| authorizationExpiry | DateTime | no* | Required when payment type is AUTH, ignored otherwise | |
| journalId | Integer | no | Inserted by Brightpearl following the creation of an SR or PP journal. Insert a valid journal ID to prevent Brightpearl from creating SR from this payment. | |
| journalRef | String | no | Will truncate anything longer than 255 characters. | |
| paymentDate | DateTime | yes | This is the date that the payment occurred. |
Example 1
Record a RECEIPT of 100 USD for sales order 2002 and return the payment id, if successful.
Request URI
/customer-payment
Request body
{
"transactionRef": "REF0001",
"transactionCode": "CODE0001",
"paymentMethodCode": "ACME_PAY",
"paymentType": "RECEIPT",
"orderId": 2002,
"currencyIsoCode": "USD",
"exchangeRate": 1.307,
"amountPaid": 100.00,
"paymentDate": "2016-06-19T15:03:17+01:00",
"journalRef": "Online order 2002 prepaid"
}
Response
{
"response": 100
}
Example 2
Record an AUTH of 50 GBP for order 2003 and return the payment id, if successful.
Request URI
/customer-payment
Request body
{
"transactionRef": "REF0002",
"transactionCode": "CODE0002",
"paymentMethodCode": "ACME_PAY",
"paymentType": "AUTH",
"orderId": 2003,
"currencyIsoCode": "GBP",
"amountAuthorized": 50.00,
"authorizationExpiry": "2016-06-19T12:00:00",
"paymentDate": "2016-06-19T12:00:00"
}
Response
{
"response": 101
}
