Payments


Payments Resource

Field Type Description
ID UUID Neopay internal unique UUID of the Payment
institutionId ID Id of Instituition
application_id UUID UUID of Application
customer.id UUID UUID of Customer (Required if you don't send the customer.email)
customer.email Email Email of Customer (Required if you don't send the customer.id)
customer.resource Resource Complete customer resource
amount Number Amount of Payment
status String Status of Payment
currency String Currency of Payment
service String Service of Payment
enviroment String Enviroment of Payment

Resource example:

{
    "id": "99639165-04a9-4742-b51b-c9dcc4fbc3cb",
    "application_id": "995d8ae8-b47f-4b3d-b411-e325d95f6ffd",
    "amount": 999.66,
    "status": "pending",
    "currency": "GBP",
    "country": "GB",
    "service": "api",
    "environment": "sandbox",
    "institution": {
        "id": 20,
        "name": "Modelo Sandbox"
    },
    "customer": {
        "id": "99639164-f36d-4836-a8b7-934ad056b16c",
        "name": "John Doe",
        "email": "johndoe@gmail.com",
        "currency": "GBP",
        "phone": "+33 7 65 31 39 61",
        "country": "GB",
        "state": "MG"
    },
    "payee": {
        "name": "John Doe",
        "country_code": "GB",
        "bank_name": "MODELO",
        "accountable": "DE89370400440532013000",
        "swift_bic": "AACSDE33"
    },
    "fee": null,
    "percentual_fee": null,
    "total_fee": null,
    "created_at": "2023-06-12T00:20:01.000000Z",
    "updated_at": "2023-06-12T00:20:01.000000Z",
    "authorisationUrl": "url of payment authorized"
}

List Payments

.GET https://neopay.io/api/payments

Get the resource collection of Payments available for the specific application.

Filters

We have some filters available for listing payments: Status, Service and Dates

Headers

{
    "Authorization": "<my-app-token>",
    "x-app-key": "<my-app-key>",
    "Content-Type": "application/json/",
    "Accept": "application/json"
}

{info.fa-hint} <my-app-token> is the token generate for your Application {info.fa-hint} <my-app-key> is obtained in your Application portal as the Application ID

Request example:

curl --location 'https://neopay.io/api/payments' \
--header 'Authorization: YOUR-TOKEN \
--header 'Content-Type: application/json' \
--header 'x-app-key: YOUR-APPLICATION-TOKEN'

Response example

Success Response:


HTTP 200
{
    "data": [
        {
            "id": "99639165-04a9-4742-b51b-c9dcc4fbc3cb",
            "application_id": "995d8ae8-b47f-4b3d-b411-e325d95f6ffd",
            "amount": 999.66,
            "status": "pending",
            "currency": "GBP",
            "country": "GB",
            "service": "api",
            "environment": "sandbox",
            "institution": {
                "id": 20,
                "name": "Modelo Sandbox"
            },
            "customer": {
                "id": "99639164-f36d-4836-a8b7-934ad056b16c",
                "name": "John Doe update",
                "email": "johndoeupdated@gmail.com",
                "currency": "GBP",
                "phone": "+33 7 65 31 39 61",
                "country": "GB",
                "state": "MG"
            },
            "payee": {
                "name": "John Doe",
                "country_code": "GB",
                "bank_name": "MODELO",
                "accountable": "DE89370400440532013000",
                "swift_bic": "AACSDE33"
            },
            "fee": null,
            "percentual_fee": null,
            "total_fee": null,
            "created_at": "2023-06-12T00:20:01.000000Z",
            "updated_at": "2023-06-12T00:20:01.000000Z",
            "authorisationUrl": "url of payment authorized"
        }
    ],
    "links": {
        "first": "http://localhost/api/payments?page=1",
        "last": "http://localhost/api/payments?page=2",
        "prev": null,
        "next": "http://localhost/api/payments?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "links": [
            {
                "url": null,
                "label": "Previous",
                "active": false
            },
            {
                "url": "api/payments?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "api/payments?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "api/payments?page=2",
                "label": "Next",
                "active": false
            }
        ],
        "path": "api/payments",
        "per_page": 10,
        "to": 10,
        "total": 16
    }
}

Request example with filters:

curl --location 'https://neopay.io/api/payments?service=ap&status=pendingi&fromDate=2023-06-10&toDate=2023-06-12' \
--header 'Authorization: YOUR-TOKEN \
--header 'Content-Type: application/json' \
--header 'x-app-key: YOUR-APPLICATION-TOKEN'

Response example

Success Response:


HTTP 200
{
    "data": [
        {
            "id": "99639165-04a9-4742-b51b-c9dcc4fbc3cb",
            "application_id": "995d8ae8-b47f-4b3d-b411-e325d95f6ffd",
            "amount": 999.66,
            "status": "pending",
            "currency": "GBP",
            "country": "GB",
            "service": "api",
            "environment": "sandbox",
            "institution": {
                "id": 20,
                "name": "Modelo Sandbox"
            },
            "customer": {
                "id": "99639164-f36d-4836-a8b7-934ad056b16c",
                "name": "John Doe update",
                "email": "johndoeupdated@gmail.com",
                "currency": "GBP",
                "phone": "+33 7 65 31 39 61",
                "country": "GB",
                "state": "MG"
            },
            "payee": {
                "name": "John Doe",
                "country_code": "GB",
                "bank_name": "MODELO",
                "accountable": "DE89370400440532013000",
                "swift_bic": "AACSDE33"
            },
            "fee": null,
            "percentual_fee": null,
            "total_fee": null,
            "created_at": "2023-06-12T00:20:01.000000Z",
            "updated_at": "2023-06-12T00:20:01.000000Z",
            "authorisationUrl": "url of payment authorized"
        }
    ],
    "links": {
        "first": "http://localhost/api/payments?page=1",
        "last": "http://localhost/api/payments?page=2",
        "prev": null,
        "next": "http://localhost/api/payments?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "links": [
            {
                "url": null,
                "label": "Previous",
                "active": false
            },
            {
                "url": "api/payments?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "api/payments?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "api/payments?page=2",
                "label": "Next",
                "active": false
            }
        ],
        "path": "api/payments",
        "per_page": 10,
        "to": 10,
        "total": 16
    }
}

