curl --request GET \
--url https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id} \
--header 'Authorization: <api-key>' \
--header 'x-date: <api-key>' \
--header 'x-login: <api-key>' \
--header 'x-trans-key: <api-key>'import requests
url = "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}"
headers = {
"x-login": "<api-key>",
"x-trans-key": "<api-key>",
"x-date": "<api-key>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-login': '<api-key>',
'x-trans-key': '<api-key>',
'x-date': '<api-key>',
Authorization: '<api-key>'
}
};
fetch('https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"x-date: <api-key>",
"x-login: <api-key>",
"x-trans-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-login", "<api-key>")
req.Header.Add("x-trans-key", "<api-key>")
req.Header.Add("x-date", "<api-key>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}")
.header("x-login", "<api-key>")
.header("x-trans-key", "<api-key>")
.header("x-date", "<api-key>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-login"] = '<api-key>'
request["x-trans-key"] = '<api-key>'
request["x-date"] = '<api-key>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyGet Payment Order Attempt
Overview - Get Payment Order Attempt
Purpose
This endpoint allows you to query the status and details of a specific payment attempt (PaymentOrderAttempt) associated with a payment order. It’s useful for:
-
Checking the current status of a payment attempt
-
Retrieving configured redirect URLs for the attempt
-
Querying payment provider (PSP) information
-
Reviewing payer data and applied costs
Operation Flow
-
Client sends a GET request with:
- payment_order_id (Payment order ID)
- attempt_alt_id (Attempt alternative ID)
- Authentication headers (Authorization, X-Date)
-
System validates:
- Authentication signature (HMAC)
- Payment order existence
- Payment attempt existence
- Rate limiting (1 request per minute per unique combination)
-
If successful, returns:
- Attempt status (pending, paid, cancelled, error)
- Payment provider information
- Redirect URLs
- Applied costs
- Payer data
- Timestamps
EndpointGET /v1/businesses/payment_orders/:payment_order_id/attempts/:attempt_alt_id
Authentication
Requires Business API authentication headers:
-
Authorization: HMAC-SHA256 signature
-
X-Date: ISO 8601 timestamp
-
Required permission: get_payment_order_attempt
Rate Limiting
-
1 request per minute per unique combination of payment_order_id + attempt_alt_id
-
If exceeded, returns throttling error
URL Parameters
| Parameter | Type | Description |
|---|---|---|
payment_order_id | Integer (required) | Payment order ID |
attempt_alt_id | String (UUID) (required) | Payment attempt alternative ID |
Success Response (200 OK)
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "payment_order_attempt",
"attributes": {
"status": "pending",
"provider_code": "TBK_123456",
"payment_reference": "REF-2024-001",
"cancel_message": null,
"statuses": [
"pending",
"processing"
],
"provider": {
"id": 1,
"name": "Transbank WebPay"
},
"payer": {
"name": "Juan Pérez",
"email": "juan@example.com",
"document": "12345678-9"
},
"payment_order": {
"public_code": "PO-2024-001",
"amount": 10000,
"status": "pending"
},
"costs": {
"fixed_cost": 500,
"spread": 2.5
},
"redirect_urls": {
"success_redirect_url": "https://merchant.com/success",
"cancel_redirect_url": "https://merchant.com/cancel",
"error_redirect_url": "https://merchant.com/error",
"pending_redirect_url": "https://merchant.com/pending"
},
"provider_data": {
"provider_url": "https://webpay.transbank.cl/pay/12345",
"frame": null,
"qr_code": null
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:35:00Z"
}
}
}
Error Responses
404 - Payment Order Not Found
{"error":{"code":404,"message":"Payment order not found"}}
404 - Payment Order Attempt Not Found
{"error":{"code":404,"message":"Payment order attempt not found"}}
422 - Invalid Signature
{"error":{"code":422,"message":"Invalid signature"}}
500 - Internal Server Error
{"error":{"code":500,"message":"Internal server error: [error details]"}}
Possible Attempt Statuses
| Status | Description |
|---|---|
pending | Attempt created, awaiting user action |
processing | Payment under verification process |
paid | Payment completed successfully |
cancelled | Payment cancelled by user |
error | Error in payment processing |
expired | Attempt expired without completion |
Common Use Cases
-
Webhook Polling: Check status after receiving webhook
-
UI Status Update: Update interface in real-time
-
Payment Verification: Verify payment completion
-
Redirect After Payment: Obtain post-payment redirect URL
-
Audit Trail: Record payment attempts for auditing
Important Notes
-
The attempt_alt_id is the unique attempt identifier (UUID)
-
A payment_order can have multiple attempts
-
Redirect URLs are specific per attempt
-
Throttling prevents excessive queries for the same attempt
Related Endpoints
-
POST /v1/businesses/payment_orders - Create payment order
-
POST /v1/businesses/payment_orders/:id/direct_payment - Process direct payment
curl --request GET \
--url https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id} \
--header 'Authorization: <api-key>' \
--header 'x-date: <api-key>' \
--header 'x-login: <api-key>' \
--header 'x-trans-key: <api-key>'import requests
url = "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}"
headers = {
"x-login": "<api-key>",
"x-trans-key": "<api-key>",
"x-date": "<api-key>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-login': '<api-key>',
'x-trans-key': '<api-key>',
'x-date': '<api-key>',
Authorization: '<api-key>'
}
};
fetch('https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"x-date: <api-key>",
"x-login: <api-key>",
"x-trans-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-login", "<api-key>")
req.Header.Add("x-trans-key", "<api-key>")
req.Header.Add("x-date", "<api-key>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}")
.header("x-login", "<api-key>")
.header("x-trans-key", "<api-key>")
.header("x-date", "<api-key>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/attempts/{payment_order_attempt_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-login"] = '<api-key>'
request["x-trans-key"] = '<api-key>'
request["x-date"] = '<api-key>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyAuthorizations
Business xLogin
Business xTransKey
ISO8601 datetime
V2-HMAC-SHA256 signature. Example: V2-HMAC-SHA256, Signature: <hash>
Response
Successful response.