> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payhub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel shipment

> Cancel a shipment and void its label at the carrier



## OpenAPI

````yaml POST /v1/crm/deployment-orders/{orderId}/shipments/{shipmentId}/cancel
openapi: 3.1.0
info:
  title: PayHub API
  description: >-
    The PayHub API is a REST interface for the SignaPay PayHub Platform — a CRM
    and back-office system for payment processing agents, ISOs, partners, and
    merchants.


    ## Authentication


    All protected endpoints require a session token or API key passed in the
    `Authorization` header. Use the **Authentication** endpoints to create and
    manage sessions, including MFA challenge/response and session impersonation.
    Password resets, OTP delivery (email and SMS), and email address
    verification are handled by their own endpoint groups. SAML and OAuth2 flows
    are also supported.


    ## Core Resources


    The API is organized around five primary entity types:


    - **Leads** — Merchant applications in progress. Full lifecycle management
    including status transitions, risk profiling, document collection, principal
    and business address capture, deposit information, pricing configuration,
    equipment ordering, and e-signature sessions.

    - **Clients** — Approved merchant accounts. Mirrors the Lead resource
    structure with additional settings for portal configuration, security
    policies, API key provisioning, and user access.

    - **Partners** — ISO/partner organizations. Manage business details,
    principals, documents, notes, and pricing templates and packages.

    - **Merchants** — Active processing accounts linked to clients. Supports the
    same document, note, pricing, and equipment order sub-resources as Leads and
    Partners.

    - **Agents** — Sales agents associated with leads and merchants. Includes
    document and note management.


    ## Pricing & Reference Data


    Pricing is modeled at multiple levels (items, packages, rules, templates)
    and can be scoped to leads, partners, or merchants. Reference data endpoints
    provide read-only lists of Pricing Models, Merchant Category Codes (MCC),
    MCC relations and card processing profiles, Bank BINs, Industry Types,
    Merchant Types, and Merchant Risk Categories.


    ## Equipment & Deployment


    Deployment endpoints cover the fulfilment side of boarding: **Deployment
    Orders** (with line items, events, and a work queue), **Shipments** (rate
    quotes, purchased and voided labels, shipment line items), per-line-item
    **File Builds**, device provisioning, and TSYS **VAR sheets**. Supporting
    read-only catalogues expose deployment equipment, inventory units, equipment
    models, and the order-type-to-model mapping.


    ## Compliance & Validation


    Dedicated validation endpoints support MATCH Pro and Clear screening,
    address validation, and both lead-level and client-level business rule
    checks.


    ## Financial Reporting


    Read-only endpoints expose Deposits, Deposit Details, Chargebacks, Residuals
    (with merchant-level summaries, overrides, and detail), residual roll-ups by
    ISO and agent, gross and ISO residual detail, Transactions, Transaction
    Batches, Statements, and a merchant status report of accounts approved or
    closed in a period.


    ## Support & Workflow


    A ticketing system (Tickets, Categories, Departments, Activities, Watchers,
    Clients, Documents) handles internal support requests. Notification
    endpoints and policies control who is notified and where. The FastApply
    group provides a streamlined MPA form submission flow, and Snap turns an
    uploaded application packet into a draft application. SAM Action Logs and
    Export endpoints round out back-office tooling.


    ## User & Access Management


    Manage platform users, their phone and email addresses, role-based
    permissions, feature flags, and user groups.
  version: 1.0.0
