Retrieve Online Bill Payments made by Patients: GET securePayments

Retrieve Online Bill Payments made by Patients: GET securePayments

Description
Returns a batch of patient payments from Medfusion. You can use optional query parameters to retrieve the most recent payments and to limit the number of payments returned.To communicate back to a patient about a payment retrieved via the GET securePayments API please reference the POST administrativeMessages documentation. The MessageThreadId included in the message payload you send to the portal should be the unique value you receive for the payment (seePayment id in the sample payload below).

URI
https://{server}/v1/practice/{PracticeID}/securePayments
HTTP Method
GET
Required URI Values
server
The domain name of the test or production system.

  • Test system: integration.demo.medfusion.net
  • Production system: integration.medfusion.net
PracticeID
The unique practice integration ID for a given practice. Medfusion will provide a practice ID that you can use during development.
Optional Query String Parameters
since
Milliseconds since unix epoch. Only return payments (in timestamp order) that have been created since the timestamp. If omitted, the default is from earliest available. This is a value that we send to you and you return to us in the next call.

Each successful response will include a “Last-Timestamp” HTTP header that should be used as the ‘since’ query argument in the next request. This ensures that all messages are retrieved exactly once, with no gaps or overlaps in messages returned by multiple calls to the API over time.

If provided, but not in the correct format, the result will be an HTTP 400 status code error.
max
Maximum number of messages to return. Default is 100 messages.

Success Response
  • 200 – Success. The requested payments are included in the body of the response.
  • 204 – No updates. The request succeeded but there are no payments that match the query. There is no response body.
Success Response Headers
  • Last-Timestamp – Value to be used as the “since” query argument in the next request to ensure that all messages are retrieved exactly once. Returned with both 200 and 204 status codes.
Error Response
  • 400 – Invalid parameter or timestamp. Use the correct format.
  • 401 – Unauthorized request. Check the OAuth attributes.

Sample Call
HTTP Request

GET https://integration.medfusion.net/v1/practice/1c7ecf9f-9700-4e70-b976-9356db658274/securePayments?since=1352153325000

Body

No body is supplied
Sample Response
Response Header

200 OK
Content-Length:1497
Content-Type: application/xml
Last-Timestamp: 1352157630000

Response Body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Payments
xmlns:ns2="http://schema.intuit.com/health/securePayments/v1">
   <PaymentsMessageHeaders/>
      <Sender deviceName="12.5"/>
      <Partner deviceName="Test Application"/>
      <Destination deviceName="Test Destination Name"/>
   /<PaymentsMessageHeaders>
   <PracticeInformation>
      <PracticeIdentifier>
         <PracticeId>1c7ecf9f-9700-4e70-b976-9356db658274</PracticeId>
      </PracticeIdentifier>
   </PracticeInformation>
   <Payment id="782b8228-2527-4e2a-825c-a4afabe74ae0">
      <PaymentDateTimestamp>2014-10-27T11:49:31.956Z</PaymentDateTimestamp>
      <PaymentType>BillPayment</PaymentType>
      <PracticePatientId>12345</PracticePatientId>
      <PatientAccountNumber>12345</PatientAccountNumber>
      <PaymentStatus>SUBMITTED</PaymentStatus>
      <PaymentInformation>
         <AmountPaid>50.00</AmountPaid>
         <CCLast4Digits>1111</CCLast4Digits>
         <PaymentComments>Copay for Appointment</PaymentComments>
         <ProcessingFeeAmount>0.00</ProcessingFeeAmount>
      </PaymentInformation>
   </Payment>
</ns2:Payments>
    

Sample 204 Response
Response Header

204 OK
Content-Length:0
Content-Type: application/xml
Last-Timestamp: 1352157630000
Sample Error
Invalid “max” paramter:HTTP Request 

GET https://integration.medfusion.net/v1/practice/1c7ecf9f-9700-4e70-b976-9356db658274/securePayments?since=1352153325000&max=0

Header

Authorization: {OAuth}

Body – No body is supplied

Sample Response
Response Header

400 
Content-Length:305
Content-Type: application/xml
Last-Timestamp: 1352157630000

Response Body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:ProcessingResponse xmlns:ns2="http://schema.intuit.com/health/admin/v1">
   <DataJobId>652a26dc-2524-4ed2-9c58-6e7ea7384a2c</DataJobId>
   <MessageId>81e083a7-29c6-453d-864c-f6d8f3644eb5</MessageId>
   <ProcessingStatus>Failure</ProcessingStatus>
   <ResponseMessage>Invalid 'max' query argument - not a positive int:"0"</ResponseMessage>
</ns2:ProcessingResponse>