curl --request GET \
--url https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions"
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/merchant/workflows/{workflowCode}/executions', 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/merchant/workflows/{workflowCode}/executions",
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/merchant/workflows/{workflowCode}/executions"
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/merchant/workflows/{workflowCode}/executions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions")
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{
"links": {
"self": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[after]=qf7pnbyfrr&page[size]=2",
"prev": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[before]=hbe66nh8i8&page[size]=2",
"next": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[after]=xk2h55zsy5&page[size]=2",
"first": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[size]=2",
"last": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[before]=9wkueqcavq&page[size]=2"
},
"results": [
{
"id": "5d0e7a85-c982-499f-bb7f-296b75bcbe10",
"status": [
{
"code": "created",
"time": "2022-02-03T14:38:41.557Z"
}
],
"createdAt": "2022-02-03T14:38:40.557Z",
"updatedAt": "2022-02-03T14:38:41.557Z",
"merchantReference": "order_3573894940903",
"holderReference": "customer123",
"workflow": {
"code": "payment-acceptance",
"version": 3
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a"
},
{
"id": "99e2f33a-2d17-4c98-8242-6bf5a4a08016",
"status": [
{
"code": "authorizeRequested",
"time": "2022-02-03T14:38:42.557Z"
},
{
"code": "created",
"time": "2022-02-03T14:38:41.557Z"
},
{
"code": "authorizePending",
"time": "2022-02-03T14:38:43.557Z"
}
],
"createdAt": "2022-02-03T14:38:40.557Z",
"updatedAt": "2022-02-03T13:38:39.886Z",
"merchantReference": "order_3573894940903",
"holderId": "9d113e2a-35a0-40e1-828b-35a18ac35b41",
"holderReference": "customer123",
"workflow": {
"code": "payment-acceptance",
"version": 3
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a"
}
]
}{
"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"
}
]
}Search & list executions
Fetch a list of merchant workflows executions for the given query parameters.
curl --request GET \
--url https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions"
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/merchant/workflows/{workflowCode}/executions', 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/merchant/workflows/{workflowCode}/executions",
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/merchant/workflows/{workflowCode}/executions"
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/merchant/workflows/{workflowCode}/executions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions")
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{
"links": {
"self": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[after]=qf7pnbyfrr&page[size]=2",
"prev": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[before]=hbe66nh8i8&page[size]=2",
"next": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[after]=xk2h55zsy5&page[size]=2",
"first": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[size]=2",
"last": "https://api.staging.payrails.io/merchant/workflows/f8600973-4790-4772-9e3c-299b3384d465/executions?page[before]=9wkueqcavq&page[size]=2"
},
"results": [
{
"id": "5d0e7a85-c982-499f-bb7f-296b75bcbe10",
"status": [
{
"code": "created",
"time": "2022-02-03T14:38:41.557Z"
}
],
"createdAt": "2022-02-03T14:38:40.557Z",
"updatedAt": "2022-02-03T14:38:41.557Z",
"merchantReference": "order_3573894940903",
"holderReference": "customer123",
"workflow": {
"code": "payment-acceptance",
"version": 3
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a"
},
{
"id": "99e2f33a-2d17-4c98-8242-6bf5a4a08016",
"status": [
{
"code": "authorizeRequested",
"time": "2022-02-03T14:38:42.557Z"
},
{
"code": "created",
"time": "2022-02-03T14:38:41.557Z"
},
{
"code": "authorizePending",
"time": "2022-02-03T14:38:43.557Z"
}
],
"createdAt": "2022-02-03T14:38:40.557Z",
"updatedAt": "2022-02-03T13:38:39.886Z",
"merchantReference": "order_3573894940903",
"holderId": "9d113e2a-35a0-40e1-828b-35a18ac35b41",
"holderReference": "customer123",
"workflow": {
"code": "payment-acceptance",
"version": 3
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a"
}
]
}{
"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
Path parameter to specify the workflow code. Machine-friendly code of Workflow.
^[a-z][-A-Za-z0-9]*$Query Parameters
Filter executions by merchant reference.
Filter executions by holder reference.
Filter by Workspace ID.
Filter by workflow code.
Filter by workflow version.
Filter by last status.
Search collection items after that cursor. Cursor for paging results.
Search collection items before that cursor. Cursor for paging results.
Length of the collection to search.
Response
Success.
Hide child attributes
Hide child attributes
ID of this execution.
When this execution was started.
When the last event occurred for this execution.
Business-case dependent set of status tags of this execution. The order of statuses does not matter and should not be used for any logic.
Hide child attributes
Hide child attributes
Business-case dependent status code.
When this execution status was set.
The reason why the status was set, absent if the status isn't an error status.
Hide child attributes
Hide child attributes
Unique identifier of the error. Please use this value when reporting an issue to our team, so we can help you faster.
Human-readable description about the error, its cause, and resolution.
Link to the specific documentation about this particular code.
Metadata providing more details about the reason of the error. The structure of this object varies according to the code.
Merchant-provided reference for the Execution. Commonly, the identifier of the order on the Merchant's system.
"order_15415"
Merchant-provided reference for the transaction counterparty, i.e. the paying consumer.