curl --location --request POST 'https://identity.payroc.com/authorize' --header 'x-api-key: <api key>'
{"access_token": "eyJhbGc....adQssw5c","expires_in": 3600,"scope": "service_a service_b","token_type": "Bearer"}
curl-H "Content-Type: application/json"-H "Authorization: <Bearer token>"-H "Idempotency-Key: <UUID v4>"
false
in the request body. If both parameters are set to true
, the transaction runs as a sale instead of a pre-authorization.
To run a pre-authorization, send a POST request to our Payments endpoint.
Test endpoint: https://api.uat.payroc.com/v1/paymentscurl --request post \--url https://api.payroc.com/v1/payments \--header 'Authorization: Bearer <access token>' \--header 'Content-Type: application/json' \--header 'Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324' \--data '{"channel":"web","processingTerminalId":"1234001","operator":"Postman","order":{"orderId":"OrderRef6543","description":"Large Pepperoni Pizza","currency":"USD","amount":4999},"customer":{"firstName":"Sarah","lastName":"Hopper","billingAddress":{"address1":"1 Example Ave.","address2":"Example Address Line 2","address3":"Example Address Line 3","city":"Chicago","state":"Illinois","country":"US","postalCode":"60056"},"shippingAddress":{"recipientName":"Sarah Hopper","address":{"address1":"1 Example Ave.","address2":"Example Address Line 2","address3":"Example Address Line 3","city":"Chicago","state":"Illinois","country":"US","postalCode":"60056"}}},"paymentMethod":{"type":"card","cardDetails":{"entryMethod":"keyed","keyedData":{"dataFormat":"plainText","device":{"model":"paxA80","serialNumber":"WPC202833004712"},"expiryDate":"1225","cardNumber":"4539858876047062"}}},"customFields":[{"name":"yourCustomField","value":"abc123"}]}'
paymentId
to use when you capture the payment.application/json
{"paymentId": "M2MJOG6O2Y","processingTerminalId": "1234001","operator": "Postman","order": {"orderId": "OrderRef6543","dateTime": "2024-07-02T15:30:00Z","description": "Large Pepperoni Pizza","amount": 4999,"currency": "USD"},"customer": {"firstName": "Sarah","lastName": "Hopper","billingAddress": {"address1": "1 Example Ave.","address2": "Example Address Line 2","address3": "Example Address Line 3","city": "Chicago","state": "Illinois","country": "US","postalCode": "60056"},"shippingAddress": {"recipientName": "Sarah Hopper","address": {"address1": "1 Example Ave.","address2": "Example Address Line 2","address3": "Example Address Line 3","city": "Chicago","state": "Illinois","country": "US","postalCode": "60056"}}},"card": {"type": "MasterCard","entryMethod": "keyed","cardNumber": "453985******7062","expiryDate": "1225","securityChecks": {"cvvResult": "M","avsResult": "Y"}},"supportedOperations": ["capture","fullyReverse","partiallyReverse","incrementAuthorization","adjustTip","setAsPending"],"transactionResult": {"type": "sale","status": "ready","approvalCode": "OK3","authorizedAmount": 4999,"currency": "USD","responseCode": "A","responseMessage": "OK3"},"customFields": [{"name": "yourCustomField","value": "abc123"}]}
curl --request post \--url https://api.payroc.com/v1/payments/M2MJOG6O2Y/adjust \--header 'Authorization: Bearer <access token>' \--header 'Content-Type: application/json' \--header 'Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324' \--data '{"adjustments":[{"type":"customer","shippingAddress":{"recipientName":"Sarah Hopper","address":{"address1":"1 Example Ave.","address2":"Example Address Line 2","address3":"Example Address Line 3","city":"Chicago","state":"Illinois","country":"US","postalCode":"60056"}}},{"type":"order","amount":3999}]}'
application/json
{"paymentId": "M2MJOG6O2Y","processingTerminalId": "1234001","order": {"orderId": "OrderRef6543","dateTime": "2024-07-02T15:30:00Z","description": "Example payment","amount": 4999,"currency": "USD"},"customer": {"firstName": "Sarah","lastName": "Hopper","billingAddress": {"address1": "1 Example Ave.","address2": "Example Address Line 2","address3": "Example Address Line 3","city": "Chicago","state": "Illinois","country": "US","postalCode": "60056"},"shippingAddress": {"recipientName": "Sarah Hopper","address": {"address1": "1 Example Ave.","address2": "Example Address Line 2","address3": "Example Address Line 3","city": "Chicago","state": "Illinois","country": "US","postalCode": "60056"}}},"card": {"type": "MasterCard","entryMethod": "keyed","cardNumber": "453985******7062","expiryDate": "1225","securityChecks": {"cvvResult": "M","avsResult": "Y"}},"supportedOperations": ["capture","fullyReverse","partiallyReverse","incrementAuthorization","adjustTip","setAsPending"],"transactionResult": {"type": "sale","status": "ready","approvalCode": "OK6","authorizedAmount": 4999,"currency": "USD","responseCode": "A","responseMessage": "OK6"},"customFields": [{"name": "yourCustomField","value": "abc123"}]}
curl --request post \--url https://api.payroc.com/v1/payments/M2MJOG6O2Y/capture \--header 'Authorization: Bearer <access token>' \--header 'Content-Type: application/json' \--header 'Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324' \--data '{"processingTerminalId":"abc123","operator":"Jane","amount":4999,"breakdown":{"subtotal":2899,"cashbackAmount":0,"tip":{"type":"percentage","amount":0,"percentage":0},"taxes":[{"name":"Sales Tax","rate":7}],"surcharge":{"bypass":false},"dualPricing":{"offered":false,"alternativeTender":"card"},"dutyAmount":0,"freightAmount":0,"items":[{"commodityCode":"5812-0111","productCode":"PZA-001-LG","description":"Large Pepperoni Pizza","unitOfMeasure":"QAN","unitPrice":2709,"quantity":1,"discountRate":5,"taxes":[{"name":"Sales Tax","rate":7}]}]}}'
application/json
{"paymentId": "M2MJOG6O2Y","processingTerminalId": "1234001","operator": "Postman","order": {"orderId": "OrderRef6543","dateTime": "2024-07-02T15:30:00Z","description": "Large Pepperoni Pizza","amount": 4999,"currency": "USD"},"customer": {"firstName": "Sarah","lastName": "Hopper","billingAddress": {"address1": "1 Example Ave.","address2": "Example Address Line 2","address3": "Example Address Line 3","city": "Chicago","state": "Illinois","country": "US","postalCode": "60056"},"shippingAddress": {"recipientName": "Sarah Hopper","address": {"address1": "1 Example Ave.","address2": "Example Address Line 2","address3": "Example Address Line 3","city": "Chicago","state": "Illinois","country": "US","postalCode": "60056"}}},"card": {"type": "MasterCard","entryMethod": "keyed","cardNumber": "453985******7062","expiryDate": "1225","securityChecks": {"cvvResult": "M","avsResult": "Y"}},"supportedOperations": ["capture","fullyReverse","partiallyReverse","incrementAuthorization","adjustTip","setAsPending"],"transactionResult": {"type": "sale","status": "ready","approvalCode": "OK3","authorizedAmount": 4999,"currency": "USD","responseCode": "A","responseMessage": "OK3"},"customFields": [{"name": "yourCustomField","value": "abc123"}]}
false
.{"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"}}
{"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"}}