Can't disable cards

It looks like the cards/{card_id}/disable POST endpoint isn’t working - it expects a json body, even though there aren’t any params to supply.

Discovered through the php SDK, confirmed via https://developer.squareup.com/explorer/square/cards-api/disable-card

:wave: Thanks for bringing this to our attention. The POST request is expecting a body even if it’s empty. For example '{}'. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your findings to the API product team.

Thanks a lot Bryan! It does seem to me that the intention is that it should accept an absent body - as per the API explorer and PHP SDK. This does seem a bit odd to me as post requests usually do require some form of body, but it would be great to be able to keep my codebase clean without having to write my own curl request between SDK function calls.

Great to hear from you regardless!

Can confirm this defect with NojeJS endpoint. Calling:

const result = await cardsApi.disableCard(requestBody.cardId);

Returns the following error.

[Error] Status:400, Messages: [
  {
	"category": "INVALID_REQUEST_ERROR",
	"code": "EXPECTED_JSON_BODY",
	"detail": "Expected body to be a JSON object."
	}
]

Hey Bryan,

Is there any update from the team? I can see the explorer and PHP SDK are still throwing errors.

The team is still working on this and I will be sure to update this thread when we have an update.

Hi all, the team has deployed a fix and DisableCard is working as expected now.

1 Like

Thanks team.

Can confirm i have successfully tested this on Node.js.

Thanks Bryan, that’s amazing! Great job team :partying_face:

Steps to disable cards

  1. Open the Device Manager.
  2. Click the + or > symbol next to the Display adapters option in the list.
  3. Right-click the onboard video card.
  4. In the pop-up menu that opens, select the Disable device option.

Regards,
Rachel Gomez