API

API - system program interface for interacting with billing.


All requests are sent to the address https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/, where:

id_reseller - id reseller received from the administrator;

secret_key - secret key received from the administrator.

Transfer methods GET or POST depending on the type operations.

A successful response will always be in the data wrapper.

Answer with an error in the error wrapper. Example:


{
"error": {
    "message": "Not correct secret key reseller Vw32papADe"
    }
}


Options get

Description: get your connection settings.

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/options

Input parameters: none

Answer example:


{
    "data": {
        "reseller": 2,
        "key": "XXXXXXXXX",
        "name": "testSite",
        "notifications": {
            "email": "[email protected]",
            "telegram": "5236985236"
        },
        "callback": {
            "payments": {
                "success": "https://mysite.com/payments/success/{UUID}",
                "error": "https://mysite.com/payments/error/{UUID}"
            }
        },
        "webhook" : {
            "payments": {
                "success": "https://mysite.com/webhook/success/",
                "error": "https://mysite.com/webhook/error/"
            }
        }
    }
}


Countries list

Description: getting a list of countries used in the system.

Method: GET

Address: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/countries

Input parameters: none

Answer example:


{
    "data": [
        {
            "id": 1,
            "name": "United States of America",
            "iso_3166_1": "US",
            "short_name": "USA"
        },
        {
            "id": 2,
            "name": "Austria",
            "iso_3166_1": "AT",
            "short_name": "Austria"
        },
        ...
        ]
}


Payment system list

Description: Get a list of payment systems available to the reseller.

Method: GET

Address: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/payment-systems

Input parameters: none

Answer example:


{
    "data": {
        "reseller": 2,
        "payment_systems": [
            {
                "id_payment_system": 1,
                "name": "CP LAM MSC TV"
            }
        ]
    }
}


Client get

Description: getting a client by id.

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/clients

Input parameters:

Parameter Format Application Description
id_client int required id client

Answer example:


{
    "data": {
        "reseller": 2,
        "id_client": 12,
        "name": "Test Test",
        "country": {
            "id": 102,
            "name": "Norway",
            "iso_3166_1": "NO",
            "short_name": "Norvegia"
        },
        "city": null,
        "postal_code": null,
        "address": null,
        "phone": null,
        "e_mail": "[email protected]",
        "description": "test info",
        "created_at": "2023-08-17 08:22:55"
    }
}


Client find by email

Description: getting a client by email.

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/clients/find/email

Input parameters:

Parameter Format Application Description
email string(email) required email client

Answer example:


{
    "data": {
        "reseller": 2,
        "id_client": 12,
        "name": "Test Test",
        "country": {
            "id": 102,
            "name": "Norway",
            "iso_3166_1": "NO",
            "short_name": "Norvegia"
        },
        "city": null,
        "postal_code": null,
        "address": null,
        "phone": null,
        "e_mail": "[email protected]",
        "description": "test info",
        "created_at": "2023-08-17 08:22:55"
    }
}


Client create

Description: create client.

Method: POST

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/clients/create

Input parameters:

Parameter Format Application Description
name string (max:100) required name client
id_country int (exists:countries) required id country from client
e_mail string (email) required email client
city string (max:255) optional City from client
postal_code string (max:255) optional Code postal from client
address string (max:255) optional Address from client
phone string (max:255) optional Phone client
description string (max:500) optional Description

Answer example:


{
    "data": {
        "reseller": 2,
        "id_client": 12,
        "name": "Test Test",
        "country": {
            "id": 102,
            "name": "Norway",
            "iso_3166_1": "NO",
            "short_name": "Norvegia"
        },
        "city": null,
        "postal_code": null,
        "address": null,
        "phone": null,
        "e_mail": "[email protected]",
        "description": "test info",
        "created_at": "2023-08-17 08:22:55"
    }
}


Client update

Description: update client.

Method: POST

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/clients/update

Input parameters (Only fields sent in the request are updated):

Parameter Format Application Description
id_client int required id client
name string (max:100) optional name client
id_country int (exists:countries) optional id country from client
city string (max:255) optional City from client
postal_code string (max:255) optional Code postal from client
address string (max:255) optional Address from client
phone string (max:255) optional Phone client
description string (max:500) optional Description

Answer example:


{
    "data": {
        "reseller": 2,
        "id_client": 12,
        "name": "Test Test",
        "country": {
            "id": 102,
            "name": "Norway",
            "iso_3166_1": "NO",
            "short_name": "Norvegia"
        },
        "city": null,
        "postal_code": null,
        "address": null,
        "phone": null,
        "e_mail": "[email protected]",
        "description": "test info",
        "created_at": "2023-08-17 08:22:55"
    }
}


Client delete

Description: delete client.

Method: POST

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/clients/delete

Input parameters:

Parameter Format Application Description
id_client int required id client

Answer example:


{
    "data": {
        "success": 1
    }
}


Payments get

Description: getting payments from client.

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/payments

Input parameters:

Parameter Format Application Description
id_client int required id client

