Skip to content

Purchase Transactions

Manage your Purchase Transactions in Moneybird.

Working with Purchase Transactions

This section covers how to interact with Moneybird’s Purchase Transactions API. You can create, retrieve, update, and delete purchase transactions.

Basic Operations

Get a Purchase Transaction

Retrieve a purchase transaction by its ID.

$purchaseTransaction = $client->purchaseTransactions()->get('123456789');

List Purchase Transactions

Get a paginated list of purchase transactions.

$purchaseTransactions = $client->purchaseTransactions()->paginate();
// Iterate through the pages
foreach ($purchaseTransactions as $purchaseTransaction) {
echo $purchaseTransaction->reference . ': ' . $purchaseTransaction->price;
}

Get All Purchase Transactions

Get all purchase transactions at once.

$allPurchaseTransactions = $client->purchaseTransactions()->all();
// Iterate through all purchase transactions
foreach ($allPurchaseTransactions as $purchaseTransaction) {
echo $purchaseTransaction->reference . ': ' . $purchaseTransaction->price;
}

Create a Purchase Transaction

Create a new purchase transaction.

$data = [
'contact_id' => '123456789',
'reference' => 'TRANS-2023-001',
'date' => '2023-01-15',
'due_date' => '2023-02-15',
'price' => '250.00',
'currency' => 'EUR',
'payment_method' => 'bank_transfer',
'details' => [
[
'description' => 'Office Equipment Purchase',
'price' => '250.00',
'ledger_account_id' => '123456'
]
]
];
$purchaseTransaction = $client->purchaseTransactions()->create($data);

Update a Purchase Transaction

Update an existing purchase transaction.

$updateData = [
'reference' => 'TRANS-2023-001-UPDATED',
'due_date' => '2023-03-01'
];
$purchaseTransaction = $client->purchaseTransactions()->update('123456789', $updateData);

Delete a Purchase Transaction

Delete a purchase transaction.

$client->purchaseTransactions()->delete('123456789');

Purchase Transaction Properties

When working with purchase transactions, you’ll have access to the following properties:

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the purchase transaction belongs to
contact_idstringID of the contact associated with the purchase transaction
referencestringReference number or code for the purchase transaction
datestringDate of the purchase transaction
due_datestringDue date for payment
pricestringTotal price of the purchase transaction
currencystringCurrency code (e.g., ‘EUR’, ‘USD’)
payment_methodstringMethod of payment (e.g., ‘bank_transfer’, ‘cash’)
statestringCurrent state of the purchase transaction
detailsarrayLine items and details of the purchase transaction
created_atstringISO 8601 timestamp of when the purchase transaction was created
updated_atstringISO 8601 timestamp of when the purchase transaction was last updated

Note: See the official API reference for the complete list of available properties.

Further reading