• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Create terminal action BETA

POST /v2/terminals/actions

Creates a Terminal action request and sends it to the specified device.

Name Description
idempotency_key
string

Required

A unique string that identifies this CreateAction request. Keys can be any valid string but must be unique for every CreateAction request.

See Idempotency keys for more information.

Min Length 1 Max Length 64
action
TerminalAction

Required

The Action to create.

Response Fields

Name Description
errors
Error [ ]

Information on errors encountered during the request.

action
TerminalAction

The created TerminalAction

Examples

You are viewing an old version of the API
POST /v2/terminals/actions
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/terminals/actions \
  -X POST \
  -H 'Square-Version: 2022-11-16' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e",
    "action": {
      "device_id": "{{DEVICE_ID}}",
      "type": "SAVE_CARD",
      "deadline_duration": "PT5M",
      "save_card_options": {
        "customer_id": "{{CUSTOMER_ID}}",
        "reference_id": "user-id-1"
      }
    }
  }'
Response JSON
{
  "action": {
    "id": "termapia:jveJIAkkAjILHkdCE",
    "device_id": "DEVICE_ID",
    "deadline_duration": "PT5M",
    "status": "PENDING",
    "created_at": "2021-07-28T23:22:07.476Z",
    "updated_at": "2021-07-28T23:22:07.476Z",
    "location_id": "LOCATION_ID",
    "type": "SAVE_CARD",
    "app_id": "APP_ID",
    "save_card_options": {
      "customer_id": "CUSTOMER_ID",
      "reference_id": "user-id-1"
    }
  }
}

Error Descriptions

400 Bad request INVALID_LOCATION

The Square account cannot take payments in the specified region. A Square account can take payments only from the region where the account was created.

>
400 Bad request
{
  "errors": [
    {
      "code": "INVALID_LOCATION",
      "category": "PAYMENT_METHOD_ERROR"
    }
  ]
}