FAQ Database Discussion Community

Square-Connect Webhook PHP post no data

I have Square-Connect Webhooks endabled. I am receiving POST's to my server script. Yet the $_POST array seems to be empty. Here is my code: <?php $sRM = $_SERVER['REQUEST_METHOD'] ; $sH = null ; if ( 'PUT' == $sRM ) { $sH = file_get_contents( 'php://input' ) ; } else if...

Which date does the order parameter on the List Orders endpoint for the Square API use to sort orders?

An Order has a created_at and updated_at date. Which one does the "List Orders" endpoint use to sort orders?

Upload product image with square connect API [closed]

I'm having hard time to upload product image to square using their connect API. They provide some example code in github, but it doesn't have any about image uploading. My guess is the problem is about Content-Type: multipart/form-data. I've also tried custom http request using fiddler. Can anyone show me...

Upload item image using Square Connect API and PHP

I've reviewed the old questions posted here on Stackoverflow about this issue. But i didn't find any example for php integration. Here is a sample of my code to do that but it's fail $url = 'https://connect.squareup.com/v1/me/items/9999999/image'; $auth_bearer = 'Authorization: Bearer ' . $this->accessToken; $image_data = base64_encode(file_get_contents('image.jpeg')); $header = array(...

square connect api batch processing

I need assistance with batch processing, especially in adding tax codes to items. I'm experimenting with the square batch processing feature and my sample cases are create 2 items and add the tax code to them. In all 4 requests - 2 for creating item, 2 to 'put' the tax...

Square API Create Item working code now returning an error

After creating about 1000 inventory items with code, Square suddenly started returning an error. The error returned was: {"type":"bad_request","message":"'name' is required"} Example code: $postData = array( 'id' => 'test_1433281486', 'name' => 'test', 'description' => 'test', 'variations' => array( 'id' => 'test_v1433281486', 'name' => 'Regular', 'price_money' => array( 'currency_code' => 'USD',...

Retrieve saved ticket details using square connect API

I have been experimenting with square connect API. Square recently introduced Saved "tickets" which allowed tickets to be printed and modified before actually charging customers. When ticket is being saved. Is there a way I can retrieved contents of the saved tickets using connect-API? It does not notify through web...

RestRequest and Square Connect

I am running the following code: var client = new RestClient(); var request = new RestRequest("https://connect.squareup.com/v1/me/payments", Method.GET) { RequestFormat = DataFormat.Json }; request.AddHeader("Authorization", "Bearer XXXXXX"); var Response = client.Execute(request); The response error message states: Value cannot be null. Parameter name: uri Not sure why I'm getting this error...

Square API truncating price?

I am using the square-connect library, and when creating an item, my price is being truncated. For instance, if I set my item price to be 123.13, what comes out is 1.23. Here is an example of my code: squareRouter.post('/item', function(req, res){ var item = req.body.item; console.log(item); square.api('/me/items', 'POST', item,...

Is it possible to set items as available for pickup in Square API?

I am creating items using the Square API. In the Square dashboard > item library, in the "online store settings" section, there is "available for pickup" and "available for shipping". Is there a way I can have 'available for pickup' checked by default when I create an item with the...