Payments

Before you can run live payments, we require you to run our test cases to make sure that you have correctly integrated against our API.
Note: If you have any issues when you run our test cases, email our integrations team at [email protected].

Before you begin

To help you with testing, we provide you with:
  • Test environment
  • Test cards
  • Test values
You should also review our testing recommendations.

Test environment

Send your requests to our test environment: Test environment base URI: https://api.uat.payroc.com/v1
Important: Use only test cards in our test environment.

Authenticating your requests

Use our test Identity Service to generate a Bearer token to include in the header of your requests. To generate your Bearer token, complete the following steps:
  1. Include your API key in the x-api-key parameter in the header of a POST request.
  2. Send your request to https://identity.uat.payroc.com/authorize.
Note: You need to generate a new Bearer token before the previous Bearer token expires.

Example request

curl --location --request POST 'https://identity.uat.payroc.com/authorize' --header 'x-api-key: <api key>'

Example response

If your request is successful, we return a response that contains your Bearer token, information about its scope, and when it expires.
{ "access_token": "eyJhbGc....adQssw5c", "expires_in": 3600, "scope": "service_a service_b", "token_type": "Bearer" }

Example request header

curl -H "Authorization: Bearer <access token>"

Test cards

Note: Our gateway accepts any value for the CVV.
Card schemeCard numberRequires CVV?
American Express3400000000000000Yes
Debit MasterCard5100270000000007Yes
Diners3600000000000008No
Discover6011000000000004Yes
JCB3528000000000007Yes
Maestro5000330000000000Yes
MasterCard5001650000000000Yes
Visa Credit4539858876047062Yes
Visa Debit4000060000000006Yes
Visa Electron4001020000000009No

EBT test cards

Note: You can only test EBT transactions if the processor is Fiserv or TSYS.
Card numberBenefit categoryPIN
6007602801003837964Food Stamp1234
6007602801003837965Food Stamp1234
060076028010038379673Cash Only1234
6007602801003837968Cash Only1234
6007602801003837969Cash Only1234
6007602801003837971Inactive card1234

Test values

To return a specific response from the gateway, change the value in the amount parameter to end in one of the following values:
ValueResponseExample
01Declined501
02Referral1002
03CVV failure1403
Any otherAuthorized4541

Testing recommendations

Important: Do not use live card data to test your integration. This is a breach of PCI DSS.
When you test your integration, we recommend that you do the following:
  • Test error scenarios – To check that your integration can handle errors, run scenarios that produce errors. For example, test that your integration can handle the response when the value for a request parameter is in the wrong format.
  • Follow PCI DSS – To help protect the payment data, make sure that your integration complies with PCI DSS.
  • Test all card types – If your integration accepts multiple card types, test your integration with each card type. For example, if your integration accepts EBT cards, you should test with an EBT card.
  • Refresh tokens for authenticationBearer tokens expire after a fixed period. Test your integration to make sure that it can correctly refresh Bearer tokens.

Test cases

We provide you with test cases for the following:

Card payments

