payment_service_configuration_

Payment Service Configuration

Payment service configuration configures the payment service that has been added. It gives us a unique id that displays all its categories. The type of payment is specified, if its stripe or any other. It also displays a unique stripe key along with the date on which it was created or modified.

JSON Table

Parameter Data Type Description Default/Sample Value
success boolean Whether the API call was successful or not.
message String A message indicating the API success or failure.
data application/json A JSON object for the response data.
data/totalCount int The total number of payment configurations fetched.
data/paymentServiceConfig application/json An array of JSON objects for each payment service config is fetched and details are extracted.
data/paymentServiceConfig/service_id int The system-generated unique service id for each payment service configuration.
data/paymentServiceConfig/name String The name of the payment service configuration. “test”
data/paymentServiceConfig/is_default Boolean Generates value if the payment service configuration is default or not. 0
data/paymentServiceConfig/type String The type of payment service to be used needs to be specified. stripe
data/paymentServiceConfig/ stripe_publishable_key String This is the key of the stripe account that we are using that needs to be specified. It should be a unique combination of alphabets and numbers. pk_test_gkgqksw8 q76yhnluyo
data/paymentServiceConfig/ stripe_secret_key String This is a secret key used for authorization of the payment service config used. sk_test_
NVRuQHGEj2s TJW2gDLfSO9Vc
data/paymentServiceConfig/   date_created Date This is the date on which the payment service account was created.
data/paymentServiceConfig/ date_modified Date This is the date on which the account might have been modified.
data/paymentServiceConfig/       portals int This specifies that the account is available on which portals. The portal numbers are defined here.

Copy Sample JSON
Sample JSON
[
{
    "success": true,
    "message": "Record(s) Found",
    "data": {
        "totalCount": 8,
        "paymentServiceConfig": [
            {
                "service_id": 1,
                "name": "ak",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "pk_test_S7R3ub822bE7qS4gzTUkRaWP",
                "stripe_secret_key": "sk_test_NVRuQHGEj2sTJW2gDLfSO9Vc",
                "date_created": "2017-09-11 11:05:15.41251",
                "date_modified": "2017-11-07 08:56:14.778454",
                "portals": [
                    11,
                    10,
                    5,
                    8,
                    20,
                    21,
                    17,
                    16,
                    7,
                    9
                ]
            },
            {
                "service_id": 4,
                "name": "Strip Account Delta1",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "pk_test_wkn3iEKqrkMfJhqSIG9zbWmb",
                "stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC",
                "date_created": "2018-02-08 06:02:28.899178",
                "date_modified": null,
                "portals": []
            },
            {
                "service_id": 5,
                "name": "Strip Account Delta2",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "pk_test_wkn3iEKqrkMfJhqSIG9zbWmb",
                "stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC",
                "date_created": "2018-02-08 06:07:44.657881",
                "date_modified": null,
                "portals": []
            },
            {
                "service_id": 7,
                "name": "Stripe Account - Alpha32",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "pk_test_wkn3iEKqrkMfJhqSI89mb",
                "stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC",
                "date_created": "2018-02-12 10:23:00.833154",
                "date_modified": null,
                "portals": []
            },
            {
                "service_id": 8,
                "name": "Stripe Account - Alpha3289",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "hfhfyrutuyjgjgit97uykg",
                "stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC",
                "date_created": "2018-02-12 10:23:23.840915",
                "date_modified": null,
                "portals": []
            },
            {
                "service_id": 9,
                "name": "Stripe Account - Alpha3229",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "hfhfyrutuyjgjgit97uykg",
                "stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC",
                "date_created": "2018-02-12 12:20:01.521564",
                "date_modified": "2018-02-12 12:20:42.679814",
                "portals": []
            },
            {
                "service_id": 6,
                "name": "Stripe Account - Delta",
                "is_default": 1,
                "type": "stripe",
                "stripe_publishable_key": "pk_test_wkn3iEKqrkMfJhqSIG9zbWmb",
                "stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC",
                "date_created": "2018-02-08 09:13:44.188885",
                "date_modified": "2018-02-13 06:29:55.731076",
                "portals": []
            },
            {
                "service_id": 2,
                "name": "vv",
                "is_default": 0,
                "type": "stripe",
                "stripe_publishable_key": "pk_test_S7R3ub822bE7qS4gzTUkRaWP",
                "stripe_secret_key": "sk_test_NVRuQHGEj2sTJW2gDLfSO9Vc",
                "date_created": "2017-09-15 06:43:00.641654",
                "date_modified": "2018-02-26 06:36:57.095586",
                "portals": [
                    1,
                    4
                ]
            }
        ]
    }
}

]
API Calls

