Customer Account Transaction (Customer Credit)
The customer account transaction endpoint enables the crediting of customer accounts. Credits granted via this endpoint are automatically applied to future orders by the customer (e.g. reducing the order total to pay by the amount of credit on the customer's account).
Background
This endpoint was funded by a project in the UK aimed at improving digital inclusion, which also involved the building of an integration linking POS payments with OFN customers. Customers made in-person payments via a POS device. The integration matched the email address entered on the POS device with an OFN customer record, and this endpoint was used to credit the customer's account with the amount paid.
Alternative uses for this endpoint include setting up a CSA payments system, i.e. customers pay X amount at the beginning of the season upfront, with subsequent orders deducted from their balance.
The UI can also be used to credit an account with the 'credit customer' button that displays when an order is in the 'credit owed' state, for instance by removing an item or creating a negative adjustment - see user guide.
1010.5Payment processed by POSCustomer transaction created
Unauthorized
Invalid customer ID
Missing required parameter
POST /api/v1/customer_account_transaction HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 73
{
"customer_id": 10,
"amount": 10.5,
"description": "Payment processed by POS"
}{
"data": {
"id": "1",
"type": "customer_account_transaction",
"attributes": {
"id": 1,
"customer_id": 10,
"amount": 10.5,
"currency": "AUD",
"description": "Payment processed by POS",
"balance": 10.5
},
"relationships": {
"customer": {
"data": {
"id": "text",
"type": "customer"
},
"links": {
"related": "text"
}
}
}
},
"meta": {},
"links": {}
}Last updated