Documentation: https://wallet.teamapricot.com/api/v1
Access route to the wallet app API. The endpoint is https://wallet.teamapricot.com/api/v1.
url pay: https://wallet.teamapricot.com/api/v1/pay
Parameters
| Name | Location | Type | Description |
|---|---|---|---|
invoice_id |
body (JSON) | string|number | Unique invoice identifier |
amount |
body (JSON) | string|number | Amount to charge (e.g. "100.00") |
currency |
body (JSON) | string | Currency ("USDT, USDC or BOTH") |
customer_email |
body (JSON) | string | Customer Email |
status |
body (JSON) | string | 'prod' or 'test' |
img |
body (JSON) | string | Product image (url) |
product_name |
body (JSON) | string | Name of the product or service |
description |
body (JSON) | string | Description of the product or service |
Recommended Headers
Accept: application/json
Authorization: Bearer <tu_token>
Content-Type: application/json
Body Example (JSON)
{
"img": "https://example.com/imagen.jpg",
"invoice_id": "1",
"amount": "100.00",
"currency": "USDT",
"description": "Pago de factura #1",
"customer_email": "demo@demo.com",
"status": "prod",
"product_name": "Nombre del producto"
}
cURL Example
curl -X POST "https://wallet.teamapricot.com/api/v1/pay" \
-H "Accept: application/json" \
-H "Authorization: Bearer TU_TOKEN" \
-H "Content-Type: application/json" \
-d '{"invoice_id":"1","amount":"100.00","currency":"USDT","customer_email":"demo@demo.com","status":"prod"}'
Response Example (200)
{
"status": "success",
"data": {
"exito": 1,
"invoice_id": "1",
"date": "2024-01-01",
"amount": "100.00",
"currency": "USDT",
"payment_url": "https://payment.example/checkout/abc123"
}
}
Common Errors
- 401 Unauthorized: Invalid or not provided token.
- 404 Not Found: Route not found.
- 400 Bad Request: Invalid parameters.
- 403 API token is inactive: Api token is inactive
Redirection to the Payment Page
Once the response with the payment URL (<code>payment_url</code>) is received, the client must redirect the user to that URL to complete the payment process. Examples of how to perform this redirection in different programming languages are shown below.
Client Examples
PHP (curl)
$url = https://wallet.teamapricot.com/api/v1/pay;
$payload = [
"img" => "",
"api_token" => "123456",
"invoice_id" => "1",
"amount" => "100.00",
"currency" => "USDT",
"description" => "Pago de factura #1",
"customer_email" => "demo@demo.com",
"status" => "prod",
"product_name" => "test"
];
$headers = [
'Accept: application/json',
'Content-Type: application/json',
'Authorization: Bearer tu_token_aqui'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
} else {
if ($httpCode >= 200 && $httpCode < 300) {
$data = json_decode($response, true);
if (!empty($data['data']['payment_url'])) {
header("Location: " . $data['data']['payment_url']);
exit;
} else {
echo "Respuesta recibida:\n";
print_r($data);
}
} else {
echo "Error HTTP: $httpCode\n";
print_r(json_decode($response, true));
}
}
curl_close($ch);
Workflow
- The client sends a POST request to the <code>https://wallet.teamapricot.com/api/v1/pay</code> endpoint with the necessary parameters and the authentication token in the headers.
- The server processes the request and validates the provided data.
- If the request is valid, the server creates an invoice and generates a unique payment URL.
- The server responds with a JSON including the payment URL in the <code>payment_url</code> field.
- The client redirects the user to the payment URL to complete the transaction.
- The user completes the payment on the provided payment page.
- The server notifies the client about the payment status via the configured webhook URL.
- The webhook redirection will contain the following parameters:
case: Indicates the case being executed (pay, login, etc)result: Indicates the payment status (1 for success, 0 for failure).invoce_id: The unique invoice identifier provided by the client.- redirection example:
https://tuwebhook.com?case=pay&result=1&invoce_id=12345
Notes
- Make sure to handle errors and API responses properly in your client application.
- Redirection to the payment URL should only be done if the response is successful and contains the URL.
Need Help?
If you have any questions or require additional assistance, please do not hesitate to contact us through our technical support.
url multipay: https://wallet.teamapricot.com/api/v1/multipay
Multipayouts Documentation
This API allows you to send multiple payment requests in a single call. It requires Bearer authentication and the <code>payments</code> parameter (array of emails).
Parameters
| Name | Location | Type | Description |
|---|---|---|---|
api_token |
Header/Body (Bearer) | string | **Required**. API authentication token. |
currency |
body (JSON) | string | **Required**. USDT token or one listed in the wallet app. |
payments |
body (JSON) | array | **Required**. List of recipients. |
| Structure of the <code>payments</code> Array | |||
payments[].customer_email |
body (JSON) | string | Customer's email address to pay. |
payments[].invoice_id |
body (JSON) | string|number | Unique invoice ID for this customer. (Optional, but recommended) |
payments[].amount |
body (JSON) | string|number | Amount to credit to the recipient. |
Body Example (JSON)
{
"currency": "USDT",
"product_name": "Suscripción Trimestral",
"payments": [
{
"customer_email": "cliente1@ejemplo.com",
"invoice_id": "FACT-001",
"amount": "250.00"
},
{
"customer_email": "cliente2@ejemplo.com",
"invoice_id": "FACT-002",
"amount": "250.00"
}
]
}
cURL Example
curl -X POST "https://wallet.teamapricot.com/api/v1/multipay" \
-H "Accept: application/json" \
-H "Authorization: Bearer TU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"currency": "USDT",
"payments": [
{"customer_email": "cliente1@ejemplo.com", "invoice_id": "FACT-001", "amount": "250.00"},
{"customer_email": "cliente2@ejemplo.com", "invoice_id": "FACT-002", "amount": "250.00"}
]
}'
PHP (curl)
$url = https://wallet.teamapricot.com/api/v1/multipay;
$token = "TU_TOKEN";
$data = [
"currency" => "USDT",
"payments" => [
["customer_email" => "cliente1@ejemplo.com", "invoice_id" => "FACT-001", "amount" => "250.00"],
["customer_email" => "cliente2@ejemplo.com", "invoice_id" => "FACT-002", "amount" => "250.00"]
]
];
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); // Método POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); // Datos a enviar
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Devolver la transferencia como una cadena
$headers = [
"Accept: application/json",
"Authorization: Bearer " . $token,
"Content-Type: application/json",
"Content-Length: " . strlen($json_data) // Longitud del cuerpo JSON
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error cURL: ' . curl_error($ch);
} else {
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo "Código de respuesta HTTP: " . $http_code . "\n\n";
echo "Respuesta del Servidor:\n";
$response_decoded = json_decode($response, true);
if ($response_decoded) {
print_r($response_decoded);
} else {
echo $response;
}
}
curl_close($ch);
Common Errors
- 401 Unauthorized: Invalid or not provided token.
- 404 Not Found: Route not found.
- 400 Bad Request: Invalid parameters.
- 403 API token is inactive: Api token is inactive
Server Response Codes
- 1 Success (Éxito): The operation was completed successfully.
- 0 Saldo Insuficiente: The user does not have sufficient balance to perform this operation.
- -1 Error General: An internal or unexpected server error has occurred. Please try again later.
Server Response Example
{
"status": "1",
"message": "Payments processed. Invalid transactions: 3",
"dataNoProccess": [
"example@demo.com",
"example1@demo.com",
"example2@demo.com"
],
"dataProcess": [
"example@demo.com",
]
}
Need Help?
If you have any questions or require additional assistance, please do not hesitate to contact us through our technical support.