Invoices


Introduction

On this page

Moyasar e-Invoices Overview

Moyasar e-invoices is an additional service dedicated to provide online payment for websites and electronic system with a structured and secure mechanism. Which allows the merchants to create an e-invoices through Moyasar’s dashboard or Moyasar’s API and to be sent or presented to customers manually or automatically.


Creating Invoice Via Moyasar’s Dashboard

In the Dashboard, you can:

Click here for the steps to create an invoice through the Dashboard.


Creating Invoice Via Moyasar’s API

Moyasar e-Invoices APIs enable merchants to generate invoices programmatically and integrate it with their online stores and backend systems.


Before Starting

Before you start integrating with Moyasar API, make sure you complete these steps:

  1. Sign up for a Moyasar test account at https://dashboard.moyasar.com/
  2. Get your API Key. To authenticate your API request.

For more, refer to Get started with Moyasar.


Step 1: creating an invoice

Start by sending a request to Moyasar invoices create endpoint to create an invoice in your server.

https://api.moyasar.com/v1/invoices

You will need to specify the following required data to be included in the request:

Parameter Description
amount The amount should be in the smallest currency unit. Means, ( 100 Halals to charges 1 Riyal )
currency 3-letter ISO code for currency. (default: SAR)
description An arbitrary string which you can attach to a invoice object. This may include a description about the merchandise or the service that your customer is billed for. Invoice description is displayed on the invoice alongside with the amount when the invoice is presented to the user.
expired_at Specifies when the invoice will get expired. An expired invoice cannot have payment attempts as its status will be expired.

Invoice Notification

Invoices support asynchronous notification callback when the status changes from initiated to paid upon user successful payment.

To enable notification for an invoice, you’d provide:

Parameter Description
callback_url Endpoint url in your site to receive invoice updates. It should be able to receive HTTP POST requests in order to receive notification POST request from API containing the invoice object as a JSON payload.

For more technical details about Moyasar invoices API, please refer to API docs

Step 2: Share with customer

Then we will give you a link to the invoice in our website, you can send that link to the user or redirect him to the invoice page, then we will handle the payment form and validations.


Last Modified : Feb 2019