servers: []
security: []
tags:
  - name: FastApply
    description: Endpoints for the fast-apply MPA form flow.
  - name: Authentication
    description: Endpoints for session management.
  - name: Password Reset
    description: Endpoints for password reset and OTP verification.
  - name: Email Verification
    description: Endpoints for email address verification.
  - name: SAM
    description: Endpoints for legacy SAM onboarding.
  - name: OTP
    description: Endpoints for one-time password generation and verification.
  - name: Routing Numbers
    description: Endpoints for resolving ABA routing numbers to their institution.
  - name: Lead
    description: Endpoints for lead management.
  - name: Lead Sources
    description: Endpoints for lead source management.
  - name: Lead Document
    description: Endpoints for lead document management.
  - name: Document Types
    description: Endpoints for document type management.
  - name: Pricing Models
    description: Endpoints for listing available pricing models.
  - name: Merchant Category Codes
    description: Endpoints for listing merchant category codes (MCC).
  - name: MCC Relations
    description: Endpoints for listing MCC relations.
  - name: MCC Card Processing Profiles
    description: Endpoints for listing MCC card processing profiles.
  - name: Bank BINs
    description: Endpoints for listing bank BINs.
  - name: Industry Types
    description: Endpoints for listing industry types.
  - name: Merchant Types
    description: Endpoints for listing merchant types.
  - name: Merchant Risk Categories
    description: Endpoints for listing merchant risk categories.
  - name: Lead Business Address
    description: Endpoints for lead business address management.
  - name: Lead Principal
    description: Endpoints for lead principal management.
  - name: Lead Deposit Info
    description: Endpoints for lead deposit info management.
  - name: Lead Note
    description: Endpoints for lead note management.
  - name: Signing
    description: Endpoints for e-signature signing sessions.
  - name: Lead Validations
    description: Endpoints for lead validation services.
  - name: Lead Pricing Items
    description: Endpoints for lead pricing items management.
  - name: Lead Pricing Packages
    description: Endpoints for lead pricing packages management.
  - name: Lead Pricing Rules
    description: Endpoints for lead pricing rules management.
  - name: Client Validations
    description: Endpoints for client validation services.
  - name: MATCH Pro
    description: >-
      Endpoints for Mastercard MATCH Pro services including inquiry history,
      retroactive monitoring, and terminated merchant reporting.
  - name: Clear
    description: Endpoints for Clear identity verification services.
  - name: Search
    description: Endpoints for Algolia-backed search.
  - name: Address Validation
    description: Endpoints for US address autocomplete and verification (Smarty proxy).
  - name: Client
    description: Endpoints for client management.
  - name: Client Business Address
    description: Endpoints for client business address management.
  - name: Client Principal
    description: Endpoints for client principal management.
  - name: Client Deposit Info
    description: Endpoints for client deposit info management.
  - name: Client Document
    description: Endpoints for client document management.
  - name: Client Note
    description: Endpoints for client note management.
  - name: Client Portal Settings
    description: Endpoints for client portal settings management.
  - name: Client Security Settings
    description: Endpoints for client security settings management.
  - name: Client API Key
    description: Endpoints for client API key management.
  - name: Partner
    description: Endpoints for partner management.
  - name: Partner Business Address
    description: Endpoints for partner business address management.
  - name: Partner Principal
    description: Endpoints for partner principal management.
  - name: Partner Document
    description: Endpoints for partner document management.
  - name: Partner Note
    description: Endpoints for partner note management.
  - name: Partner Pricing Items
    description: Endpoints for partner pricing items management.
  - name: Partner Pricing Templates
    description: Endpoints for partner pricing templates management.
  - name: Partner Pricing Packages
    description: Endpoints for partner pricing packages management.
  - name: Partner Pricing Rules
    description: Endpoints for partner pricing rules management.
  - name: Partner Processor Settings
    description: Endpoints for partner processor settings management.
  - name: Merchant
    description: Endpoints for merchant management.
  - name: Merchant Business Address
    description: Endpoints for merchant business address management.
  - name: Merchant Principal
    description: Endpoints for merchant principal management.
  - name: Merchant Document
    description: Endpoints for merchant document management.
  - name: Merchant Note
    description: Endpoints for merchant note management.
  - name: Merchant Pricing Items
    description: Endpoints for merchant pricing items management.
  - name: Merchant Pricing Templates
    description: Endpoints for merchant pricing templates management.
  - name: Merchant Pricing Packages
    description: Endpoints for merchant pricing packages management.
  - name: Merchant Pricing Rules
    description: Endpoints for merchant pricing rules management.
  - name: Merchant ISO Package
    description: Endpoints for merchant ISO package associations.
  - name: Agent
    description: Endpoints for agent management.
  - name: Agent Document
    description: Endpoints for agent document management.
  - name: Agent Note
    description: Endpoints for agent note management.
  - name: Ticket Categories
    description: Endpoints for ticket category management.
  - name: Ticket Departments
    description: Endpoints for ticket department management.
  - name: Tickets
    description: Endpoints for ticket management.
  - name: Ticket Activities
    description: Endpoints for ticket activity management.
  - name: Ticket Watchers
    description: Endpoints for ticket watcher management.
  - name: Ticket Clients
    description: Endpoints for ticket client management.
  - name: Ticket Documents
    description: Endpoints for ticket document management.
  - name: Client User
    description: Endpoints for client user management.
  - name: Users
    description: Endpoints for user management.
  - name: User Phones
    description: Endpoints for user phone number management.
  - name: User Emails
    description: Endpoints for user email address management.
  - name: Roles
    description: Endpoints for role management.
  - name: Role Features
    description: Endpoints for role feature management.
  - name: Features
    description: Endpoints for browsing the features catalog (the role permissions list).
  - name: Groups
    description: Endpoints for group management.
  - name: Group Users
    description: Endpoints for group user management.
  - name: SAM Action Logs
    description: Endpoints for SAM action log management.
  - name: Notification
    description: Endpoints for notification management.
  - name: Notification Preferences
    description: Endpoints for a user's per-event notification settings matrix.
  - name: Notification Channel Settings
    description: Endpoints for a user's per-channel destinations and quiet hours.
  - name: Notification Endpoints
    description: Endpoints for client-owned notification delivery targets.
  - name: Notification Policies
    description: Endpoints for client-hierarchy notification policies and redirects.
  - name: Deposit
    description: Endpoints for deposit management.
  - name: Deposit Details
    description: Endpoints for deposit details management.
  - name: Chargeback
    description: Endpoints for chargeback management.
  - name: Residual
    description: Endpoints for residual report management.
  - name: Residual Summary
    description: Endpoints for RPM-engine residual summary reporting.
  - name: Residual Merchant Summary
    description: Endpoints for merchant-level residual summaries.
  - name: Residual Override
    description: Endpoints for residual override management.
  - name: Residual Merchant Detail
    description: Endpoints for residual merchant fee category details.
  - name: Gross Residual
    description: Endpoints for RPM-engine gross residual reporting.
  - name: Merchant Status Report
    description: Endpoints for merchant approval and closure reporting.
  - name: Transaction
    description: Endpoints for transaction management.
  - name: Transaction Note
    description: Endpoints for transaction note management.
  - name: Transaction Batch
    description: Endpoints for transaction batch management.
  - name: Transaction Batch Note
    description: Endpoints for transaction batch note management.
  - name: Statement Note
    description: Endpoints for statement note management.
  - name: Lead Equipment Models
    description: Endpoints for lead equipment model management.
  - name: Lead Equipment Order
    description: Endpoints for lead equipment order management.
  - name: Lead Equipment Order Items
    description: Endpoints for lead equipment order item management.
  - name: Lead Equipment Order Gateway
    description: Endpoints for lead equipment order gateway management.
  - name: Lead Equipment Order File Build Type
    description: Endpoints for lead equipment order file build type management.
  - name: Merchant Equipment Models
    description: Endpoints for merchant equipment model management.
  - name: Merchant Equipment Order
    description: Endpoints for merchant equipment order management.
  - name: Merchant Equipment Order Items
    description: Endpoints for merchant equipment order item management.
  - name: Merchant Equipment Order Gateway
    description: Endpoints for merchant equipment order gateway management.
  - name: Merchant Equipment Order File Build Type
    description: Endpoints for merchant equipment order file build type management.
  - name: Export
    description: Endpoints for data export.
  - name: SAML
    description: Endpoints for SAML SSO identity provider integration.
  - name: OAuth2
    description: OAuth2 authorization server endpoints with Okta compatibility layer.
  - name: Snap
    description: Endpoints for Snap jobs — AI extraction of merchant applications.
