Pagos


Recurso de pagos

Field Type Description
ID UUID UUID único interno de Neopay para el pago
institutionId ID Identificación de la institución
application_id UUID UUID de la aplicación
customer.id UUID UUID del cliente (obligatorio si no se envía el correo electrónico del cliente)
customer.email Email Correo electrónico del cliente (requerido si no se envía la identificación del cliente)
customer.resource Resource Recurso completo para el cliente
amount Number Monto del pago
status String Estado de pago
currency String Moneda de pago
service String departamento de pagos
enviroment String Entorno de pago

Ejemplo de recurso:

{
    "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"
}

Lista de pagos

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

Obtenga la colección de recursos de pago disponibles para la aplicación específica.

Headers

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

{info.fa-hint} <my-app-token> es el token generado para su aplicación {info.fa-hint} <my-app-key> se obtiene en su portal de aplicaciones como Application ID

Solicitud de muestra:

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

Ejemplo de respuesta

Respuesta exitosa:


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
    }
}

Crear pago

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

Crear un pago

Headers

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

{info.fa-hint} <my-app-token> es el token generado para su aplicación {info.fa-hint} <my-app-key> se obtiene en su portal de aplicaciones como Application ID

Cuerpo de solicitud de muestra

{
    "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
institutionId Integer La identificación de la institución. (Requerido)
payment Object Detalles del pago. (Requerido)
payment.amount Number Importe del pago (Requerido)
payment.currency String La moneda de pago. (Requerido)
customer Object Detalles del cliente (requerido)
customer.id UUID UUID del cliente (obligatorio si no se envía el correo electrónico del cliente)
customer.email String Correo electrónico del cliente (obligatorio si no se envía el UUID del cliente)
customer.name String Nombre del cliente (Opcional)
customer.country String País del cliente (requerido)
customer.resource Resource Recurso completo para el cliente
reference String Preferencia de Pago (Opcional)
callback_url String URL de recordatorio de pago (opcional)

Solicitud de muestra:

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 '{
"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"
}'

Ejemplo de respuesta

Respuesta exitosa:


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

Obtenir le paiement

.GET https://neopay.io/api/customers/{id} Obtener el recurso a un pago específico.

Query params

Param Type Description
uuid
required
UUID UUID obtenido ya sea creando un nuevo pago o recuperándolo delList 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> es el token generado para su aplicación {info.fa-hint} <my-app-key> se obtiene en su portal de aplicaciones como Application ID

Solicitud de muestra:

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

Respuesta de muestra

Respuesta exitosa:


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"
    }
}