API: Request examples
Overview
The documentation uses a sample shop ID 245. API requests are demonstrated for both payin (deposit) and payout (withdrawal) operations, complete with corresponding responses for different scenarios. Each example includes the necessary headers and payloads to ensure successful communication with the API endpoints.
Step 1. Get available payment method types
Request
- payin
- payout
curl -L -X GET 'https://gateway.fundix.me/api/v1/agents/payment-method-types?shopId=245&operationType=payin' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333'
curl -L -X GET 'https://gateway.fundix.me/api/v1/agents/payment-method-types?shopId=245&operationType=payout' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333'
Response
- payin
- payout
{
"data": [
{
"id": "1ef49015-a03b-661a-a03a-b61387989273",
"name": "Test payment method type",
"instrumentType": "cash",
"country": "CA",
"currency": "CAD",
"minAmount": "1",
"maxAmount": "1000"
},
{
"id": "1ef4905e-9997-6cd4-841c-b61387989273",
"name": "Orange bank",
"instrumentType": "bank_transfer",
"country": "CM",
"currency": "RUB",
"minAmount": "1",
"maxAmount": "1000"
}
]
}
{
"data": [
{
"id": "1ef4905e-9997-6cd4-841c-b61387989273",
"name": "Orange bank",
"instrumentType": "bank_transfer",
"country": "CM",
"currency": "RUB",
"minAmount": "1",
"maxAmount": "1000"
},
{
"id": "1ef49015-a03b-661a-a03a-b61387989273",
"name": "Test payment method type",
"instrumentType": "cash",
"country": "CA",
"currency": "CAD",
"minAmount": "1",
"maxAmount": "1000"
}
]
}
Step 2. Initialize a new session
Request
- payin
- payout
curl -L -X POST 'https://gateway.fundix.me/api/v1/agents/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333' \
--data-raw '{
"paymentMethodTypeId": "1ef49015-a03b-661a-a03a-b61387989273",
"operationType": "payin",
"shopId": 245,
"operationNumber": "001",
"payerId": "payer123",
"amount": "100.25",
"currency": "CAD"
}'
curl -L -X POST 'https://gateway.fundix.me/api/v1/agents/sessions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333' \
--data-raw '{
"paymentMethodTypeId": "1ef4905e-9997-6cd4-841c-b61387989273",
"operationType": "payout",
"shopId": 245,
"operationNumber": "002",
"payerId": "payer123",
"amount": "120",
"currency": "RUB"
}'
Response
- payin
- payout
{
"data": {
"sessionId": "1ef58ca7-ee58-6728-8913-ce9868d5084f",
"expiredAt": "2024-08-12T17:02:00+00:00",
"payerRequisites": [
{
"name": "payin_email",
"title": "Payin email",
"type": "string"
}
]
}
}
{
"data": {
"sessionId": "1ef58cb7-113b-6510-b144-ce9868d5084f",
"expiredAt": "2024-08-12T17:08:47+00:00",
"payerRequisites": [
{
"name": "payout_email",
"title": "Payout email",
"type": "string"
}
]
}
}
Step 3. Create a new P2P operation
Request
- payin
- payout
curl -L -X POST 'https://gateway.fundix.me/api/v1/agents/operations' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333' \
--data-raw '{
"sessionId": "1ef58ca7-ee58-6728-8913-ce9868d5084f",
"payerRequisites": [
{
"value": "johndoecustomer@example.com",
"name": "payin_email",
"type": "string"
}
]
}'
curl -L -X POST 'https://gateway.fundix.me/api/v1/agents/operations' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333' \
--data-raw '{
"sessionId": "1ef58cb7-113b-6510-b144-ce9868d5084f",
"payerRequisites": [
{
"value": "johndoe@gmail.com",
"name": "payout_email",
"type": "string"
}
]
}'
Response
- payin
- payout
{
"data": {
"operation": {
"type": "payin",
"id": 33431,
"shopId": 245,
"operationNumber": "001",
"paymentMethodRequisites": [
{
"name": "iban",
"value": "423432432"
}
],
"payerId": "payer123",
"amount": "100.25",
"currency": "CAD",
"settlementAmount": "72.93",
"settlementCurrency": "USD",
"registeredAt": "2024-08-12T16:47:00+00:00",
"updatedAt": "2024-08-12T16:51:22+00:00",
"status": "created",
"isCorrection": false,
"payerDetails": [
{
"name": "payin_email",
"title": "Payin email",
"type": "string",
"value": "johndoecustomer@example.com"
}
]
},
"parent": null
}
}
{
"data": {
"operation": {
"type": "payout",
"id": 33909,
"shopId": 245,
"operationNumber": "002",
"paymentMethodRequisites": [
{
"name": "sbp",
"value": "9487779777"
}
],
"payerId": "payer123",
"amount": "120",
"currency": "RUB",
"settlementAmount": "1.32",
"settlementCurrency": "USD",
"registeredAt": "2024-08-12T16:53:47+00:00",
"updatedAt": "2024-08-12T16:55:37+00:00",
"status": "created",
"isCorrection": false,
"payerDetails": [
{
"name": "payout_email",
"title": "Payout email",
"type": "string",
"value": "johndoe@gmail.com"
}
]
},
"parent": null
}
}
Step 4. Retrieve P2P operation details
After the agent has confirmed the successful completion of the operation.
Request
- payin
- payout
curl -L -X GET 'https://gateway.fundix.me/api/v1/agents/operations/245/001' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333'
curl -L -X GET 'https://gateway.fundix.me/api/v1/agents/operations/245/002' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: be128487-6ba9-4e69-ae55-4355ee8e3333'
Response
- payin
- payout
{
"data": {
"operation": {
"type": "payin",
"id": 33431,
"shopId": 245,
"operationNumber": "001",
"paymentMethodRequisites": [
{
"name": "iban",
"value": "423432432"
}
],
"payerId": "payer123",
"amount": "100.25",
"currency": "CAD",
"settlementAmount": "72.93",
"settlementCurrency": "USD",
"registeredAt": "2024-08-12T16:47:00+00:00",
"updatedAt": "2024-08-12T16:56:50+00:00",
"status": "captured",
"isCorrection": false,
"payerDetails": [
{
"name": "payin_email",
"title": "Payin email",
"type": "string",
"value": "johndoecustomer@example.com"
}
]
},
"parent": null
}
}
{
"data": {
"operation": {
"type": "payout",
"id": 33909,
"shopId": 245,
"operationNumber": "002",
"paymentMethodRequisites": [
{
"name": "sbp",
"value": "53535343"
}
],
"payerId": "payer123",
"amount": "120",
"currency": "RUB",
"settlementAmount": "1.32",
"settlementCurrency": "USD",
"registeredAt": "2024-08-12T16:53:47+00:00",
"updatedAt": "2024-08-12T16:56:55+00:00",
"status": "captured",
"isCorrection": false,
"payerDetails": [
{
"name": "payout_email",
"title": "Payout email",
"type": "string",
"value": "johndoe@gmail.com"
}
]
},
"parent": null
}
}