Create Payment

.POST https://neopay.io/api/payments

Create a Payment

Headers

{
    "Authorization": "<my-app-token>",
    "x-app-key": "<my-app-key>",
    "Content-Type": "application/json/",
    "Accept": "application/json"
}

{info.fa-hint} <my-app-token> is the token generate for your Application {info.fa-hint} <my-app-key> is obtained in your Application portal as the Application ID

Request Body example

{
    "serviceId": "api",
    "institutionId": 20,
    "payment": {
        "amount": 122.44,
        "currency": "GBP"
    },
    "customer": {
        "id": "99618204-6daf-4eca-8180-c21bb8d8ee24",
        "name": "Jhon Doe",
        "email": "jhondoe@email.com",
        "country": "GB"
    },
    "reference": "reference",
    "callback_url": "https://webhook.site/2d9eefba-3ac8-4692-a0ec-d57dd3ce3abd"
}
Field Type Description
serviceId String Name of service . (Required)
institutionId Integer The ID of the institution. (Required if service is api)
payment Object The payment details. (Required)
payment.amount Number Amount of payment (Required)
payment.currency String The currency of the payment. (Required)
customer Object The customer details (Required)
customer.id UUID The customer UUID (Required if you don't send the customer.email )
customer.email String The customer email (Required if you don't send the customer.id )
customer.name String The customer name (Optional )
customer.country String The customer country (Required )
customer.resource Resource Complete customer resource
reference String Payment reference (Optional )
callback_url String Payment callback url (OPtional )

Request example:

curl --location 'http://localhost/api/payments' \
--header 'Authorization: YOUR-TOKEN' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-app-key: YOUR-APPLICATION-TOKEN' \
--data-raw '{
"serviceId": "api"
"institutionId": 22,
"payment": {
"amount": 122.44,
"currency": "GBP"
},
"customer": {
"id": "99ea2084-55c9-4deb-9a74-0a698022573b",
"name": "Jhon Doe",
"email": "jhondoe@email.com",
"country": "GB"
},
"reference": "reference",
"callback_url": "https://webhook.site/b4461d69-5feb-447e-898b-75bb9ddf9023"
}'

Response example

Success Response:


HTTP 200
{
    "message": "Payment saved successfully!",
    "payment": {
        "id": "99ea261a-d7e8-45be-af0b-5ff89b8cee2a",
        "application_id": "99e9c703-bfe1-4328-af65-12cd8457a69d",
        "authorisationUrl": "YOUR-AUTHORIZATION-URL"
    }
}

Create PIX Payment

.POST https://neopay.io/api/payments

Create a Pix Payment

Headers

{
    "Authorization": "<my-app-token>",
    "x-app-key": "<my-app-key>",
    "Content-Type": "application/json/",
    "Accept": "application/json"
}

{info.fa-hint} <my-app-token> is the token generate for your Application {info.fa-hint} <my-app-key> is obtained in your Application portal as the Application ID

Request Body example

{
    "serviceId": "pix",
    "payment": {
        "amount": 122.44,
        "currency": "GBP"
    },
    "customer": {
        "id": "99618204-6daf-4eca-8180-c21bb8d8ee24",
        "name": "Jhon Doe",
        "email": "jhondoe@email.com",
        "country": "GB",
        "tax_number": "06372771390"
    },
    "reference": "reference"
}
Field Type Description
serviceId String Name of service . (Required)
payment Object The payment details. (Required)
payment.amount Number Amount of payment (Required)
payment.currency String The currency of the payment. (Required)
customer Object The customer details (Required)
customer.id UUID The customer UUID (Required if you don't send the customer.email )
customer.email String The customer email (Required if you don't send the customer.id )
customer.name String The customer name (Optional )
customer.country String The customer country (Required )
customer.tax_number String The customer brazilian cpf (Required )
customer.resource Resource Complete customer resource
reference String Payment reference (Optional )

Request example:

curl --location 'http://localhost/api/payments' \
--header 'Authorization: YOUR-TOKEN' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-app-key: YOUR-APPLICATION-TOKEN' \
--data-raw '{
"serviceId": "pix"
"payment": {
"amount": 122.44,
"currency": "GBP"
},
"customer": {
"id": "99ea2084-55c9-4deb-9a74-0a698022573b",
"name": "Jhon Doe",
"email": "jhondoe@email.com",
"country": "GB",
"tax_number": "06372771390"
},
"reference": "reference",
"callback_url": "https://webhook.site/b4461d69-5feb-447e-898b-75bb9ddf9023"
}'

Response example

Success Response:


HTTP 200
{
    "message": "Payment saved successfully!",
    "payment": {
        "id": "99ea261a-d7e8-45be-af0b-5ff89b8cee2a",
        "application_id": "99e9c703-bfe1-4328-af65-12cd8457a69d",
        "qr_code": "YOUR-QR-CODE-PIX"
    }
}

Get Payment

.GET https://neopay.io/api/customers/{id} Get the resource to a specific payment.

Query params

Param Type Description
uuid
required
UUID UUID obtained either by creating a new payment or fetching from the List Payment endpoint

Headers

{
    "Authorization": "<my-app-token>",
    "x-app-key": "<my-app-key>",
    "Content-Type": "application/json/",
    "Accept": "application/json"
}

{info.fa-hint} <my-app-token> is the token generate for your Application {info.fa-hint} <my-app-key> is obtained in your Application portal as the Application ID

Request example:

curl --location 'https://neopay.io/api/payments/{id}' \
--header 'Authorization: YOUR-TOKEN \
--header 'Content-Type: application/json' \
--header 'x-app-key: YOUR-APPLICATION-TOKEN'

Response example

Success Response:


HTTP 200
{
    "payment": {
        "id": "99658c35-d9ee-4b04-9bc2-4a963c0bcfc3",
        "application_id": "995d8ae8-b47f-4b3d-b411-e325d95f6ffd",
        "amount": 122.44,
        "status": "pending",
        "currency": "GBP",
        "country": "GB",
        "service": "api",
        "environment": "sandbox",
        "institution": {
            "id": 20,
            "name": "Modelo Sandbox"
        },
        "customer": {
            "id": "9965866d-03eb-46ad-a932-f517f0380a57",
            "name": "Jhon doe",
            "email": "Jhondoe@email.com",
            "currency": "GBP",
            "phone": "+33 7 65 31 39 61",
            "country": "UK",
            "state": "  Brighton"
        },
        "payee": {
            "name": "John Doe",
            "country_code": "GB",
            "bank_name": "MODELO",
            "accountable": "DE89370400440532013000",
            "swift_bic": "AACSDE33"
        },
        "fee": null,
        "percentual_fee": null,
        "total_fee": null,
        "created_at": "2023-06-12T23:57:10.000000Z",
        "updated_at": "2023-06-12T23:57:10.000000Z"
    }
}