Not Found error when charging Square API - square

The Square REST API docs state that I should get a list of my locations and then use a returned location code when I call the transactions endpoint (to charge a credit card). I am doing exactly this but the returned error says that the merchant has no location with the supplied ID.
I have tried this with and without the location_id in the JSON sent to the transactions endpoint, since it is a path variable. Same result. I have also seen on Square's API FAQ that the usual cause of a 404 not found is the card nonce being created wrong, but this response clearly says the location ID is not valid.
I have tested this with Postman and JSON and I can see that the location code is correct. Here are my calls and the responses:
This is a GET request:
https://connect.squareup.com/v2/locations
And here is the response:
{
"locations": [
{
"id": "FPVPFZ4DXXXXX",
"name": "MyCompany",
"address": {
"address_line_1": "123 Candy Lane",
"address_line_2": "",
"locality": "Smithfield",
"administrative_district_level_1": "RI",
"postal_code": "02917",
"country": "US"
},
"timezone": "America/Los_Angeles",
"capabilities": [
"CREDIT_CARD_PROCESSING"
]
},
{
"id": "4FHNAN1WXXXXX",
"name": "MyCompany2",
"address": {
"address_line_1": "567 Smith Street",
"address_line_2": "",
"locality": "Greenville",
"administrative_district_level_1": "RI",
"postal_code": "02828-2910",
"country": "US"
},
"timezone": "America/Los_Angeles",
"capabilities": [
"CREDIT_CARD_PROCESSING"
]
}
]
}
I modified the returned IDs a bit in the above example.
Next I make a call to charge a card to this uri:
https://connect.squareup.com/v2/locations/FPVPFZ4DXXXXX/transactions
With this body:
{
"note":"",
"idempotency_key":"azsxdcfvrtrewsdf",
"location_id":"FPVPFZ4DXXXXX",
"shipping_address":{
"address_line_1":"123 My Street",
"address_line_2":null,
"locality":"Greenville",
"administrative_district_level_1":"RI",
"postal_code":"02828",
"country":"US"
},
"billing_address":{
"address_line_1":"123 My Street",
"address_line_2":null,
"locality":"Greenville",
"administrative_district_level_1":"RI",
"postal_code":"02828",
"country":"US"
},
"card_nonce":"CBASEPPW7fjdUHe-3jP6ZZ4kvE0gAQ",
"reference_id":"RT-12345678",
"amount_money":{
"amount":12500,
"currency":"USD"
},
"delay_capture":true,
"buyer_email_address":"jim#xxxxxxxxxx.net",
"customer_id":"JIM"
}
And I get this response:
{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "NOT_FOUND",
"detail": "This merchant does not have a location with the ID `FPVPFZ4DXXXXX`.",
"field": "location_id"
}
]
}
So the location ID matches exactly the ID returned by the locations endpoint.
Can someone familiar with this API help me out? Square's docs and support is sadly lacking.

I think the issue here is that you have tried to use your sandbox credentials (sandbox-sq0idp-defoUOlu...) to charge against your production location FPVPFZXXXXX. If you call ListLocations with your sandbox credentials, you should get a different location that you can then do sandbox charges with.

Related

Sandbox access token not working [Easyship]

We have to try to integrate Easyship courier API. And We are facing the below issue.
{
"rates": [],
"messages": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
]
}
For more information, I have shared the request parameter and API response.
API URL:- https://api.easyship.com/v2/rates
Request Parameter:
{
"origin_address": {
"postal_code": "91601",
"city": "Los Ángeles",
"state": "CA",
"country_alpha2": "US"
},
"destination_address": {
"postal_code": "95140",
"city": "Mount Hamilton",
"state": "CA",
"country_alpha2": "US"
},
"parcels": [
{
"total_actual_weight": 5,
"items": [
{
"quantity": 1,
"category": "mobile_phones",
"dimensions": {
"width": 10,
"height": 10,
"length": 25
},
"description": "Apple iPad",
"actual_weight": 5,
"declared_currency": "USD",
"declared_customs_value": 49500.55
}
]
}
]
}
Response Parameter:
{
"status": "failure",
"errors": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
],
"request_id": "545b5f76a41e2994a13f384559dee625",
"timestamp": "2022-10-12T10:09:21.272Z"
}
Note:
This request parameter works with the production access token.
We have applied all possible solutions for this issue but didn't find anything.
Also we don't want to use the production access token because we are in the developing stage. so please please provide working with a sandbox solution.

2022: Get LinkedIn Posts via Access Token

I have been looking for an updated version of how to retrieve my own posts from LinkedIn via an access token which I have received from completing a three-legged OAuth process.
I have reviewed: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?view=li-lms-unversioned&tabs=http#permissions- but its now showing as legacy.
As it seems, LinkedIn unfortunately no longer wants us to retrieve this kind of content:
"Find Posts by authors is only supported for organization authors.
Finding by member authors is not supported."
Source
Neither a good, nor a solution within the LinkedIn-TOS (I assume) would be to use a webscraper. I have seen some solutions online but they are all very pricey in my opinion (and you never know if they get shut down by LinkedIn)
{
"activity": "urn:li:activity:12345657",
"content": {
"contentEntities": [
{
"entity": "urn:li:article:0",
"entityLocation": "https://www.example.com/content.html",
"thumbnails": [
{
"imageSpecificContent": {},
"resolvedUrl": "https://www.example.com/image.jpg"
}
]
}
],
"description": "content description",
"title": "Test Share with Content"
},
"created": {
"actor": "urn:li:person:A8xe03Qt10",
"time": 1471967236000
},
"distribution": {
"linkedInDistributionTarget": {}
},
"id": "6173878065928642560",
"lastModified": {
"actor": "urn:li:person:A8xe03Qt10",
"time": 1471967237000
},
"owner": "urn:li:organization:123456789",
"text": {
"text": "Test Share!"
}
}