Answer example:


{
    "data": [
        {
            "reseller": 2,
            "id_payment": 1613,
            "uuid_payment": "2a7bcf3804dc71895222bdd5f95e64444ce51654",
            "client": {
                "reseller": 2,
                "id_client": 12,
                "name": "Test Test",
                "country": {
                    "id": 102,
                    "name": "Norway",
                    "iso_3166_1": "NO",
                    "short_name": "Norvegia"
                },
                "city": null,
                "postal_code": null,
                "address": null,
                "phone": null,
                "e_mail": "[email protected]",
                "created_at": "2023-08-17 08:22:55"
            },
            "payment_system": {
                "id_payment_system": 1,
                "name": "CP LAM MSC TV"
            },
            "price": "290.00",
            "period": 12,
            "success": 1,
            "error_message": "",
            "paid_at": "2023-10-17 15:44:30",
            "created_at": "2023-10-06 14:42:38",
            "IpAddress": "77.16.74.241",
            "IpCountry": "NO",
            "CardFirstSix": "469279",
            "CardLastFour": "7815",
            "CardExpDate": "07/25",
            "CardType": "Visa",
            "CardCategory": "Visa Classic ()",
            "CardProduct": "F",
            "Issuer": "Bank Norwegian As",
            "description": "test info",
            "url_success": null,
            "url_error": null
        },
        {
            "reseller": 2,
            "id_payment": 2337,
            "uuid_payment": "d0e22df5b52f9fad10e407e6cef36430e6cac206",
            "client": {
                "reseller": 2,
                "id_client": 12,
                "name": "Test Test",
                "country": {
                    "id": 102,
                    "name": "Norway",
                    "iso_3166_1": "NO",
                    "short_name": "Norvegia"
                },
                "city": null,
                "postal_code": null,
                "address": null,
                "phone": null,
                "e_mail": "[email protected]",
                "created_at": "2023-08-17 08:22:55"
            },
            "payment_system": {
                "id_payment_system": 1,
                "name": "CP LAM MSC TV"
            },
            "price": "140.00",
            "period": 12,
            "success": 0,
            "error_message": null,
            "paid_at": null,
            "created_at": "2023-11-03 19:20:02",
            "IpAddress": null,
            "IpCountry": null,
            "CardFirstSix": null,
            "CardLastFour": null,
            "CardExpDate": null,
            "CardType": null,
            "CardCategory": null,
            "CardProduct": null,
            "Issuer": null,
            "description": null,
            "url_success": null,
            "url_error": null
        },
    ]
}


Payment get by id

Description: getting payment by id.

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/payments/id

Input parameters:

Parameter Format Application Description
id_payment int required id payment

Answer example:


{
    "data": {
            "reseller": 2,
            "id_payment": 1613,
            "uuid_payment": "2a7bcf3804dc71895222bdd5f95e64444ce51654",
            "client": {
                "reseller": 2,
                "id_client": 12,
                "name": "Test Test",
                "country": {
                    "id": 102,
                    "name": "Norway",
                    "iso_3166_1": "NO",
                    "short_name": "Norvegia"
                },
                "city": null,
                "postal_code": null,
                "address": null,
                "phone": null,
                "e_mail": "[email protected]",
                "created_at": "2023-08-17 08:22:55"
            },
            "payment_system": {
                "id_payment_system": 1,
                "name": "CP LAM MSC TV"
            },
            "price": "290.00",
            "period": 12,
            "success": 1,
            "error_message": "",
            "paid_at": "2023-10-17 15:44:30",
            "created_at": "2023-10-06 14:42:38",
            "IpAddress": "77.16.74.241",
            "IpCountry": "NO",
            "CardFirstSix": "469279",
            "CardLastFour": "7815",
            "CardExpDate": "07/25",
            "CardType": "Visa",
            "CardCategory": "Visa Classic ()",
            "CardProduct": "F",
            "Issuer": "Bank Norwegian As",
            "description": "test info",
            "url_success": null,
            "url_error": null
        }
}


Payment get by uuid

Description: getting payment by uuid.

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/payments/uuid

Input parameters:

Parameter Format Application Description
uuid_payment string (size:40) required uuid payment

Answer example:


{
    "data": {
            "reseller": 2,
            "id_payment": 1613,
            "uuid_payment": "2a7bcf3804dc71895222bdd5f95e64444ce51654",
            "client": {
                "reseller": 2,
                "id_client": 12,
                "name": "Test Test",
                "country": {
                    "id": 102,
                    "name": "Norway",
                    "iso_3166_1": "NO",
                    "short_name": "Norvegia"
                },
                "city": null,
                "postal_code": null,
                "address": null,
                "phone": null,
                "e_mail": "[email protected]",
                "created_at": "2023-08-17 08:22:55"
            },
            "payment_system": {
                "id_payment_system": 1,
                "name": "CP LAM MSC TV"
            },
            "price": "290.00",
            "period": 12,
            "success": 1,
            "error_message": "",
            "paid_at": "2023-10-17 15:44:30",
            "created_at": "2023-10-06 14:42:38",
            "IpAddress": "77.16.74.241",
            "IpCountry": "NO",
            "CardFirstSix": "469279",
            "CardLastFour": "7815",
            "CardExpDate": "07/25",
            "CardType": "Visa",
            "CardCategory": "Visa Classic ()",
            "CardProduct": "F",
            "Issuer": "Bank Norwegian As",
            "description": "test info",
            "url_success": null,
            "url_error": null
        }
}


