curl --request POST \
--url https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"merchantReference": "order_3573894940903",
"holderReference": "1231905323475"
}
'{
"id": "5d0e7a85-c982-499f-bb7f-296b75bcbe10",
"status": [
{
"code": "created",
"time": "2022-02-03T14:38:41.557Z"
}
],
"createdAt": "2022-02-03T14:38:40.557Z",
"merchantReference": "order_3573894940903",
"holderId": "9d113e2a-35a0-40e1-828b-35a18ac35b41",
"holderReference": "customer123",
"workflow": {
"version": 3,
"code": "payment-acceptance"
},
"meta": {
"order": {
"reference": "order_3573894940903"
},
"customer": {
"reference": "1231905323475",
"country": {
"code": "DE"
}
},
"clientContext": {
"ipAddress": "217.110.239.132",
"osType": "ios"
}
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"links": {
"self": "https://api.staging.payrails.io/merchant/workflows/100ade99-ef8d-43de-8a35-4d31dbdb37d0/executions/99e2f33a-2d17-4c98-8242-6bf5a4a08016",
"lookup": {
"method": "POST",
"href": "https://api.staging.payrails.io/merchant/workflows/100ade99-ef8d-43de-8a35-4d31dbdb37d0/executions/99e2f33a-2d17-4c98-8242-6bf5a4a08016/lookup"
}
}
}Create an execution
Create a workflow execution.
curl --request POST \
--url https://api.staging.payrails.io/merchant/workflows/{workflowCode}/executions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"merchantReference": "order_3573894940903",
"holderReference": "1231905323475"
}
'{
"id": "5d0e7a85-c982-499f-bb7f-296b75bcbe10",
"status": [
{
"code": "created",
"time": "2022-02-03T14:38:41.557Z"
}
],
"createdAt": "2022-02-03T14:38:40.557Z",
"merchantReference": "order_3573894940903",
"holderId": "9d113e2a-35a0-40e1-828b-35a18ac35b41",
"holderReference": "customer123",
"workflow": {
"version": 3,
"code": "payment-acceptance"
},
"meta": {
"order": {
"reference": "order_3573894940903"
},
"customer": {
"reference": "1231905323475",
"country": {
"code": "DE"
}
},
"clientContext": {
"ipAddress": "217.110.239.132",
"osType": "ios"
}
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"links": {
"self": "https://api.staging.payrails.io/merchant/workflows/100ade99-ef8d-43de-8a35-4d31dbdb37d0/executions/99e2f33a-2d17-4c98-8242-6bf5a4a08016",
"lookup": {
"method": "POST",
"href": "https://api.staging.payrails.io/merchant/workflows/100ade99-ef8d-43de-8a35-4d31dbdb37d0/executions/99e2f33a-2d17-4c98-8242-6bf5a4a08016/lookup"
}
}
}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.
Headers
Idempotency key to be used. Sending again the same key would return the same result without re-executing the update.
Path Parameters
Path parameter to specify the workflow code. Machine-friendly code of Workflow.
^[a-z][-A-Za-z0-9]*$Body
- Payment.
- Payout.
Merchant-provided reference for the Execution. Commonly, the identifier of the order on the Merchant's system.
Merchant-provided reference for the execution counterparty, i.e. the paying consumer.
References in which workspace the execution will be created.
Merchant-provided configuration data for a particular execution, overriding values for the workflow.
Hide child attributes
Hide child attributes
Mode of capture for the payments involved in the execution. * Instant - Authorize and capture payments in one step. * Delayed - Authorize payments initially, capture the money after a delay configured with captureDelay. * Manual - Authorize payments initially, capture the money manually via Payrails' API or portal.
Instant, Delayed, Manual If captureMode is Delayed, this field can be used to configure the scheduled time when to capture the money. The format should be based on the ISO 8601 standard.
Mode of cancel for the payments involved in the execution. * Delayed - Authorize payments initially, cancel the authorization after a delay configured with cancelDelay. * Manual - Authorize payments initially, cancel the authorization manually via Payrails' API or portal.
Delayed, Manual If cancelMode is Delayed, this field can be used to configure the scheduled time when to cancel the authorization. The format should be based on the ISO 8601 standard.
Version of a Workflow Configuration.
Metadata for the context of an execution. Includes Payrails-defined structures for most common fields used in workflows, but can also be extended by merchant or provider-specific fields. For more information, visit our Meta Fields guide. See Meta for every field.
ID of the Apple Pay configuration to use for this request. When provided, Apple Pay will be enabled as a payment method.
Actions to execute after the creation of the execution. Initial actions are performed sequentially, and results reported in corresponding items of initialResults irrespective of errors in earlier actions.
- Initial Lookup action.
- Initial Start Payment Session action.
- Initial Payment Authorize action.
Hide child attributes
Hide child attributes
Execute an initial lookup action.
lookup POST Hide child attributes
Hide child attributes
Metadata for the context of an execution. Includes Payrails-defined structures for most common fields used in workflows, but can also be extended by merchant or provider-specific fields. For more information, visit our Meta Fields guide. See Meta for every field.
Response
Created.
- Payment
- Payout
ID of 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.
When this execution was started.
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.
Unique identifier of the Holder in Payrails.
Amount of the execution. Only present if an amount has been set on the execution via an action (lookup, authorize, etc.).
Metadata for the context of an execution. Includes Payrails-defined structures for most common fields used in workflows, but can also be extended by merchant or provider-specific fields. For more information, visit our Meta Fields guide. See Meta for every field.
Results of the initialActions specified during execution creation.
Indexes of this array correspond one to one with those from initialActions,
each initial action reports their result here.
Hide child attributes
Hide child attributes
The HTTP code returned by the action invocation.
- Initial Lookup action result.
- Initial Start Payment Session action result.
- Initial Payment Authorize action result.
Hide child attributes
Hide child attributes
Lookup the available payment methods and instruments.
lookup Unique identifier for this action execution. If its processing is done asynchronously, you will receive a notification with the same actionId.
Date and time when execution of the Action was started.
Links to the next possible actions that can be taken.
Lookup action results.
Hide child attributes
Hide child attributes
List of Payment Methods and Payment Instruments that can be used to complete the execution.
Hide child attributes
Hide child attributes
Code of the integration type for using the payment method in the provider.
api, hpp, inperson Description of the Payment Method.
Code of the payment method selected to perform the payment.
alexBankMa7fazty, amazonPay, applePay, audi2pay, alfa, alipay, bankTransfer, card, 2c2p, capitecPay, cibSmartWallet, easypaisa, etisalatCash, fawryMobileWallet, fawryPay, googlePay, jazzCash, mercadoPago, monoDirectDebit, nbePhoneCash, orangeCash, oPayWallet, pagaWallet, payflex, payjustnow, payPal, pix, konnect, qnbEWallet, wafaCashWallet, weCash, genericRedirect, eftPro, upi, cashFreeWallet, paytmMWallet, netBanking, meezaWallet, vodafoneCash, alipayQRCode, sepaDirectDebit, dcb, bankAccount, modo, ach, payzoneCash, revolutPay, lean, tabby, boleto, oxxo, spei, promptPay, qris, momoVN, vietQR, konbini, touchNGo, gCash, maya, pse, pagoEfectivo, napas, duitNowQR, grabPay, shopeePay, nequi, picPay, ovo, trueMoney, iDeal, bancontact, khipu, razerGold, webPay, smartPix, venmo, klarnaPayLater, klarnaPayNow, klarnaPayOverTime, knet, scalapay Provider code for which the payment composition option is available.
Provider-specific data needed by to use the payment method for a payment.
List of stored Payment Instruments for this Method that belong to the specified holder. By default, only includes the ones with status Created or Enabled.
Hide child attributes
Hide child attributes
Id of the instrument.
Date and time when the Instrument was created in Payrails.
When the Instrument was last updated.
Unique identifier of the Holder in Payrails.
Represents the payment method type.
alexBankMa7fazty, applePay, audi2pay, bankAccount, card, 2c2p, vietQR, cibSmartWallet, easypaisa, etisalatCash, fawryMobileWallet, fawryPay, googlePay, jazzCash, nbePhoneCash, orangeCash, payPal, qnbEWallet, weCash, genericRedirect, alfa, konnect, eftPro, netBanking, upi, cashFreeWallet, paytmWallet, phonePe, iDeal, bancontact, klarnaPayLater, klarnaPayNow, klarnaPayOverTime, scalapay Status of the instrument.
created, deleted, enabled, disabled, transient Instrument name suitable for display.
Description of the instrument.
True if this instrument is set as default for the holder.
Merchant-provided reference for the instrument.
System-wide unique identifier of the Instrument. If two Holders have the same instrument stored, this value will be the same for both, but the instrument and token IDs will be different. Cannot be used for payments, should only be used for analytics and fraud prevention.
Represents the future usage to define the payment flows that the stored instrument will be used for.
Subscription, CardOnFile, UnscheduledCardOnFile Identifier of the initial payment made with this instrument on the Networks, e.g. Mastercard Trace ID or Visa Transaction ID.
Mastercard Transaction Link Identifier (TLID) of the transaction series this instrument belongs to. Returned by the card network on the initial cardholder-initiated transaction and required on economically related merchant-initiated transactions, such as recurring payments and installments, when the series spans payment providers.
Type-specific information about the instrument.
- Card
- BankAccount
- PayPal
- GooglePay
- ApplePay
- DCB
- MBWay
Hide child attributes
Hide child attributes
Network of the instrument.
unspecified, visa, visadankort, mastercard, amex, diners, discover, unionpay, unionpayuzcard, maestro, maestrobancontact, hipercard, jcb, jcblankapay, argencard, aura, belkart, bpfuelcard, cabal, carnet, cirrus, chjonesfuelcard, uzcard, codensa, dankort, dinacard, duet, ebt, eftpos, elo, euroshellfuelcard, gecapital, bc, hrgstore, humo, lankapay, lukoilfuelcard, bancontact, meeza, newday, mir, ourocard, pagobancomat, paypak, paypal, phhfuelcard, prostir, rupay, sbercard, sodexo, starrewards, cencosud, naranja, troy, uatp, ukfuelcard, verve, voyager, vpay, wex, cmi, atm, bankcard, localbrand, loyalty, privatelabel, fuelcard, redfuelcard, redliquidfuelcard First 6-8 digits of the Card number. Also known as IIN (Issuer Identification Number).
6 - 8"416598"
Last digits of the Card number.
4Network of the instrument.
unspecified, visa, visadankort, mastercard, amex, diners, discover, unionpay, unionpayuzcard, maestro, maestrobancontact, hipercard, jcb, jcblankapay, argencard, aura, belkart, bpfuelcard, cabal, carnet, cirrus, chjonesfuelcard, uzcard, codensa, dankort, dinacard, duet, ebt, eftpos, elo, euroshellfuelcard, gecapital, bc, hrgstore, humo, lankapay, lukoilfuelcard, bancontact, meeza, newday, mir, ourocard, pagobancomat, paypak, paypal, phhfuelcard, prostir, rupay, sbercard, sodexo, starrewards, cencosud, naranja, troy, uatp, ukfuelcard, verve, voyager, vpay, wex, cmi, atm, bankcard, localbrand, loyalty, privatelabel, fuelcard, redfuelcard, redliquidfuelcard Information about an issuer by the given BIN (or IIN).
Hide child attributes
Hide child attributes
First 6-8 digits of the Card number. Also known as IIN (Issuer Identification Number).
6 - 8"416598"
Network of the instrument.
unspecified, visa, visadankort, mastercard, amex, diners, discover, unionpay, unionpayuzcard, maestro, maestrobancontact, hipercard, jcb, jcblankapay, argencard, aura, belkart, bpfuelcard, cabal, carnet, cirrus, chjonesfuelcard, uzcard, codensa, dankort, dinacard, duet, ebt, eftpos, elo, euroshellfuelcard, gecapital, bc, hrgstore, humo, lankapay, lukoilfuelcard, bancontact, meeza, newday, mir, ourocard, pagobancomat, paypak, paypal, phhfuelcard, prostir, rupay, sbercard, sodexo, starrewards, cencosud, naranja, troy, uatp, ukfuelcard, verve, voyager, vpay, wex, cmi, atm, bankcard, localbrand, loyalty, privatelabel, fuelcard, redfuelcard, redliquidfuelcard Card local network that supports the card, e.g. CartesBancaires, Dankort, Mada, Bancontact.
bancontact, cartesbancaires, dankort, mada Name of the bank or institution that issued the card.
Country of the bank or institution that issued the card.
Hide child attributes
Hide child attributes
ISO 3166-1 alpha-2 country code.
^[A-Z]{2}$ISO 3-letter country code. Returned by Payrails, but not interpreted in requests.
^[A-Z]{3}$The English name of the country. Returned by Payrails, but not interpreted in requests.
Segment of the card, e.g. gold, black, business.
Type of the card, e.g. credit, debit, prepaid, gift.
More information about the card type, e.g. personal, commercial.
Indicates whether the card credential represents a network token rather than a primary account number (PAN).
Indicates whether the card is enrolled in a Flexible Credential or Flex Card program supported by the network - e.g. Visa Flexible Credential, Mastercard FlexCard.
Billing Address of the instrument.
Hide child attributes
Hide child attributes
The name of the street of a postal address.
The number on the door, building, or room.
Additional addressing information, 2nd line of postal address.
The name of the suburb or area within a city.
The name of the city of a postal address.
The postal code.
The name of the state a postal address is in.
The country where the address is in.
Hide child attributes
Hide child attributes
ISO 3166-1 alpha-2 country code.
^[A-Z]{2}$ISO 3-letter country code. Returned by Payrails, but not interpreted in requests.
^[A-Z]{3}$The English name of the country. Returned by Payrails, but not interpreted in requests.
Latitude of the address in the GPS coordinate system.
Longitude of the address in the GPS coordinate system.
The phone to contact in the address (can be different that the customer's).
Hide child attributes
Hide child attributes
The local number of the phone, such that countryCode + number can be dialed.
^[0-9]+$International prefix of the phone, if known separately.
^\+?[0-9]+$Name of the address, e.g. home, work.
Name of the person to whom the address belongs to.
Last name of the person to whom the address belongs to.
Email of the person to whom the address belongs to.
Expiry month of the Card.
2Expiry year of the Card.
4Name of the owner of the Card.
Payer-provided tax identification number (e.g. CPF in Brazil) collected on the instrument.
List of tokens inside the instrument. Not included by default, includeTokens query parameter must be used.
Hide child attributes
Hide child attributes
Id of the token in Payrails.
Date and time when the Token was created in Payrails.
When the Token was last updated.
Id of the payment instrument the token belongs to.
Status of the token.
created, enabled, disabled, deleted Type of the token.
network, vault, psp, networkOffers, networkGateway Id of the provider the token belongs to.
Unique identifier of the token in the provider's system.
Id of the configuration in the provider the token belongs to.
Any merchant or provider-specific data that should be stored for context in the token.
Contains information related to the payment method and integration type.
Hide child attributes
Hide child attributes
The payment method name.
Returns true if the payment method supports storing a payment instrument.
Returns true if the merchant wants to collect billing information during checkout and if this information is supported by the payment methods.
Enum with values direct and redirect, direct is set only when a payment method does not require redirecting the end user to a provider page to proceed with authorization.
Specific configuration needed for the payment method.
Schema for the payment method.
Returns true if the payment method supports paying in installments.
Installment plans keyed by ISO 3166-1 alpha-2 country. Empty when no plans are available for this card and amount.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Number of installments. Sent back as installments.count at authorize.
6
Amount paid per installment.
20
Total paid across all installments, including financing cost. May exceed the transaction amount.
120
Ready-to-render description of the plan. Always present for live plans.
"6 cuotas de S/ 20.000,00 (S/ 120.000,00)"
Financing rate as a percentage. 0 is a genuine interest-free offer; absent means no rate was supplied.
32.14
Discount as a percentage. Absent and 0 differ, as for installmentRate.
Marks the plan the provider suggests emphasising.
The card issuer applies the financing cost, so totalAmount is indicative.
Financing rates a market requires be displayed, e.g. CFT and TEA. Values keep the provider's formatting.
Hide child attributes
Hide child attributes
Name of the rate.
"CFT"
Rate as the provider expressed it.
"169,00%"
Conditions the plan imposes beyond the normal card flow. Ignore unrecognised values and hide the plan.
threeDSecure, cardVerificationCode Opaque plan handle. Echo it back at authorize when present; never parse or display it.
{
"BR": [
{ "count": 2, "amount": 60 },
{ "count": 6, "amount": 20 }
]
}
Unique identifier of a workspace in Payrails.
Workspace ID that that this execution belongs to.
Links to the next possible actions that can be taken.
Hide child attributes
Hide child attributes
Link related information.
Details of the next possible actions that can be taken.
Hide child attributes
Hide child attributes
Type of the required action.
redirect, confirm, review, wait Sub type of the required action.
merchant, client, internal Details of the required action.
URL to complete the required action.
HTTP method that should be used to call the href.
GET, POST, PUT, PATCH, DELETE Details of a prerequisite action, which needs to be executed prior calling the provided link.
Action the customer needs to take to move the Execution state. A link with the same name should be used to continue.
3ds, confirm