Zoho Recruit API Register / Login Candidate

Could someone guide me an idea of how to create the registration and login for candidates with the Recruit api? I'm making a flutter app and I need my candidates to register and log in trow the app and see the job opening, post jobs.
At the moment I created the user with [POST] https://recruit.zoho.com/recruit/v2/Candidates
{
"data": [
{
"Email": "mail#gmail.com",
"First_Name": "TheName",
"Last_Name": "TheLastName",
"Mobile": "000000000",
"Expected_Salary": "8000000",
"Country": "PY",
"Departamento": "Central",
"C_I": "37114594",
"Ciudad_de_residencia": "City",
"$Password":"myPassWord199**"
}
],
"trigger": [
"approval",
"workflow",
"blueprint"
]
}
Works Well, got success
{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2022-06-15T20:47:23-04:00",
"Modified_By": {
"name": "Admin",
"id": "00000000000000"
},
"Created_Time": "2022-06-15T20:47:23-04:00",
"id": "00000000000000",
"Created_By": {
"name": "Admin",
"id": "00000000000000"
}
},
"message": "record added",
"status": "success"
}
]
}
But If I try to log in in the web version (for testing the new candidate) don't work, but if it see the dashboard, the user exist. Need to add something else?
Basically I need a register api and a login one for the created record of the candidate.
Any help will be awesome, Thanks

How to solve `not a valid enum value for `address.country` while adding the customer?

I'm integrating the square api's with golang in my software. But there is a problem while I'm sending the add customer request with the below json object
{
"given_name": "Sand Box Customer",
"family_name": "This is a sandbox Family",
"email_address": "sandbox#gmail.com",
"address": {
"address_line_1": "500 Electric Ave",
"address_line_2": "Suite 600",
"locality": "New York",
"administrative_district_level_1": "NY",
"postal_code": "10003",
"country": "Australia"
},
"phone_number": "1-212-555-4240",
"reference_id": "YOUR_REFERENCE_ID",
"note": "a customer"
}
and in response it returns me with an error:-
{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "INVALID_ENUM_VALUE",
"detail": "`Australia` is not a valid enum value for `address.country`.",
"field": "address.country"
}
]
}
Why this error I'm facing while It will support the Australia country see in the link https://docs.connect.squareup.com/. How can I solve this error?
documentation link:- https://docs.connect.squareup.com/get-started
According to their documentation, you should specify the country in /ISO_3166-1_alpha-2 format.
Refer the doc
https://docs.connect.squareup.com/api/connect/v2#type-location .
You can find more information from this also https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

How can I know when a flag is accepted or denied?

I'm playing with the Foursquare API and I was wondering if there are any way to know when a flag is accepted or denied.
The documentation doesn't says anything about what is the content of the response when I flag a venue. The Response fields is empty..
When flagging, the response look like that:
{
"meta": {...},
"notifications": [...],
"response": {
"id": "4b82fd8ef964a52049f130e3",
"name": "times square",
"contact": {},
"location": {
"lat": 43.642197,
"lng": 6.979622,
"cc": "FR",
"city": "New york",
"state": "New york",
"country": "France"
},
"canonicalUrl": "https://foursquare.com/v/times-square-new-york/4b82fd8ef964a52049f130e3",
"canonicalPath": "/v/times-square-new-york/4b82fd8ef964a52049f130e3",
"categories": [],
"verified": false,
"stats": {...},
"creator": {...},
"flags": {
"count": 1,
"items": [
{
"id": "5272152d11d25a4be68777a1",
"type": "remove",
"comments": [],
"reporters": [
{...}
],
"resolvedTime": "Thu Oct 31 09:20:17 UTC 2013",
"resolvedUsers": [],
"value": {
"reason": "doesnt_exist"
}
}
]
}
}
}
Do I need to re-call the same query (as when I'm flagging a venue) and the response will content something to tell the flag is either accepted or denied? Like in resolvedUsers?
Update:
It seems that I can call this url to get a list of all flag for a given venue. Then I can check if my flag id is present, otherwise it means the flag has been handled. BUT I don't know it the flag was accepted or denied...
https://api.foursquare.com/v2/venues/4b23dd27f964a5207c5b24e3/flags?v=20120321&locale=en
And by the way, /flags return the new venue in case of duplicate is accepted, not the duplicate. Makes it harder to determine ..
The flag will go through and be put into the queues for our superusers to moderate, there's no "accepting" or "denying" of a flag—the request of the flag may eventually get accepted or denied though. There's no way to see if a particular flag was accepted or denied through the API, but you'll know if it was accepted if the venue eventually gets changed.