Run a card sale without a surcharge

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/payments Example response
{
"paymentId": "F1I17KBL0E",
"processingTerminalId": "3204001",
"order": {
"orderId": "Test_001",
"dateTime": "2023-05-24T14:44:20.63+01:00",
"amount": 4000,
"currency": "USD"
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardNumber": "444433******1111",
"expiryDate": "0334",
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"paymentResult": {
"type": "sale",
"status": "ready",
"approvalCode": "OK14472",
"authorizedAmount": 4000,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK14472"
}
}

Run a card sale with a surcharge

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/payments
Note: If you are unsure whether your account supports surcharges, email our Integration team at [email protected].
Example response
{
"paymentId": "CBA7UOVS0J",
"processingTerminalId": "3204001",
"order": {
"orderId": "Test_005",
"dateTime": "2023-05-24T14:48:39.548+01:00",
"amount": 4160,
"currency": "USD",
"breakdown": {
"subtotal": 4000,
"surcharge": {
"bypass": false,
"amount": 160,
"percentage": 4.0
}
}
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardNumber": "444433******1111",
"expiryDate": "0334",
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"paymentResult": {
"type": "sale",
"status": "ready",
"approvalCode": "OK14476",
"authorizedAmount": 4160,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK14476"
}
}

Run a pre-authorization

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/payments
Note: Set the value for the autoCapture parameter to false.
Example response
{
"paymentId": "C7BHY7KWCW",
"processingTerminalId": "3204001",
"operator": "Davi-Crisostomo-CHP",
"order": {
"orderId": "1234567890Q1",
"dateTime": "2023-06-20T21:03:30.925+01:00",
"description": "PreAuth Card Transaction (WEB) - Sale - KEYED (plain_text) with CVV",
"amount": 12346,
"currency": "USD"
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardholderName": "Davi",
"cardNumber": "444433******1111",
"expiryDate": "1223",
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"transactionResult": {
"type": "sale",
"status": "pending",
"approvalCode": "OK24233",
"authorizedAmount": 12346,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK24233"
}
}

Capture a pre-authorization

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/payments/{paymentId}/capture Example response
{
"paymentId": "C7BHY7KWCW",
"processingTerminalId": "3204001",
"operator": "Davi-Crisostomo-CHP",
"order": {
"orderId": "1234567890Q1",
"dateTime": "2023-06-20T21:03:31+01:00",
"description": "PreAuth Card Transaction (WEB) - Sale - KEYED (plain_text) with CVV",
"amount": 6532,
"currency": "USD"
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardholderName": "Davi",
"cardNumber": "444433******1111",
"expiryDate": "1223",
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"transactionResult": {
"type": "sale",
"status": "ready",
"approvalCode": "OK24233",
"authorizedAmount": 6532,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK24233"
}
}

Adjust a card payment

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/payments/{paymentId}/adjust Example response
{
"paymentId": "C7BHY7KWCW",
"processingTerminalId": "3204001",
"operator": "ROBBIE-KIRWAN-adjust",
"order": {
"orderId": "1234567890Q1",
"dateTime": "2023-06-20T21:03:31+01:00",
"description": "PreAuth Card Transaction (WEB) - Sale - KEYED (plain_text) with CVV",
"amount": 400,
"currency": "USD"
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardholderName": "Davi",
"cardNumber": "444433******1111",
"expiryDate": "1223",
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"transactionResult": {
"type": "sale",
"status": "ready",
"approvalCode": "OK24233",
"authorizedAmount": 400,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK24233"
}
}

Secure tokens

Create a secure token

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/secure-tokens Example response
{
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"processingTerminalId": "3204001",
"source": {
"type": "card",
"cardholderName": "",
"cardNumber": "444433******1111",
"expiryDate": "1226"
},
"token": "2967538502417872",
"status": "cvv_validated"
}

Create a payment with a secure token

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/payments Example response
{
"paymentId": "C8Y177VHWR",
"processingTerminalId": "3204001",
"order": {
"orderId": "Test_006",
"dateTime": "2023-05-24T15:21:01.037+01:00",
"amount": 4000,
"currency": "USD"
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardNumber": "444433******1111",
"expiryDate": "1226",
"secureToken": {
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"customerName": "",
"token": "2967538502417872",
"status": "cvv_validated",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
}
},
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"transactionResult": {
"type": "sale",
"status": "ready",
"approvalCode": "OK14486",
"authorizedAmount": 4000,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK14486",
"cardSchemeReferenceId": "JxDfFMHyOE2lyQJ2MnFp"
}
}

Delete a secure token

Send a DELETE request to the following endpoint: DELETE https://api.uat.payroc.com/v1/payments/processing-terminals/{processingTerminalId}/secure-tokens/{secureTokenId}
Example response
No response body.

Update a secure token

Send a PATCH request to the following endpoint: PATCH https://api.uat.payroc.com/v1/payments/processing-terminals/{processingTerminalId}/secure-tokens/{secureTokenId} Example response
{
"secureTokenId": "MREF_fe532d13-d330-4872-b646-61750144030bG4",
"processingTerminalId": "3204001",
"customer": {
"contactMethods": [
{
"type": "email",
"value": "[email protected]"
}
]
},
"source": {
"type": "card",
"cardholderName": "Test Card 13 Uat Usa",
"cardNumber": "374245*****1003",
"expiryDate": "1224"
},
"token": "2967538321403871",
"status": "cvv_validated"
}

Payment plans and subscriptions

Create a payment plan

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/payment-plans Example response
{
"paymentPlanId": "PaymentPlanTest",
"processingTerminalId": "3204001",
"name": "Davi Crisostomo",
"description": "Payment Plan creation",
"currency": "USD",
"setupOrder": {
"amount": 11000,
"description": "Setup Amount"
},
"length": 24,
"type": "manual",
"frequency": "monthly",
"onUpdate": "update",
"onDelete": "complete"
}

Update a payment plan

Send a PATCH request to the following endpoint: PATCH https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/payment-plans/{paymentPlanId} Example response
{
"paymentPlanId": "PaymentPlanTest",
"processingTerminalId": "3204001",
"name": "Davi Crisostomo",
"description": "Payment Plan creation",
"currency": "USD",
"setupOrder": {
"amount": 11000,
"description": "Setup Amount"
},
"length": 24,
"type": "automatic",
"frequency": "weekly",
"onUpdate": "update",
"onDelete": "complete"
}

Create a subscription for a payment plan

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions Example response
{
"subscriptionId": "SubTest",
"processingTerminalId": "3204001",
"paymentPlan": {
"paymentPlanId": "PaymentPlanTest",
"name": "Davi Crisostomo",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/payment-plans/PaymentPlanTest"
}
},
"secureToken": {
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"customerName": "",
"token": "2967538502417872",
"status": "cvv_validated",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
}
},
"name": "Davi Crisostomo",
"description": "Create Subscription from ICC payment",
"currency": "USD",
"setupOrder": {
"orderId": "TheOrderID",
"amount": 11000,
"description": "Desription of SETUPORDER"
},
"recurringOrder": {
"amount": 11000,
"description": "RECURRING Order price"
},
"currentState": {
"status": "active",
"nextDueDate": "2023-08-02",
"paidInvoices": 0,
"outstandingInvoices": 122
},
"startDate": "2023-08-02",
"endDate": "2025-12-02",
"length": 24,
"type": "automatic",
"frequency": "weekly",
"pauseCollectionFor": 0
}

Manually pay a subscription

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}/pay Example response
{
"paymentId": "KOHM1D3EZH",
"processingTerminalId": "3204001",
"operator": "Davi Crisostomo",
"order": {
"orderId": "UniqueValueForOrderID",
"dateTime": "2023-06-20T20:25:57.641+01:00",
"description": "Subscription Payment - Manual",
"amount": 11000,
"currency": "USD"
},
"card": {
"type": "Visa Credit",
"entryMethod": "keyed",
"cardNumber": "444433******1111",
"expiryDate": "1226",
"secureToken": {
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"customerName": "",
"token": "2967538502417872",
"status": "cvv_validated",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
}
},
"securityChecks": {
"cvvResult": "M",
"avsResult": "Y"
}
},
"transactionResult": {
"type": "sale",
"status": "ready",
"approvalCode": "OK24225",
"authorizedAmount": 11000,
"currency": "USD",
"responseCode": "A",
"responseMessage": "OK24225",
"cardSchemeReferenceId": "nkMX2G7ZqPavgbYiYacQ"
}
}

Update a subscription

Send a PATCH request to the following endpoint: PATCH https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId} Example response
{
"subscriptionId": "SubTest",
"processingTerminalId": "3204001",
"paymentPlan": {
"paymentPlanId": "PaymentPlanTest",
"name": "Davi Crisostomo",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/payment-plans/PaymentPlanTest"
}
},
"secureToken": {
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"customerName": "",
"token": "2967538502417872",
"status": "cvv_validated",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
}
},
"name": "Davi Crisostomo",
"description": "NEW DESCRIPTION FOR SUBSCRIPTION",
"currency": "USD",
"setupOrder": {
"orderId": "TheOrderID",
"amount": 11000,
"description": "Desription of SETUPORDER"
},
"recurringOrder": {
"amount": 11000,
"description": "RECURRING Order price"
},
"currentState": {
"status": "active",
"nextDueDate": "2023-08-02",
"paidInvoices": 1,
"outstandingInvoices": 121
},
"startDate": "2023-08-02",
"endDate": "2025-12-02",
"length": 24,
"type": "automatic",
"frequency": "weekly",
"pauseCollectionFor": 0
}

