In this example we'll go through all of the steps and give examples on what you'll need to do to implement invoice creation and management. Once you've read through this guide you'll know everything that is required by us for you to use our invoice system.
Let's assume you operate a business and would like to use our platform to create and send professional invoices to your customers.
You have a customer registered on your site called John Doe. He is a recurring customer on your site, and his customer ID in your system is Customer:US:123456. You want to create an invoice for services rendered worth 100 USD. Let's assume the invoice created in your system has an ID of Invoice:INV-ABC123-2025.
Once you have the details collected on your end, you can then create the invoice in our system. This example will guide you through the details you need to set and what calls you need to make.
All API calls on Money Graph are authenticated. API requests made without authorization will fail with the status code 401: Unauthorized.
If you think your keys may have been compromised (for instance, you accidentally committed them to Git), you should immediately generate new ones using the Generate new keys button on the Settings> API & Webhook page on your dashboard. This will invalidate all existing keys and give you a new set, and you can then update your app to use the new ones.
The entity represents who you are creating the invoice for or on behalf of. It is also called the customer. There are two types of entities:
The entity type must be specified when creating the entity.
To create professional-looking invoices, you can customize the appearance with headers and signatures:
When creating the invoice, you may or may not specify invoice header or signature but for good user experience, it's required you do so.
It's advised you upload high quality images of the logo and signature image to your own server and then you provide the URL when creating the aforementioned resources.
When an invoice is created, you can specify up to 5 notification emails. These are like BCC for emails. Notifications will be sent to these emails when the invoice is paid by the entity.
First step is setting up the customer details. Generally you'll need to send us the following information for every customer and we will return a customer id:
{
"entity_type": "company",
"first_name": "Jon",
"last_name": "Doe",
"email": "[email protected]",
"phone": "9051194087",
"country": "NG",
"address": "NO 2 East lane example street",
"city": "Benin",
"state": "ED",
"postal_code": "300282",
"company_name": "EaglesTech Enterprise"
}
Next, set up your invoice header. Create an invoice header with your business branding:
{
"email": "[email protected]",
"phone": "+14185438090",
"country": "US",
"company_name": "ABC Corporation",
"address": "NO 2 Eastgate lands, Westmidlands",
"city": "Baltimore",
"state": "MD",
"postal_code": "21201",
"website": "",
"image_size": 20,
"image_url": "https://cdn.pixabay.com/photo/2015/06/30/11/33/porsche-826385_1280.jpg"
}
Set up your invoice signature to appear at the bottom of invoices. Create an invoice signature:
{
"title": "Third Signature",
"image_size": 23,
"image_url": "https://cdn.pixabay.com/photo/2020/11/03/15/32/man-5710164_1280.jpg"
}
Finally, tie everything together by creating the invoice. Create an invoice with the customer, items, and notification emails:
{
"currency": "usd",
"discount_type": "fixed",
"discount_value": 0.5,
"tax_type": "percentage",
"tax_value": 25,
"items": [
{
"description": "Honey beans",
"quantity": 2,
"amount": 4500
},
{
"description": "Sliced Bread",
"quantity": 2,
"amount": 1500
}
],
"title": "INV-ABC123-20255",
"customer": "89a394dd-9571-4a3a-833c-5e880084d4c9",
"due_date": "2025-10-20",
"emails": [
{"email": "[email protected]"},
{"email": "[email protected]"},
{"email": "[email protected]"},
{"email": "[email protected]"}
],
"header": "cc496f0c-05ac-4a1e-bb9f-fb878278b5a9",
"signature": "2f5378ea-2291-4f34-b531-a73211d8649c",
"invoice_customer_signature": true,
"memo": "Pay for clothes"
}
You can update an invoice before it's paid. Update an invoice by providing the invoice ID and the fields you want to change. All fields are optional when updating.
Once the invoice is created and sent to the customer, our system will send notifications to the specified email addresses when the invoice is paid. You can also configure webhook endpoints in your dashboard to receive real-time notifications about invoice status changes, payments, and other important events.