curl --request GET \
--url https://api.staging.payrails.io/payment/payments/{paymentId}/operations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/payment/payments/{paymentId}/operations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.payrails.io/payment/payments/{paymentId}/operations', 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.staging.payrails.io/payment/payments/{paymentId}/operations",
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: Bearer <token>"
],
]);
$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.staging.payrails.io/payment/payments/{paymentId}/operations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.staging.payrails.io/payment/payments/{paymentId}/operations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/payment/payments/{paymentId}/operations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "fe44e4b6-8d32-4ce7-8a80-64332ba49809",
"createdAt": "2021-01-05T10:20:00.000Z",
"updatedAt": "2021-01-05T10:20:00.000Z",
"paymentId": "1bac22d8-5d64-4aa9-b6a6-cbbbda3c3a35",
"type": "Authorize",
"providerReference": "reference",
"amount": {
"value": "10.0",
"currency": "GBP"
},
"result": "Accepted",
"responseCode": "200",
"reason": "",
"acquirerReference": "arn1702287523792",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"providerLatency": "807.529ms",
"totalLatency": "920.229ms"
},
{
"id": "88604bba-7414-4707-abfe-260ed60ea80e",
"createdAt": "2021-01-05T10:20:00.000Z",
"updatedAt": "2021-01-05T10:20:00.000Z",
"paymentId": "1bac22d8-5d64-4aa9-b6a6-cbbbda3c3a35",
"type": "Authorize",
"providerReference": "reference",
"amount": {
"value": "10.0",
"currency": "GBP"
},
"result": "Success",
"responseCode": "201",
"reason": "",
"acquirerReference": "arn1702287523792",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"providerLatency": "1.10529s",
"totalLatency": "1.203448s"
},
{
"id": "b53bbb70-55d0-11ed-bdc3-0242ac120002",
"createdAt": "2021-01-05T10:20:00.000Z",
"updatedAt": "2021-01-05T10:20:00.000Z",
"paymentId": "76cd18a2-10ef-40db-8506-ee0db5d98633",
"type": "Refund",
"providerReference": "ref1",
"amount": {
"value": "10.0",
"currency": "GBP"
},
"result": "Success",
"responseCode": "201",
"reason": "DamagedProduct",
"acquirerReference": "arn1702287523792",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"providerLatency": "201.076ms",
"totalLatency": "234.4291ms"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.rate-limit",
"detail": "Too many requests",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestrate-limit"
}
]
}Get Payment Operations by Payment ID
Find a payment operation from a given paymentID.
curl --request GET \
--url https://api.staging.payrails.io/payment/payments/{paymentId}/operations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/payment/payments/{paymentId}/operations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.payrails.io/payment/payments/{paymentId}/operations', 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.staging.payrails.io/payment/payments/{paymentId}/operations",
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: Bearer <token>"
],
]);
$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.staging.payrails.io/payment/payments/{paymentId}/operations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.staging.payrails.io/payment/payments/{paymentId}/operations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/payment/payments/{paymentId}/operations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "fe44e4b6-8d32-4ce7-8a80-64332ba49809",
"createdAt": "2021-01-05T10:20:00.000Z",
"updatedAt": "2021-01-05T10:20:00.000Z",
"paymentId": "1bac22d8-5d64-4aa9-b6a6-cbbbda3c3a35",
"type": "Authorize",
"providerReference": "reference",
"amount": {
"value": "10.0",
"currency": "GBP"
},
"result": "Accepted",
"responseCode": "200",
"reason": "",
"acquirerReference": "arn1702287523792",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"providerLatency": "807.529ms",
"totalLatency": "920.229ms"
},
{
"id": "88604bba-7414-4707-abfe-260ed60ea80e",
"createdAt": "2021-01-05T10:20:00.000Z",
"updatedAt": "2021-01-05T10:20:00.000Z",
"paymentId": "1bac22d8-5d64-4aa9-b6a6-cbbbda3c3a35",
"type": "Authorize",
"providerReference": "reference",
"amount": {
"value": "10.0",
"currency": "GBP"
},
"result": "Success",
"responseCode": "201",
"reason": "",
"acquirerReference": "arn1702287523792",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"providerLatency": "1.10529s",
"totalLatency": "1.203448s"
},
{
"id": "b53bbb70-55d0-11ed-bdc3-0242ac120002",
"createdAt": "2021-01-05T10:20:00.000Z",
"updatedAt": "2021-01-05T10:20:00.000Z",
"paymentId": "76cd18a2-10ef-40db-8506-ee0db5d98633",
"type": "Refund",
"providerReference": "ref1",
"amount": {
"value": "10.0",
"currency": "GBP"
},
"result": "Success",
"responseCode": "201",
"reason": "DamagedProduct",
"acquirerReference": "arn1702287523792",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"providerLatency": "201.076ms",
"totalLatency": "234.4291ms"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.rate-limit",
"detail": "Too many requests",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestrate-limit"
}
]
}Authorizations
You can use an OAuth2 JWT bearer token in the Authorization header of your API requests for supported endpoints: Authorization: Bearer <YOUR_JWT_HERE>.
These tokens are valid for 10 minutes and can be requested via the access token endpoint endpoint.
Path Parameters
Identifier of the resource in Payrails.
Query Parameters
Include latency in the response.
Include operation logs in the response.
Response
Success.
Hide child attributes
Hide child attributes
Unique identifier of the Payment Operation in Payrails.
Result of the Operation according to Payrails mapping from the provider response.
Success, Accepted, Pending, HTTPRedirectRequired, FormRedirectRequired, Unknown, UnexpectedProviderResponse, ProviderUnknownError, ProviderConnectionError, Timeout, ProviderTimeout, GenericRejection, FraudRisk, DuplicateOperation, OperationNotAllowed, InstrumentNotAllowed, InvalidInstrument, InsufficientBalance, BlockedInstrument, ExpiredInstrument, ValidationError, ParamsError, ProviderConfigError, InvalidSignature, InternalServerError, PayerCanceled, AuthenticationError, AuthenticationRequired, LimitExceeded, PaymentMethodNotSupported, AuthorizationRevoked Exact date and time when the Payment Operation was created in Payrails. Possibly differs slightly from the date in the PSP.
Exact date and time when the Payment Operation was updated in Payrails. Possibly differs slightly from the date in the PSP.
Unique identifier of the Payment that this Operation belongs to in Payrails.
Operation Type that was executed in the Provider.
Authorize, Preauthorize, Capture, Cancel, Refund, Credit, SendNotification, CaptureNotification, RefundNotification, CancelNotification, AuthorizeNotification, ChargebackNotification, ChargebackReverseNotification, Get, Search, GetToken, Tokenize, DisableToken, Register, Generate3DS, Validate3DS, PayerAuthInit, PayerAuthCheckEnroll, PayerAuthValidate, RefundFailedNotification, RefundReversedNotification, CaptureFailedNotification, ValidateRedirect, RefundNotificationUpdated Reason why the operation was done.
Unique identifier of the Payment Operation in an external system. Some PSPs provide a specific ID for each update in the Payment, but most of them use the same as the original Payment.
The payment status just after the operation done.
Original response code from the PSP, which Payrails interpreted for the result field.
In case a Provider requests an action to continue executing an Operation, this object contains the necessary information for it.
Hide child attributes
Hide child attributes
The URL that the Merchant should redirect the user to.
The HTTP method that should be used when redirecting to the redirectUrl.
GET, POST Map of parameters that are necessary for the redirection. In case the redirectMethod is GET, these parameters can be appended in the query string, but if it's POST, they should be sent via form.
Hide child attributes
Hide child attributes
Error details from the provider.
Acquirer Reference Number (ARN) for the Payment Operation (only Refunds and Captures), which we receive from some of the Provider.
Workspace ID that the workflow configuration belongs to.
List of operation logs associated with this operation.
Hide child attributes
Hide child attributes
Unique identifier of the Payment Operation Log in Payrails.
Exact date and time when the Payment Operation Log was created in Payrails. Possibly differs slightly from the date in the PSP.
Unique identifier of the Payment Operation that this Log belongs to in Payrails.
Original request object sent to the Provider.
Original response object received from the Provider.
Workspace ID that the workflow configuration belongs to.
Latency of the operation on the provider side.
Total latency of the operation.