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
  • Creating a Payment Request
  • Transaction Approved Status Event
  • Sending the receipt from the POS to SensePass

Was this helpful?

Export as PDF
  1. Transaction API
  2. Payment Flows
  3. Create a transaction
  4. Examples for POS (In-Store)

Payment request with receipt generated by the POS

Adding receipt to your payment request alllows your customers to view the full payment receipt on their mobile device immediately after the payment approved, and on their SensePass account.

Receipt full documentation: Receipts Model

Creating a Payment Request

URL: /transactions/init

Request Body:

{
  "timeOut": 600,
  "amount": 200,
  "isCent": true,
  "currency": "USD",
  "deviceId": "2ooeww5ufzg3nkuf8a10gu5n695yolixlbgb042o03to9bxfkr7t815i5epu8o58jv1rznif3o1tr6xsb1rm",
  "receipt": {
    "mode": 2
  },
  "receiptNotifications": {
    "email": [
      "a@example.com"
    ],
    "sms": [
      "9295522135"
    ]
  }
}

Response body:

{
    "TransactionNumber": "5f3275249792ee75b41322e636617ee039e2e1a49cc80c11f2177233",
    "date": "2022-08-14T10:09:05.810Z",
    "amount": "2",
    "currency": "USD",
    "status": 0,
    "statusName": "Initialize",
    "timeoutDate": "2022-08-14T10:19:05.872Z",
    "paymentCommit": {
        "messsage": "Payment commit is enabled for this transaction"
    },
    "businessId": "339978940107456",
    "businessName": "Coffee Bar",
    "pos": "POS 1",
    "businessOwnerPhone": "3587292",
    "businessCountry": "US",
    "businessCity": "Virginia Beach",
    "businessStreet": "123 Street",
    "businessAddress": "123 Street, Virginia Beach",
    "branchNumber": "1",
    "branchId": "1",
    "receiptPending": true,
    "posReceiptsEndpoint": "https://api.sandbox.sensepass.com/api/invoicesReceipts/receipt/save/0128c664-1a2a-422c-91d0-85a8af229ed4",
    "transactionPage": {
        "iOSLink": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233",
        "androidLink": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233",
        "qrURL": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233"
    }
}

See "posReceiptsEndpoint" field in the response body, the value of the field represents the unique endpoint created for saving the receipt created by the POS.

Save this value in the POS for a case of "Approved" status event.

Transaction Approved Status Event

Register to Socket.IO channel or use callback URL to get notifications about transaction status changes.

Once the transaction status changes to status "Approved" (5) you will get "confirmations" object in the Transaction model:

{
    "TransactionNumber": "5f3275249792ee75b41322e636617ee039e2e1a49cc80c11f2177233",
    "date": "2022-08-14T10:09:05.810Z",
    "amount": "2",
    "currency": "USD",
    "status": 0,
    "statusName": "Initialize",
    "timeoutDate": "2022-08-14T10:19:05.872Z",
    "paymentCommit": {
        "messsage": "Payment commit is enabled for this transaction"
    },
    "businessId": "339978940107456",
    "businessName": "Coffee Bar",
    "pos": "POS 1",
    "businessOwnerPhone": "3587292",
    "businessCountry": "US",
    "businessCity": "Virginia Beach",
    "businessStreet": "123 Street",
    "businessAddress": "123 Street, Virginia Beach",
    "branchNumber": "1",
    "branchId": "1",
    "receiptPending": true,
    "posReceiptsEndpoint": "https://api.sandbox.sensepass.com/api/invoicesReceipts/receipt/save/0128c664-1a2a-422c-91d0-85a8af229ed4",
    "transactionPage": {
        "iOSLink": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233",
        "androidLink": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233",
        "qrURL": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233"
    },
    "confirmations": [
    {
      "paymentType": "Regular",
      "confirmationNumber": "063-d9j09YsY1",
      "fullConfirmationCode": "063-d9j09YsY1",
      "dateApproval": "2019-12-19T09:47:59.105Z",
      "installments": 1,
      "paymentMethodName": "PayPal",
      "approvedBy": "PayPal",
      "providerId": "uGfNuwEGiP18SUnTUEo1/atTdesDnhDhZ/8i7G9NAEg=",
      "requestID": "a4dbf66e-d3f1-4a29-baf7-2591424a9a0c",
      "authNumber": "123213dsf13111",
      "referenceNumber": "1778298289",
      "acquirer": "Visa",
      "voucher": "yyyAbnlmlfm1323",
      "lastFourDigits": "8858",
      "sensePassReferenceId": "34e209ea8b24cc831cf"
    }
  ]
}

Save all "confirmationNumber" objects, and create receipt in your POS.

More than one "confirmations" object can be available in cases of split payment, refund and partial refund

Sending the receipt from the POS to SensePass

Once the receipt is ready in your POS, invoke API request to the endpoint from "posReceiptsEndpoint" (see the previous section).

Option 1 - Send Receipt file

Example URL (based on "posReceiptsEndpoint"): https://api.sandbox.sensepass.com/api/invoicesReceipts/receipt/save/0128c664-1a2a-422c-91d0-85a8af229ed4

Request Body as form-data:

Field
Value

receipt-file

Your File Here - PDF or Image

jsonStr

"associateToConfirmationNumbers" is an array of "confirmationNumber" for the previous sections, this is the relation between the receipt to the payments of the consumer.

Response body:

{
  "success": true,
  "message": "Saved"
}

Option 2 - Send Receipt URL

It is required to host the receipt on a publicly accessible server and send SensePass the full URL of the file, SensePass will not expose to the consumers the URL, instead our servers will download the receipt from your server and host it securely.

Example URL (based on "posReceiptsEndpoint"): https://api.sandbox.sensepass.com/api/invoicesReceipts/receipt/save/0128c664-1a2a-422c-91d0-85a8af229ed4

Request Body:

{
  "url": "http://someDomain.com/receipt1.pdf",
  "type": "pdf",
  "receiptIdentifier": "43242342324",
  "associateToConfirmationNumbers": [
    "012-34567891",
    "012-34567892"
  ]
}

"associateToConfirmationNumbers" is an array of "confirmationNumber" for the previous sections, this is the relation between the receipt to the payments of the consumer.

Response body:

{
  "success": true,
  "message": "Saved"
}

Option 3 - Send Receipt as HTML

Example URL (based on "posReceiptsEndpoint"): https://api.sandbox.sensepass.com/api/invoicesReceipts/receipt/save/0128c664-1a2a-422c-91d0-85a8af229ed4

Request Body:

{
  "base64data": "PGh0bWw+",
  "type": "html",
  "receiptIdentifier": "43242342324",
  "associateToConfirmationNumbers": [
    "012-34567891",
    "012-34567892"
  ]
}

"associateToConfirmationNumbers" is an array of "confirmationNumber" for the previous sections, this is the relation between the receipt to the payments of the consumer.

Response body:

{
  "success": true,
  "message": "Saved"
}

Last updated 1 year ago

Was this helpful?

{
  "type": "pdf",
  "receiptIdentifier": "43242342324",
  "associateToConfirmationNumbers": [
    "012-34567891",
    "012-34567892"
  ]
}