POST  Add Invoice


Resource

https://api.payant.ng/invoices

Parameters

client
required
Array
Client Data
company_name String
Client's company name
first_name
required
String
Client's first name
last_name
required
String
Client's last name
email
required
String
Client's email address
phone
required
String
Client's phone number
address String
Client's address
type String
Client's type Customer, Staff or Vendor
settlement_bank String
Client's settlement bank
account_number String
Client's account number
client_id
required
String
Client ID
due_date
required
String
Invoice due date MM/DD/YYYY
fee_bearer
required
String
Invoice fee bearer account or client
tokenize
String
Tokenize card used to make payment for this invoice true or false. Defaults to false
card_token
String
Card token generated from a tokenized transaction to automatically make payment for this invoice.
items
required
Array
Invoice items
item
required
String
Item's name
description
required
String
Item's description
unit_cost
required
String
Item's unit cost
quantity
required
String
Item's quantity
recipient
String
Invoice payment recipient account or wallet Defaults to account
recipient_id
String
Invoice payment recipient id (Wallet Ref.) Required if recipient is wallet
merchant_ref String
Merchant's unique invoice reference code
metadata String
Key-value pairs object

Heads up!

Only one of client or client_id is required per invoice. The client parameter will allow you to add a new customer while invoicing on the fly in case you don't have a client_id. Client will not be added if already exist.


For you to tokenize cards, please contact Payant Support.

Example

curl https://api.payant.ng/invoices \
-H "Content-Type: application/json" \
-H "Authorization: Bearer SECRET_KEY" \
-d '{ "client": {
            "first_name": "Albert",
            "last_name": "Jane",
            "email": "jane@alberthospital.com",
            "phone": "+2348012345678"
        },
        "due_date": "12/30/2016",
        "fee_bearer": "client",
        "items": [
            "item": "Website Design",
            "description": "5 Pages Website plus 1 Year Web Hosting",
            "unit_cost": "50000.00",
            "quantity": "1"
        ] 
    }' \
-X POST 
            

Response

{
  "status": "success",
  "message": "Invoice created successfully.",
  "data": {
    "id": 1,
    "company_id": "1",
    "client_id": "1",
    "reference_code": "j9CbiTN0oJe4vWhglyS2",
    "payment_id": null,
    "fee_bearer": "client",
    "mail_status": "unsent",
    "status": "0",
    "due_date": "1483056000",
    "created_at": "2016-12-21 18:46:30",
    "updated_at": "2016-12-21 18:46:30",
    "deleted_at": null,
    "client": {
        "id": 1
        "company_id": 1,
        "name": "Albert Specialist Hospital",
        "first_name": "Albert",
        "last_name": "Jane",
        "email": "jane@alberthospital.com",
        "phone": "+2348012345678",
        "website": "http://www.alberthospital.com",
        "address": "Wase II",
        "type": "Customer",
        "settlement_bank": "",
        "account_name": "",
        "account_number": "",
        "status": "1",
        "created_at": "2016-12-21 17:19:10",
        "updated_at": "2016-12-21 17:19:10",
        "deleted_at": null
    },
    "items": [
        {
            "id": "1",
            "company_id": "1",
            "client_id": "1",
            "name": "Website Design",
            "description": "5 Pages Website plus 1 Year Web Hosting",
            "quantity": "1",
            "unit_cost": "50000.00",
            "status": "0",
            "due_date": "1483056000",
            "created_at": "2016-12-21 17:19:10",
            "updated_at": "2016-12-21 17:19:10",
            "deleted_at": null
        }
    ]
  }
}