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

You are viewing an old version of the API
Update payment BETA

PUT /v2/payments/{payment_id}

Updates a payment with the APPROVED status.

You can update the amount_money and tip_money using this endpoint.


Permissions
PAYMENTS_WRITE
Guide
Update Payment
Try in API Explorer
Name Description
payment_id
string

Required
Beta

The ID of the payment to update.

Name Description
payment
Payment

The updated Payment object.

idempotency_key
string

Required

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

The maximum is 45 characters.

For more information, see Idempotency.

Min Length 1 Max Length 45

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

payment
Payment

The updated payment.

Examples

You are viewing an old version of the API
PUT /v2/payments/{payment_id}
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/payments/XllelosAAfmkf9mOa0YB4PqSZACZY \
  -X PUT \
  -H 'Square-Version: 2021-06-16' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "3d3c3b22-9572-4fc6-1111-e4d2f41b4122",
    "payment": {
      "amount_money": {
        "amount": 1000,
        "currency": "USD"
      },
      "tip_money": {
        "amount": 300,
        "currency": "USD"
      },
      "version_token": "Z3okDzm2VRv5m5nE3WGx381ItTNhvjkB4VapByyz54h6o"
    }
  }'
Response JSON
{
  "payment": {
    "id": "XllelosAAfmkf9mOa0YB4PqSZACZY",
    "created_at": "2021-03-02T19:53:31.055Z",
    "updated_at": "2021-03-02T19:53:31.164Z",
    "amount_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "tip_money": {
      "amount": 300,
      "currency": "USD"
    },
    "status": "APPROVED",
    "delay_duration": "PT168H",
    "source_type": "CARD",
    "card_details": {
      "status": "AUTHORIZED",
      "card": {
        "card_brand": "VISA",
        "last_4": "1111",
        "exp_month": 2,
        "exp_year": 2022,
        "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ",
        "card_type": "CREDIT",
        "bin": "411111"
      },
      "entry_method": "KEYED",
      "cvv_status": "CVV_ACCEPTED",
      "avs_status": "AVS_ACCEPTED",
      "auth_result_code": "ajM2ZF",
      "statement_description": "SQ *MY BUSINESS GOSQ.COM",
      "card_payment_timeline": {
        "authorized_at": "2021-02-24T03:33:43.681Z"
      }
    },
    "location_id": "XTI0H92143A39",
    "order_id": "B6qiKWus1d3TBoN2Qn5kfDiWZlfZY",
    "total_money": {
      "amount": 1300,
      "currency": "USD"
    },
    "approved_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "capabilities": [
      "EDIT_AMOUNT_UP",
      "EDIT_AMOUNT_DOWN",
      "EDIT_TIP_AMOUNT_UP",
      "EDIT_TIP_AMOUNT_DOWN"
    ],
    "receipt_number": "Xlle",
    "delay_action": "CANCEL",
    "delayed_until": "2021-03-09T19:53:31.055Z",
    "version_token": "9TKsTawsWZvdZZD5uhAZFWfd3chxFXB49cgFpD2Kujf6o"
  }
}

Error Descriptions

400 Bad request AMOUNT_TOO_HIGH

The requested payment amount is too high for the provided payment source.

>
400 Bad request INVALID_FEES

The app_fee_money on a payment is too high.

>
400 Bad request
{
  "errors": [
    {
      "code": "AMOUNT_TOO_HIGH",
      "category": "INVALID_REQUEST_ERROR"
    }
  ]
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?