Deactivate a subscription

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}/deactivate Example response
{
"subscriptionId": "SubTest",
"processingTerminalId": "3204001",
"paymentPlan": {
"paymentPlanId": "PaymentPlanTest",
"name": "Davi Crisostomo",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/payment-plans/PaymentPlanTest"
}
},
"secureToken": {
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"customerName": "",
"token": "2967538502417872",
"status": "cvv_validated",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
}
},
"name": "Davi Crisostomo",
"description": "NEW DESCRIPTION FOR SUBSCRIPTION",
"currency": "USD",
"setupOrder": {
"orderId": "TheOrderID",
"amount": 11000,
"description": "Desription of SETUPORDER"
},
"recurringOrder": {
"amount": 11000,
"description": "RECURRING Order price"
},
"currentState": {
"status": "cancelled",
"nextDueDate": "2023-08-02",
"paidInvoices": 1,
"outstandingInvoices": 121
},
"startDate": "2023-08-02",
"endDate": "2025-12-02",
"length": 24,
"type": "automatic",
"frequency": "weekly",
"pauseCollectionFor": 0
}

Re-activate a subscription

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}/reactivate Example response
{
"subscriptionId": "SubTest",
"processingTerminalId": "3204001",
"paymentPlan": {
"paymentPlanId": "PaymentPlanTest",
"name": "Davi Crisostomo",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/payment-plans/PaymentPlanTest"
}
},
"secureToken": {
"secureTokenId": "MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA",
"customerName": "",
"token": "2967538502417872",
"status": "cvv_validated",
"link": {
"rel": "self",
"method": "GET",
"href": "https://api.uat.payroc.com/v1/processing-terminals/3204001/secure-tokens/MREF_1a93f3a6-9029-419f-9e87-3e2db6f0ae85uA"
}
},
"name": "Davi Crisostomo",
"description": "NEW DESCRIPTION FOR SUBSCRIPTION",
"currency": "USD",
"setupOrder": {
"orderId": "TheOrderID",
"amount": 11000,
"description": "Desription of SETUPORDER"
},
"recurringOrder": {
"amount": 11000,
"description": "RECURRING Order price"
},
"currentState": {
"status": "active",
"nextDueDate": "2023-08-02",
"paidInvoices": 1,
"outstandingInvoices": 121
},
"startDate": "2023-08-02",
"endDate": "2025-12-02",
"length": 24,
"type": "automatic",
"frequency": "weekly",
"pauseCollectionFor": 0
}

Bank transfers

Run a sale with bank account details

Send a POST request to the following endpoint: POST https://api.uat.payroc.com/v1/bank-transfer-payments Example response
{
"channel": "POS",
"processingTerminalId": "3204001",
"operator": "Davi-CHP",
"order": {
"orderId": "CC-12",
"description": "BT ACH - Sale with CC",
"currency": "USD",
"amount": 9700
},
"paymentMethod": {
"type": "ach",
"accountType": "checking",
"secCode": "web",
"nameOnAccount": "Davi",
"accountNumber": "49100130",
"routingNumber": "292735277"
}
}