/V1.14/services/payment/config

/V1.14/services/payment/config/{config_id}

/V1.14/services/payment/config/{payment_id}

/V1.14/services/payment/config

/V1.14/services/payment/config/{config_id}

Get Payment Service Configuration

Description This API fetches the payment service configuration details of all the users based on the service id provided. Guest Manager user with the Administrator role can access this API.
Syntax
GET <Base_URL>/services/payment/config
Sample code
GET https://marketverticalanalytics.airtightnw.com/api/v1.14/services/payment/config
Request Body This API call does not require any request body parameters.
Response Body The API returns the details of the payment service config with their id, key and name.
The response is in the application/json format.

Edit Payment Service Configuration

Description This API modifies the currently exisiting payment service configuration with just the default value to be changed.
Syntax
PUT <Base_URL>/services/payment/config/{service_id}

Here,

  • service_id

    This is a system generated service id for which we need to make the changes for.

Sample code
PUT https://marketverticalanalytics.airtightnw.com/api/v1.14/services/payment/config/3
Request Body This API call in the request body asks the details of the account that has is_default value to be 1 so that the edit changes can be made.
This is the request body parameter:

{
"is_default":1
}
Response Body The API returns the details of the payment service configuration with default value 1 based on its id.
The response is in the application/json format.

Map Payment Configuration To A Portal

Description This API maps the payment configuration to the portal id that is specified.
Syntax
PUT <Base_URL>/services/payment/config/{payment_id}

Here,

  • payment_id

    This is a system generated payment id which we need to map to the portal.

Sample code
PUT https://marketverticalanalytics.airtightnw.com/api/v1.14/services/payment/config/2
Request Body This API call in the request body asks the details of the portals that need to be mapped to the payment id specified.

{
    "portals": [
        1,
        4
    ]
}
Response Body The API returns the details of the payment service configuration along with the portals that are mapped to it.
The response is in the application/json format.

Create Payment Service Configuration

Description This API fetches the details and helps to add a new payment service account. Guest Manager user with Administrator role can access this API.
Syntax
POST <Base_URL>/services/payment/config
Sample code
POST https://marketverticalanalytics.airtightnw.com/api/v1.14/services/payment/config
Request Body This API call contains the details to be added and the ‘is_default’ value. If the ‘is_default’ value is 1 then it is considered to be the default profile.
The request body is as follows:

{
	"name": "Stripe Account - Alpha3229",
	"is_default": 1,
	"type": "stripe",
	"portals": [],
	"stripe_publishable_key": "hfhfyrutuyjgjgit97uykg",
	"stripe_secret_key": "sk_test_AAtWhJI65lokWW4t9WF9pFmC"

}
Response Body The API returns the added details of the payment service account along with system generated service id.
The response is in the application/json format.

Delete Payment Service Configuration

Description This API deletes the record details for the service id specified.
Guest Manager users with Administrator role can access this API.
Syntax
DELETE <Base_URL>/services/payment/config/{service_id}

Here,

  • service_id

    This is the system generated service id for the deletion of the records for the particular id.

Sample code
DELETE https://marketverticalanalytics.airtightnw.com/api/v1.14/services/payment/config/6
Request Body This API call does not require any request body parameters.
Response Body The API returns the value of the payment service id that has been deleted from the database.
The response is in the application/json format.