Payment create

Description: create payment.

Method: POST

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/payments/create

Input parameters:

Parameter Format Application Description
id_client integer required id client
price numeric required numeric
period integer required period by months
id_payment_system integer optional/required * id payment system
description string (max:500) optional Description
url_success string (max:255) optional Go to the specified link after successful payment
url_error string (max:255) optional Going to the specified link after unsuccessful payment

Answer example:


{
    "data": {
            "reseller": 2,
            "id_payment": 1613,
            "uuid_payment": "2a7bcf3804dc71895222bdd5f95e64444ce51654",
            "client": {
                "reseller": 2,
                "id_client": 12,
                "name": "Test Test",
                "country": {
                    "id": 102,
                    "name": "Norway",
                    "iso_3166_1": "NO",
                    "short_name": "Norvegia"
                },
                "city": null,
                "postal_code": null,
                "address": null,
                "phone": null,
                "e_mail": "[email protected]",
                "created_at": "2023-08-17 08:22:55"
            },
            "payment_system": {
                "id_payment_system": 1,
                "name": "CP LAM MSC TV"
            },
            "price": "290.00",
            "period": 12,
            "success": 1,
            "error_message": "",
            "paid_at": "2023-10-17 15:44:30",
            "created_at": "2023-10-06 14:42:38",
            "IpAddress": "77.16.74.241",
            "IpCountry": "NO",
            "CardFirstSix": "469279",
            "CardLastFour": "7815",
            "CardExpDate": "07/25",
            "CardType": "Visa",
            "CardCategory": "Visa Classic ()",
            "CardProduct": "F",
            "Issuer": "Bank Norwegian As",
            "description": "test info",
            "url_success": null,
            "url_error": null

        }
}


Payment delete

Description: delete payment

Method: POST

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/payments/delete

Input parameters:

Parameter Format Application Description
id_payment integer required id payment

Answer example:


{
    "data": {
        "success": 1
    }
}


Payment of payment

In order for the client to pay the payment you created, you need to send the client a link like:

https://payxtoday.com/pay/{uuid_payment}

After payment or payment error, the system will go to the address that you must provide to the administrator will be added to the address {uuid_payment}

For example:

Description Url
Payment link https://payxtoday.com/pay/17ba0791499db908433b80f37c5fbc89b8700842
Successful payment Send to

https://mysite.com/payment/success/17ba0791499db908433b80f37c5fbc89b8700842

or

https://mysite.com/success?ppuuid=17ba0791499db908433b80f37c5fbc89b8700842

Payment error Send to

https://mysite.com/payment/error/17ba0791499db908433b80f37c5fbc89b8700842

or

https://mysite.com/error?ppuuid=17ba0791499db908433b80f37c5fbc89b8700842

This way you can determine whether the client paid or did not pay. In any case, you can always request payment information (Payment get by id or Payment get by uuid) and find out the payment status there.


Webhook

You can set up sending Webbooks to your address.

Enabling and disabling Webbooks, as well as setting up addresses, is done through the administrator.

The system provides two types of notifications:

Successful payment

If payment is successful, a POST request is sent to the address you provided.

Data type


{
        "reseller": 2,
        "id_client" => 123456,
        "id_payment": 123,
        "uuid_payment": "4523698skjsjsskj2k2jkbhs",
        "id_payment_system": 1,
        "period": 1,
        "price": 100,
        "success": 1,
        "paid_at": "2024-01-01 00:01:05",
        "created_at": "2024-01-01 00:01:00",
        "description": "order 125"
}

Wrong payment

In case of payment error, a POST request is sent to the address you provided.

Data type


{
        "reseller": 2,
        "id_client" => 123456,
        "id_payment": 123,
        "uuid_payment": "4523698skjsjsskj2k2jkbhs",
        "id_payment_system": 1,
        "period": 1,
        "price": 100,
        "success": 0,
        "error_message": "5051 (Insufficient funds)",
        "created_at": "2024-01-01 00:01:00",
        "description": "order 125"
}


Webhook testing

To test Webhook, you can use two requests.

After sending requests, a Webhook with test data is immediately sent to you.

Successful payment

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/webhook/test/success

Input parameters: none

Answer example:


{
    "data": {
        "sent": 1
    }
}

Wrong payment

Method: GET

URL: https://payxtoday.com/api/v1/{id_reseller}/{secret_key}/webhook/test/error

Input parameters: none

Answer example:


{
    "data": {
        "sent": 1
    }
}