Skip to content

Payment Modes

Overview

The payment mode API enables the creation, retrieval, updating, and deletion of payment mode records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.

Create

Endpoint: /api/message/payment_modes/{ Company }

This API will create a new Payment mode.

  • Method: POST
  • Content-Type: application/json
  • Authentication: Bearer <token>

Request Body:

json
{ 
    "data_set": "<Data-set>",             //string
    "src_paym": "<source-payment-mode>",  //string
    "src_dsca": "<source-description>",   //string
}

Fields Details:

Field NameDescriptionData TypeLength
data_setData SetString10
src_paymSource Payment CodesString3
src_dscaSource Payment DescriptionString120

Response Body: (Status: 200)

json
{
    "data_set": "<Data-set>",
    "src_dsca": "<source-description>",
    "src_paym": "<source-payment-mode>",
}

Fields Details:

Field NameDescriptionData TypeExample
data_setData SetString"Dataset1"
src_dscaSource Payment DescriptionString'CHEQUE PAYMENT"
src_paymSource Payment CodesString"CQ5"

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Response Body: (Status: 400 - Bad Request)

When both the Data set and Source Payment Mode is already present in the database:

json
{
    "message": "Record already exists!"
}

Response Body: (Status: 400 - Bad Request)

When invalid or wrong Data set is passed:

json
{
    "message": "Reference Error"
}

Response Body: (Status: 400 - Bad Request)

When invalid or wrong payment mode is passed:

json
{
    "message": "Reference Error: Payment Mode."
}

Response Body: (Status: 400 - Bad Request)

When there is an invalid data type is passed:

json
{
    "message": "Invalid Data Type"
}

Response Body: (Status: 500 - Internal Server Error)

When the mandatory fields are passed as an empty field:

json
{
    "message":  "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'|Validation 'isNotEmpty' failed for field 'src_paym'"
}

Update

Endpoint: /api/message/payment_modes/{ Company }

This API will update a Payment mode.

  • Method: PUT
  • Content-Type: application/json
  • Authentication: Bearer <token>

Request Body:

json
{
    "data_set": "<Data-set>",            //string
    "src_paym": "<source-payment-mode>", //string
    "src_dsca": "<source-description>",  //string
}

Response Body: (Status: 200)

json
{  
    "data_set": "<Data-set>",
    "dsca": "<description>",
    "paym": "<payment>",
    "src_dsca": "<source-description>",
    "src_paym": "<source-payment-mode>",
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Response Body: (Status: 400 - Bad Request)

When invalid or wrong Payment mode is passed:

json
{
    "message": "Reference Error: Payment Mode."
}

Response Body: (Status: 400 - Bad Request)

When there is an invalid data type is passed:

json
{
    "message": "Invalid Data Type"
}

Response Body: (Status: 400 - Bad Request)

When you are trying to update both the Data set and Source payment mode:

json
{
    "message": "Record not found!"
}

Response Body: (Status: 500 - Internal Server Error)

When the mandatory fields are passed as an empty field:

json
{
    "message":  "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'|Validation 'isNotEmpty' failed for field 'src_paym'"
}

Delete

Endpoint: /api/message/payment_modes/{ Company }/{ record_id }

This API will delete a Payment mode.

  • Method: DELETE
  • Authentication: Bearer <token>

Response Body: (Status: 200)

json
{
    "Message": "Message Deleted Sucessfully!"
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Response Body: (Status: 500 - Internal Server Error)

When invalid or wrong Payment mode id is paased:

json
{
    "Message": "Unable to Delete Record - Invalid Data Type"
}

Get

Endpoint: /api/message/payment_modes/{ Company }/{ record_id }

This API will get a Payment mode.

  • Method: GET
  • Authentication: Bearer <token>

Response Body: (Status: 200)

json
{
    "data_set": "<Data-set>",
    "dsca": "<description>",
    "paym": "<payment>",
    "src_dsca": "<source-description>",
    "src_paym": "<source-payment-mode>",
}

Response Body: (Status: 200)

When invalid or wrong Payment mode id is paased:

json
{
    "message": "null"
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Get All

Endpoint: /api/messages/payment_modes/{ Company }/{ PageSize }/{ PageNumber }

This API will get all Payment modes.

  • Method: GET
  • Authentication: Bearer <token>

Response Body: (Status: 200)

json
[
    {
        "data_set": "<Data-set>",
        "dsca": "<description>",
        "paym": "<payment>",
        "src_dsca": "<source-description>",
        "src_paym": "<source-payment-mode>",
    },
    .
    .
    .
]

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}