Add Invoice

post
Add Invoice

https://api.payant.ng/invoices
Add Invoices
Request
Response
Headers
Authorization
required
string
Your Payant API Key prefixed with "Bearer "
Body Parameters
payment_methods
optional
string
Payment methods to be allowed on this invoice seperated by comma "," card, account, phone, qr
currency
optional
string
3 Character currency code for invoice NGN or USD
client
required
array
Client Data - See Table Below for Structure
client_id
required
string
Client ID - Only required if client above does not exist in request.
due_date
required
string
Invoice due date MM/DD/YYYY
free bearer
required
string
Invoice fee bearer account or client
tokenize
optional
string
Tokenize card used to make payment for this invoice true or false, defaults to false.
card_token
optional
string
Card token generated from a tokenized transaction to automatically make payment for this invoice.
items
required
array
Invoice items - See Table Below for Structure
merchant_ref
optional
string
Merchant's unique invoice reference code
metadata
optional
string
Key-value pairs object
200: OK
{
"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
}
]
}
}

Client Data

Parameters

Description

company_name

String

Client's company or full name

first_name required

String Client's first name

last_name required

String Client's last name

email required

String Client's email address

email_cc

String

Comma separated emails to copy for invoices and payment receipts

phone required

String Client's phone number

address

String Client's address

Items Object Data

Parameter

Description

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

Heads up!

Please contact Payant Support for you to start tokenizing cards and accepting recurring payments.

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.

Request

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
}
]
}
}