LogoLogo
  • Transaction API
    • Overview
    • Authentication
    • Payment Methods
    • Integrations
      • POS (In-Store)
      • E-commerce
    • Payment Flows
      • Create a transaction
        • Examples for POS (In-Store)
          • Basic Payment Request
          • Payment request with products
          • Payment request with callback
          • Payment request with POS Data
          • SMS Payment Request
          • Email Payment Request
          • Payment request with invoice
          • Payment request with receipt generated by SensePass
          • Payment request with receipt generated by the POS
        • Examples for e-commerce
          • Basic Payment Request
          • iFrame Example
          • Payment request with products
          • Payment request with callback
          • Payment request with website custom data
          • SMS Payment Request
          • Email Payment Request
          • Payment request with invoice
          • Payment request with receipt generated by SensePass
          • Payment request with receipt generated by the e-commerce platform
      • Transaction status
      • Authorization
      • Tokenization
      • Subscription
        • Fetch a subscription
        • Update a subscription
        • Subscription callbacks
      • Cancel a pending transaction
      • Refund a transaction
      • Pay by Credit Card
      • Credit by Credit Card
      • Payment Commit
      • Update a Transaction
    • Other Flows
      • Tags Pairing
      • Receipts
      • Customer Input
      • Token Migration
      • Create Dynamic QR
    • Terminal Agent
      • Installation
      • Pairing
      • Usage
        • Synchronous Payment
        • Real-time product information update
        • Get Last Transaction Status
        • Get Device ID
    • Settlement
    • API Notifications
      • Socket.IO Websockets
      • Callback/Webhook
      • Post Message
    • Flow Charts
      • Payment Flow
      • Transaction Status Flow
    • SDK & iFrames
      • JavaScript UI SDK
        • API
        • Commit Transaction
        • Custom SDK Style
        • Simulator
        • Manual Capture (deprecated)
      • E-commerce iFrame
      • POS iFrame
      • Credit Card iFrame
    • Models
      • Receipts Model
      • Metadata Model
      • SDK Theme Config Model
      • SDK Credit Card Field Model
      • Invoice Model
      • Product Model
      • Payment Details Model
      • Receipt Notifications Model
      • Payment Commit Model
      • Confirmation Model
      • Settlement Model
      • Subscription Model
      • Transaction Page Model
      • Transaction Model
      • Customer Input Model
      • Settlement Report Model
      • Customer Shipping/Billing Details Model
      • Additional Data Model
    • SOAP and XML
      • SOAP
      • XML
    • Testing
    • Postman
  • Partner API
    • Models
      • Onboarding Model
      • Onboarding Configuration Pages
      • Onboarding Status Model
    • SDK & iFrames
      • Onboarding iFrame
    • Flows
      • Create onboarding
      • Get Onboarding Configuration Page
      • Onboarding status
Powered by GitBook
On this page
  • Updating transaction amount
  • Step 1 - Creating a transaction in Setup state
  • Step 2 - Updating transaction Data
  • Step 3 - Allowing user to make payments
  • Updating transaction fields
  • Example

Was this helpful?

Export as PDF
  1. Transaction API
  2. Payment Flows

Update a Transaction

Updating transaction amount

Flow:

  1. The transaction must be created with "readyForPayment": false flag first

  2. The customer can see the transaction page and can't choose any payment method

  3. The platform calls PATCH API to update transaction details including "amount" field, this API can be invoke multiple times

  4. The platform calls PATCH API with "readyForPayment" = true , which allows the customer to choose a payment method and pay - without having to refresh the page or tap again

This flow is useful for POS who would like to create an initial transaction object with zero amount and update the total amount and other fields during the products scanning proccess, or any other flow where there is a requirement to create transaction once, and update it's amount and data later.

The customer will be allowed to make payment only after "readyForPayment" API will be called

Step 1 - Creating a transaction in Setup state

POST

https://api.sandbox.sensepass.com/api/transactions/init

{
    "amount": 100,
    "currency": "USD",
    "isCent": true,
    "readyForPayment": false,
    "deviceId": "YOUR-DEVICE-ID"
} 

Step 2 - Updating transaction Data

PATCH

https://api.sandbox.sensepass.com/api/transactions/250b859e1fb5b162d476f67dcc9ef9f0e2cb3a9412d13a610412d769

{
    "amount": 550,
    "currency": "USD",
    "isCent": true,
    "deviceId": "YOUR-DEVICE-ID",
    "products": [
      {
        "name": "Shirt",
        "quantity": 1,
        "amount": 190,
        "discount": 0,
        "vat": 0
      },
      {
        "name": "Service Fee",
        "quantity": 1,
        "amount": 10,
        "discount": 0,
        "vat": 0
      }
    ]
} 

Step 3 - Allowing user to make payments

PATCH

https://api.sandbox.sensepass.com/api/transactions/250b859e1fb5b162d476f67dcc9ef9f0e2cb3a9412d13a610412d769

{
    "amount": 550,
    "currency": "USD",
    "isCent": true,
    "deviceId": "YOUR-DEVICE-ID",
    "products": [
      {
        "name": "Shirt",
        "quantity": 1,
        "amount": 190,
        "discount": 0,
        "vat": 0
      },
      {
        "name": "Service Fee",
        "quantity": 1,
        "amount": 10,
        "discount": 0,
        "vat": 0
      }
    ],
    "readyForPayment": true
} 

Updating transaction fields

  1. reason

  2. products

  3. posData

  4. metadata

  5. clientPhoneNumber

  6. clientEmail

  7. readyForPayment

Example

PATCH

https://api.sandbox.sensepass.com/api/transactions/250b859e1fb5b162d476f67dcc9ef9f0e2cb3a9412d13a610412d769

{
  "reason": "New Reason",
  "posData": {
    "a": "b"
  },
  "metadata": {
    "x": "y"
  },
  "deviceId": "YOUR-DEVICE-ID"
}

Last updated 4 months ago

Was this helpful?

The following fields can be updated using the PATCH method based on :

Transaction Entity