question

mattgx avatar image
mattgx asked Steve answered

How to generate data for Payments

First time with Clover API. I'm looking to generate a bunch of dummy data so that I can pull info form GetPayments with a sandbox merchant account (I'm generating sales reports with my app in a certain way).

Before I code this, I'm looking to do it in the API Explorer. After pouring through the docs, examples, and the API Explorer, I believe I have to do this:

  1. Create an order (with CreateOrder)
  2. Set a price on that order with a lineitem (with CreateLineItem)
  3. Associate order with a customer (with UpdateOrder)
  4. Add Payment to Order (with UpdateOrder)
  5. When I run GetPayments, I should see the payment.

Can someone confirm this, and/or correct my understanding? Thank you.

Orders
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Steve avatar image
Steve answered

Not sure if you want to get super fancy... I think the minimum is... Create an Order, then create a lineItem with an amount tied to the order. Update the order with the same amount (or sum of the multiple line items). Make a payment including the original order id and amount. I don't believe customer is needed.
When you want to get more fancy... add multiple line items, tax rates, tips, employees, devices, partial payments etc. It is likely much easier to have a Sandbox device and a black hole account to create the complex payment data structures for your report than trying reproducing all the complexity listed above.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community