Send an Invoice

Use our Invoice API to send a saved invoice.

Follow the guide below to send a saved invoice to its associated customer. Once sent, the invoice's status changes from 'saved' to 'outstanding,' and you can only update its from_contact and business_contact fields. See Send an Invoice in API Reference for field definitions.


Prerequisites

  1. See Create a Sandbox Account to sign up and log in to the Maast Manager portal.

  2. Follow the steps in Get Your API Credentials to save a sandbox ID and API key.

  3. See Authentication to format the credentials and generate your API token. (Alternatively, use the credentials as-is to test this endpoint with our 'Try It!' feature.)

  4. Follow the steps in the Create an Invoice guide to draft and save an invoice. Save the invoice_id from the request response.


Implement

  1. Write a POST request. For the request endpoint, include the invoice_id value between /invoice/ and /send. The resulting endpoint reads /platform/invoice/invoice_id/send, where the value replaces invoice_id.

  2. In the body, you can add an array of email addresses and phone numbers to receive the invoice. (U.S. phone numbers receive the invoice as an SMS if enabled for your account.)

Once formatted, your request will resemble the following code:

curl --request POST \
     --url https://api-test.maast.com/platform/invoice/22085/send \
     --header 'accept: application/json' \
     --header 'authorization: Basic OjllZGVjMjFhMzFjMHh5ejc4OWUzMGEzNDE2YWJjMTIz' \
     --header 'content-type: application/json' \
     --data '
{
     "email_address": [
          "[email protected]",
          "[email protected]"
     ],
     "phone_number": [
          11111111111,
          12222222222
     ]
}
'

Integrate

Send the configured request to your custom endpoint.

Maast will return a response like the code below:

{
  "code": 0,
  "message": "Success"
}

Check the code field in the request response: 0 confirms that you have successfully sent the invoice. If the value is something other than 0, check Platform API Response Codes in Reference.

See Send an Invoice in API Reference for response field definitions.


Test and Go Live

See our Test and Go Live guide to test your API integration and to start transacting with an active production account.