Skip to content
payrocdevelopers

Confirm an instruction is in progress, then cancel it.

Confirm an instruction is in progress, then cancel it.

Actors

Merchant / integratorclient

The POS integration calling the Payroc API to abort the pending sale.

Payroc gatewayapi

The Payroc API surface these steps call.

Payroc Cloud payment deviceexternal-system

Physical Payroc Cloud terminal that holds the pending instruction; not directly callable as an API step.

Sequence

Merchant / integrator
Payroc gateway
Payroc Cloud payment device (context: no step in this flow starts or ends here)

Follow the numbered steps in order. Each step is described under Steps.

Steps

Follow the workflow

Simulate API steps with synthetic inputs. Confirm manual steps yourself before continuing.

Interactive workflow tests are unavailable in this profile. Use the linked reference and source files to send API requests with your own client.

  1. 1

    Get payment instruction

    API request

    OPTIONAL — confirm the instruction is still `inProgress` before canceling, via GET /payment-instructions/{paymentInstructionId}. Cancel is only allowed while the status is `inProgress`.

    Merchant / integrator → Payroc gateway

    GET/payment-instructions/{paymentInstructionId}
  2. 2

    Cancel payment instruction

    API request

    Cancel the payment instruction via DELETE /payment-instructions/{paymentInstructionId}. Valid only while the instruction's status is `inProgress`. Returns HTTP 204 with no body.

    Merchant / integrator → Payroc gateway

    DELETE/payment-instructions/{paymentInstructionId}

    Complete the earlier steps before continuing.

Arazzo workflow source
arazzo: 1.0.0
info:
  title: Cancel a device payment instruction
  summary: Abort a still-in-progress Payroc Cloud device payment instruction
    before it completes.
  description: |
    Cancels a payment instruction that was submitted to a Payroc Cloud payment device (via the run-a-sale-on-a-device workflow) while it is still `inProgress` — for example if the cardholder walks away — so the sale never completes.
    Agent gotchas captured here:
    - You can cancel an instruction with `deletePaymentInstruction` only while its
      `status` is `inProgress`; once it has `completed` (or `failure`/`canceled`),
      canceling is no longer possible. Confirm the status with
      `getPaymentInstruction` first.

    - `deletePaymentInstruction` returns HTTP 204 (No Content) — there is no
      response body to capture.

    - Canceling is mutually exclusive with letting the instruction complete (see
      the run-a-sale-on-a-device workflow, whose terminal outcome is a completed
      payment).
  version: 1.0.0
sourceDescriptions:
  - name: payroc-api
    url: /openapi.yaml
    type: openapi
workflows:
  - workflowId: cancel-a-device-payment-instruction
    summary: Confirm an instruction is in progress, then cancel it.
    description: |
      Optionally confirm the instruction is still `inProgress` (getPaymentInstruction), then cancel it (deletePaymentInstruction) using the `paymentInstructionId` returned when the instruction was submitted.
    x-actors:
      - id: merchant
        name: Merchant / integrator
        type: client
        description: The POS integration calling the Payroc API to abort the pending sale.
      - id: payroc-gateway
        name: Payroc gateway
        type: api
        description: The Payroc API surface these steps call.
      - id: payment-device
        name: Payroc Cloud payment device
        type: external-system
        description: Physical Payroc Cloud terminal that holds the pending instruction;
          not directly callable as an API step.
    inputs:
      type: object
      required:
        - paymentInstructionId
      properties:
        paymentInstructionId:
          type: string
          description: Identifier of the payment instruction to cancel, as returned by
            submitPaymentInstruction in the run-a-sale-on-a-device workflow.
          example: a37439165d134678a9100ebba3b29597
    steps:
      - stepId: getPaymentInstruction
        x-actor: merchant
        x-actor-to: payroc-gateway
        x-label: instruction status check
        description: |
          OPTIONAL — confirm the instruction is still `inProgress` before canceling, via GET /payment-instructions/{paymentInstructionId}. Cancel is only allowed while the status is `inProgress`.
        operationId: getPaymentInstruction
        parameters:
          - name: paymentInstructionId
            in: path
            value: $inputs.paymentInstructionId
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          status: $response.body#/status
      - stepId: cancelPaymentInstruction
        x-actor: merchant
        x-actor-to: payroc-gateway
        x-label: instruction cancellation
        description: |
          Cancel the payment instruction via DELETE /payment-instructions/{paymentInstructionId}. Valid only while the instruction's status is `inProgress`. Returns HTTP 204 with no body.
        operationId: deletePaymentInstruction
        parameters:
          - name: paymentInstructionId
            in: path
            value: $inputs.paymentInstructionId
        successCriteria:
          - condition: $statusCode == 204
    outputs:
      paymentInstructionId: $inputs.paymentInstructionId
Download Arazzo

Search documentation

API reference169
Guides118
Knowledge38
legal1
Solutions32
Workflows74
↑↓highlight↵openView all search results

Menu

Theme

Sign out

Your saved plans remain in your organization. This browser’s private draft and account view will be cleared.

Talk to an engineer