How The Integration Works
4 min
outline when a return is lodged in refundid, a sales credit is created in brightpearl against the original sales order the credit is the brightpearl side record of the return, and everything that happens afterwards hangs off it finding the original order refundid searches brightpearl for the sales order matching the customer's order number only sales orders are considered purchase orders and existing credits that happen to share the same reference are ignored, so a customer returning against an order that has already been partly credited still lands on the right order if no sales order can be found, an integration error docid 2cjxjmvexrl9kpvc2nozd is raised against the return in your dashboard so your team can investigate what the sales credit inherits the credit is created as a child of the original order and copies its settings so it posts the same way the sale did customer warehouse sales channel price mode (tax inclusive or exclusive) currency, and the exchange rate where the order was placed in a foreign currency credit rows one row is created per returned item items are matched to the original order by sku, which lets each row carry through the brightpearl product the nominal (gl) code the item was sold against the tax code and rate that applied on the sale row values are split into net and tax using the tax on the return, so a tax inclusive order credits the correct net amount rather than crediting the gross value each row also carries the refundid line reference that reference is what allows the return to be closed back in refundid later, item by item return shipping deductions where the customer paid for return shipping and that cost was deducted from their refund, a negative row is added to the credit for the shipping amount, posted against the shipping nominal code from the original order the credit total therefore matches what the customer is actually refunded, rather than the item value alone linking the credit back to the return the credit's reference fields carry the refundid rma reference and return id this is how the integration recognises its own credits when brightpearl notifies us of a change, and how it tells an instant return apart from a standard return credits created by hand in brightpearl, or by other integrations, are ignored