sq_list_payments: List Payments

Description Usage Arguments Details Value Examples

View source: R/payments.R

Description

Provides summary information for all payments taken by a merchant or any of the merchant's mobile staff during a date range.

Usage

1
2
3
sq_list_payments(location, begin_time = Sys.Date() - 1,
  end_time = Sys.Date(), sort_order = c("DESC", "ASC"),
  cursor = NULL, verbose = FALSE)

Arguments

location

character; the Square ID or name associated to a location. This must be an exact match to the ID or name as found using sq_list_locations. Some endpoints will accept "me" to indicate all locations.

begin_time

Date or DateTime class; The beginning of the requested reporting period. The default value is one day prior at midnight local time (i.e. start of yesterday). If the value is a Date (no time component) the time is started at midnight of the date of the local timezone.

end_time

Date or DateTime class; The end of the requested reporting period. The default value is today at midnight local time (i.e. start of today). If the value is a Date (no time component) the time is started at midnight of the date of the local timezone.

sort_order

character; The order in which results are listed in the response (ASC for oldest first, DESC for newest first). The default value is DESC.

cursor

character; A pagination cursor returned by a previous call to this endpoint. Typically this is not needed because functions in the package will automatically paginate results.

verbose

logical; do you want informative messages?

Details

Date ranges cannot exceed one year in length. When order is ASC (chronological), begin_time is inclusive and end_time is exclusive. This is the default behavior for all List endpoints. When order is DESC (reverse-chronological), begin_time is exclusive and end_time is inclusive. Required permissions: PAYMENTS_READ.

Value

tbl_df of payments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
our_locations <- sq_list_locations()
yesterdays_payments <- sq_list_payments(our_locations$id[1])

sorted_payments <- sq_list_payments(our_locations$id[1], 
                                    begin_time = Sys.Date() - 1, 
                                    end_time = Sys.Date(), 
                                    sort_order = "ASC")
# specify the time range as datetimes: 
#   - Beginning April 6th, 2018 at 5PM EDT                                    
#   - Ending April 8th, 2018 at 8AM EDT                                  
begin <- as.POSIXct("2018-04-06 17:00:00", tz="America/New_York")
end <- as.POSIXct("2018-04-08 8:00:00", tz="America/New_York")
custom_time_range <- sq_list_payments(our_locations$id[1], 
                                      begin_time = begin, 
                                      end_time = end)                                        

## End(Not run)

StevenMMortimer/squareupr documentation built on July 12, 2019, 1:45 a.m.