Retrieve Virtual Card Swiper or Pay Now transactions made by Patients: GET payments

Retrieve Virtual Card Swiper or Pay Now transactions made by Patients: GET payments

Description
Returns a batch of practice payments (Virtual Card Swiper) or patient payments (Pay Now) from Medfusion. You can use optional query parameters to retrieve the most recent payments and to limit the number of payments returned.

URI
https://{server}/v1/practice/{PracticeID}/payments
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(Virtual Card Swiper)
HTTP Request

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

Body

No body is supplied
Sample Response
Response Header

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

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>VCS Payment</PaymentType>
      <PatientAccountNumber>12345</PatientAccountNumber>
      *Note: There is no PracticePatientId for this type of payment; the payment is made on behalf of the patient, not by the patient.
      <PaymentStatus>SUBMITTED</PaymentStatus>
      <PaymentInformation>
         <PatientName>Carmen Garcia</PatientName>
         <PatientDateofBirth>1997-02-01T00:00:00Z</PatientDateofBirth>
         <CardholderName>Michael Garcia</CardholderName>
         <CardholderZipCode>99999</CardholderZipCode>
         <ServiceLocation>Main Office</ServiceLocation>
         <AmountPaid>50.00</AmountPaid>
         <CCType>Visa</CCType>
         <CCLast4Digits>1111</CCLast4Digits>
      </PaymentInformation>
   </Payment>
</ns2:Payments>
Sample Call
(Pay Now)
HTTP Request

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

Body

No body is supplied
Sample Response
Response Header

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

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>Pay Now Payment</PaymentType>
      <PatientAccountNumber>12345</PatientAccountNumber>
      *Note: There is no PracticePatientId for this type of payment; the payment is made on behalf of the patient, not by the patient.
      <PaymentStatus>SUBMITTED</PaymentStatus>
      <PaymentInformation>
         <PatientName>Carmen Garcia</PatientName>
         <PatientDateofBirth>1997-02-01T00:00:00Z</PatientDateofBirth>
         <CardholderName>Michael Garcia</CardholderName>
         <CardholderZipCode>99999</CardholderZipCode>
         <ServiceLocation>Main Office</ServiceLocation>
         <AmountPaid>50.00</AmountPaid>
         <CCType>Visa</CCType>
         <CCLast4Digits>1111</CCLast4Digits>
      </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/payments?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>