paths:
  /v1/crm/deployment-orders/{orderId}/shipments/{shipmentId}/cancel:
    post:
      tags:
        - Deployment Shipments
      summary: Cancel a Deployment Shipment
      description: >-
        Cancels a shipment, voiding its label at ShipStation so the carrier
        charge is refunded. The shipment is only marked canceled once the void
        succeeds; a declined void (void window closed, carrier refused) returns
        409 until the request is repeated with `acknowledgeUnvoidedLabel: true`,
        in which case the shipment is canceled with the label kept on record and
        the charge standing. The cancellation and the label outcome are recorded
        on the deployment order timeline. Canceling an already-canceled shipment
        is a no-op.
      operationId: cancelDeploymentShipment
      parameters:
        - schema:
            type: string
          in: path
          name: orderId
          required: true
        - schema:
            type: string
          in: path
          name: shipmentId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentShipmentCancel'
      responses:
        '200':
          description: The canceled shipment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentShipment'
        '403':
          description: The user does not have permission to access this resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  code:
                    type: string
                  detail:
                    type: string
                required:
                  - status
                  - code
                  - detail
        '404':
          description: The requested resource was not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  code:
                    type: string
                  detail:
                    type: string
                required:
                  - status
                  - code
                  - detail
        '409':
          description: The resource already exists or conflicts with existing data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  code:
                    type: string
                  detail:
                    type: string
                required:
                  - status
                  - code
                  - detail
        '422':
          description: >-
            The request was well-formed but was rejected due to validation
            errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  code:
                    type: string
                  detail:
                    type: string
                  errors:
                    type: array
                    items:
                      type: string
                required:
                  - status
                  - code
                  - detail
        '503':
          description: The service is temporarily unavailable. Please try again later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  code:
                    type: string
                  detail:
                    type: string
                required:
                  - status
                  - code
                  - detail
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    DeploymentShipmentCancel:
      type: object
      properties:
        acknowledgeUnvoidedLabel:
          type: boolean
    DeploymentShipment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        orderId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        direction:
          type: string
          enum:
            - outbound
            - inbound
        trackingNumber:
          anyOf:
            - type: string
            - type: 'null'
        externalShipmentId:
          anyOf:
            - type: string
            - type: 'null'
        carrierCode:
          anyOf:
            - type: string
            - type: 'null'
        serviceCode:
          anyOf:
            - type: string
            - type: 'null'
        labelId:
          anyOf:
            - type: string
            - type: 'null'
        labelUrl:
          anyOf:
            - type: string
            - type: 'null'
        shipmentCost:
          anyOf:
            - type: number
            - type: 'null'
        recipientName:
          anyOf:
            - type: string
            - type: 'null'
        recipientPhone:
          anyOf:
            - type: string
            - type: 'null'
        addressType:
          anyOf:
            - type: string
              enum:
                - dba
                - legal
                - mailing
                - iso
                - other
            - type: 'null'
        addressLine1:
          anyOf:
            - type: string
            - type: 'null'
        addressLine2:
          anyOf:
            - type: string
            - type: 'null'
        city:
          anyOf:
            - type: string
            - type: 'null'
        state:
          anyOf:
            - type: string
            - type: 'null'
        zip:
          anyOf:
            - type: string
            - type: 'null'
        status:
          type: string
          enum:
            - pending
            - label_created
            - shipped
            - in_transit
            - out_for_delivery
            - delivered
            - exception
            - canceled
        shippedDate:
          anyOf:
            - type: string
            - type: 'null'
        deliveredDate:
          anyOf:
            - type: string
            - type: 'null'
        weight:
          anyOf:
            - type: number
            - type: 'null'
        length:
          anyOf:
            - type: number
            - type: 'null'
        width:
          anyOf:
            - type: number
            - type: 'null'
        height:
          anyOf:
            - type: number
            - type: 'null'
        createdAt:
          type: string
        createdBy:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        updatedAt:
          type: string
        updatedBy:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      required:
        - id
        - orderId
        - direction
        - trackingNumber
        - externalShipmentId
        - carrierCode
        - serviceCode
        - labelId
        - labelUrl
        - shipmentCost
        - recipientName
        - recipientPhone
        - addressType
        - addressLine1
        - addressLine2
        - city
        - state
        - zip
        - status
        - shippedDate
        - deliveredDate
        - weight
        - length
        - width
        - height
        - createdAt
        - createdBy
        - updatedAt
        - updatedBy
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Enter token in following format: Bearer <token>'
    apiKey:
      type: apiKey
      name: Authorization
      in: header
      description: 'Enter api-key in following format: Api-Key <api-key>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.