This is An Online API for Generating Receipts PDF for Payments.
There is a swagger UI to interact with the API at Dukka-API API.
The API uses JWT Bearer Token For Authenticating Users.
To authenticate an API request, you should provide your JWT Token in the Authorization
header. For example
{"Authorization": "Bearer <jwt access token>"}
access
token expires every 120
minutes and refresh
token expires every 2 days
.
The API response is in the following format:
{
"status": bool,
"message": string,
"error_code": integer,
"data": json object | dictionary
}
- The
success
attribute describes if the api call was successfull or not. - The
message
attribute contains a message commonly used to indicate errors or, in the case of deleting a resource, success that the resource - was properly deleted. - The
error_code
attribute indicates the type of error if any and it isnull
for a successfull request.100
representsvalidation errors
and200
represents server errors. - The
data
attribute contains any other metadata associated with the response. This will be an escaped string containing JSON data ornull
.
Gophish returns the following status codes in its API:
Status Code | Description |
---|---|
200 | OK |
201 | CREATED |
400 | BAD REQUEST |
404 | NOT FOUND |
500 | INTERNAL SERVER ERROR |
POST /api/create_user/
Parameter | Type | Description |
---|---|---|
api_key |
string |
Required. Your Gophish API key |
{
"email" : string,
"password" : string
}
POST /api/login/
{
"email" : string,
"password" : string
}
{ "refresh": "string", "access": "string" }
POST /api/token/refresh/
{
"refresh" : string
}
{ "access": "string" }
POST /api/receipt/
{
"company_name": "Dukka Inc",
"company_address": "8 Olusegun Aina St, Ikoyi 106104, Lagos, Nigeria.",
"customer_name": "Oluwatobi Emmanuel",
"customer_email": "[email protected]",
"customer_address": "No 20, Ogunlana Drive, Surulere, Lagos, Nigeria.",
"customer_mobile": "09034678789",
"items": [
{
"description": "Samsung Buds Live Gold",
"quantity": 1,
"unit_price": "70000"
},
{
"description": "Samsung S21 Ultra Black",
"quantity": 1,
"unit_price": "550000"
}
]
}
{
"status": true,
"error_code": null,
"message": "Receipt Generated Successfully",
"data": {
"link": "https://res.cloudinary.com/teepy/image/upload/v1/media/receipts/recpt-2A0FDF26FEF_kolxvo"
}
}
GET /api/receipt/
{
"status": true,
"error_code": null,
"message": "success",
"data": [
{
"rid": "5F680B12228",
"file": "https://res.cloudinary.com/teepy/image/upload/v1/media/receipts/recpt-5F680B12228.pdf",
"data": {
"company_name": "string",
"company_address": "string",
"customer_name": "string",
"customer_email": "[email protected]",
"customer_address": "string",
"customer_mobile": "string",
"items": [
{
"description": "string",
"quantity": 1,
"unit_price": "500"
}
]
}
}
]
}