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 'Content-Type: application/json' \--header 'Idempotency-Key: abc123' \--data '{"channel":"web","processingTerminalId":"1023","operator":"Postman","order":{"orderId":"order123","description":"Example payment","currency":"USD","amount":100},"customer":{"firstName":"Robert","lastName":"Red","billingAddress":{"address1":"billing address1","address2":"billing address2","address3":"billing address3","city":"Los Angeles","state":"California","country":"US","postalCode":90005},"shippingAddress":{"recipientName":"shipping recipientName","address":{"address1":"shipping address1","address2":"shipping address2","address3":"shipping address3","city":"San Diego","state":"California","country":"US","postalCode":91911}}},"paymentMethod":{"type":"card","cardDetails":{"entryMethod":"keyed","keyedData":{"dataFormat":"plainText","device":{"model":"paxA80","serialNumber":"WPC202833004712"},"expiryDate":"0328","cardNumber":"5001650000000000"}}}}'
paymentId
to use when you capture the payment.application/json
{"paymentId": "KP77BIWR96","processingTerminalId": "1023","operator": "Postman","order": {"orderId": "order123","dateTime": "2023-07-26T16:42:25.018Z","description": "Example payment","amount": 100,"currency": "USD"},"customer": {"firstName": "Robert","lastName": "Red","billingAddress": {"address1": "billing address","address2": "billing address2","address3": "billing address3","city": "Los Angeles","state": "California","country": "US","postalCode": "90005"},"shippingAddress": {"recipientName": "shipping recipientName","address": {"address1": "shipping address1","address2": "shipping address2","address3": "shipping address3","city": "San Diego","state": "California","country": "US","postalCode": "91911"}}},"card": {"type": "MasterCard","entryMethod": "keyed","cardNumber": "500165******0000","expiryDate": "0328","securityChecks": {"cvvResult": "M","avsResult": "Y"}},"transactionResult": {"type": "sale","status": "ready","approvalCode": "OK3","authorizedAmount": 100,"currency": "USD","responseCode": "A","responseMessage": "OK3"}}
curl --request post \--url https://api.payroc.com/v1/payments/abc123/adjust \--header 'Content-Type: application/json' \--header 'Idempotency-Key: abc123' \--data '{"adjustments":[{"type":"customer","shippingAddress":{"recipientName":"new recipientName","address":{"address1":"new address1","address2":"address2","address3":"address3","city":"Miami","state":"Florida","country":"US","postalCode":33101}}},{"type":"order","amount":1000}]}'
application/json
{"paymentId": "HW986AQOBB","processingTerminalId": "1023","order": {"orderId": "6u6","dateTime": "2023-07-27T09:28:44.000Z","description": "Example payment","amount": 1000,"currency": "USD"},"customer": {"firstName": "Robert","lastName": "Red","billingAddress": {"address1": "billing address","address2": "billing address2","address3": "billing address3","city": "Los Angeles","state": "California","country": "US","postalCode": "90005"},"shippingAddress": {"recipientName": "new recipientName","address": {"address1": "new address1","address2": "address2","address3": "address3","city": "Miami","state": "Florida","country": "US","postalCode": "33101"}}},"card": {"type": "MasterCard","entryMethod": "keyed","cardNumber": "500165******0000","expiryDate": "0328","securityChecks": {"cvvResult": "M","avsResult": "Y"}},"transactionResult": {"type": "sale","status": "ready","approvalCode": "OK6","authorizedAmount": 1000,"currency": "USD","responseCode": "A","responseMessage": "OK6"}}
curl --request post \--url https://api.payroc.com/v1/payments/abc123/capture \--header 'Content-Type: application/json' \--header 'Idempotency-Key: abc123' \--data '{"processingTerminalId":"abc123","operator":"abc123","amount":89,"breakdown":{"subtotal":89,"dutyAmount":89,"freightAmount":89,"cashbackAmount":89,"tip":{"type":"percentage","amount":0,"percentage":0},"taxes":[{"name":"abc123","rate":0}],"surcharge":{"bypass":false},"dualPricing":{"offered":false,"alternativeTender":"card"},"items":[{"commodityCode":"abc123","productCode":"abc123","description":"abc123","unitOfMeasure":"ACR","unitPrice":0,"quantity":0,"discountRate":0,"taxes":[{"name":"abc123","rate":0}]}]}}'
application/json
{"paymentId": "KP77BIWR96","processingTerminalId": "1023","operator": "Postman","order": {"orderId": "order123","dateTime": "2023-07-26T16:42:25.018Z","description": "Example payment","amount": 100,"currency": "USD"},"customer": {"firstName": "Robert","lastName": "Red","billingAddress": {"address1": "billing address","address2": "billing address2","address3": "billing address3","city": "Los Angeles","state": "California","country": "US","postalCode": "90005"},"shippingAddress": {"recipientName": "shipping recipientName","address": {"address1": "shipping address1","address2": "shipping address2","address3": "shipping address3","city": "San Diego","state": "California","country": "US","postalCode": "91911"}}},"card": {"type": "MasterCard","entryMethod": "keyed","cardNumber": "500165******0000","expiryDate": "0328","securityChecks": {"cvvResult": "M","avsResult": "Y"}},"transactionResult": {"type": "sale","status": "ready","approvalCode": "OK3","authorizedAmount": 100,"currency": "USD","responseCode": "A","responseMessage": "OK3"}}
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"}}