Run a sale
An AI skill is available for this guide, get it on the Skills Marketplace (GitHub).
After you configure a device for Payroc Cloud, program your POS to send a payment instruction to the payment device. Your POS then checks the status of the instruction until the payment finishes, and views the details of the payment.
How it works
- Your POS submits a payment instruction to the device. Our gateway sends the instruction to the device and returns a
paymentInstructionIdwith a status ofinProgress. - The cardholder completes the payment on the device. Your POS checks the status of the payment instruction. Our gateway waits up to a minute for the status to change before it responds. If the status is still
inProgress, your POS sends another request and keeps checking until the status changes. - When the payment finishes, your POS uses the link in the response to view the details of the payment and to check whether the processor approved it or declined it.
You can also cancel the payment instruction while its status is inProgress.
Before you begin
Authenticate your requests before making API calls. If your request fails, see Errors.
Step 1. Submit a payment instruction
To submit a payment instruction to the device, send a POST request to the Devices endpoint.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we send the payment instruction to the device.
Note: The response returns a value of inProgress for the status field and an identifier for the instruction that you can use to check the status of the instruction. To get a link to view the details of the payment, go to Step 2.
Response
Response parameters
Step 2. View the status of a payment instruction
To check for updates to the status of the payment instruction, send a GET request to the Payment Instructions endpoint.
Before our gateway sends a response, it waits for up to a minute for the status of the instruction to change. We recommend that you keep the session open until the status of the instruction changes or the request times out.
If the status of the instruction doesn’t change, send another GET request. Our gateway waits up to a minute for the status of the instruction to change. Continue to send GET requests until the status changes.
Note: Wait until you receive a response from our gateway before you send another request.
Request parameters
To create your request, use the following parameters:
Path parameters
Example request
Response fields
If your request is successful, we return the details of the payment instruction, including HATEOAS links to check the details of the payment. Use the HATEOAS links to get the paymentId, which you need in Step 3.
If the status of the payment instruction is inProgress, our gateway waits up to a minute for the status to change before it returns a response.
Response
Example response
Step 3. View the details of the payment
To check whether the processor approved or declined the payment, send a GET request to the Payments endpoint.
Request parameters
To create your request, use the following parameters:
Path parameters
Example request
Response fields
If your request is successful, we return the details of the payment.
Response
Example response
(Optional) Cancel a payment instruction
To cancel a payment instruction, send a DELETE request to the Payment Instructions endpoint.
Note: You can cancel a payment instruction only if its status is inProgress.
Request parameters
To create your request, use the following parameters:
Path parameters
Example request
Path parameters
Response
Response
If your request is successful, we cancel the payment instruction.