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

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

PUT /v2/invoices/{invoice_id}

Updates an invoice by modifying field values, clearing field values, or both as specified in the request.

There are no restrictions to updating an invoice in a draft state. However, there are guidelines for updating a published invoice.


Permissions
ORDERS_WRITE
INVOICES_WRITE
Guide
Update an invoice
Try in API Explorer
Name Description
invoice_id
string

Required

The id of the invoice to update.

Name Description
invoice
Invoice

Required

The invoice fields to update. You need to only specify the fields you want to change. The current invoice version must be specified in the version field. For more information, see Update an invoice.

idempotency_key
string

A unique string that identifies the UpdateInvoice request. If you do not provide idempotency_key (or provide an empty string as the value), the endpoint treats each request as independent.

For more information, see Idempotency.

Max Length 128
fields_to_clear
string [ ]

List of fields to clear. For examples, see Update an invoice.

Response Fields

Name Description
invoice
Invoice

The updated invoice.

errors
Error [ ]

Information about errors encountered during the request.

Examples

You are viewing an old version of the API
PUT /v2/invoices/{invoice_id}
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/v2/invoices/gt2zv1z6mnUm1V7KMxxf3w \
  -X PUT \
  -H 'Square-Version: 2020-09-23' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be",
    "invoice": {
      "payment_requests": [
        {
          "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355",
          "tipping_enabled": false
        }
      ]
    },
    "fields_to_clear": [
      "payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders"
    ]
  }'
Response JSON
{
  "invoice": {
    "id": "gt2zv1z6mnUm1V7KMxxf3w",
    "version": 2,
    "location_id": "ES0RJRZYEC39A",
    "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY",
    "payment_requests": [
      {
        "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355",
        "request_method": "EMAIL",
        "request_type": "BALANCE",
        "due_date": "2030-01-24",
        "tipping_enabled": false,
        "reminders": [
          {
            "uid": "beebd363-e47f-4075-8785-c235aaa7df11",
            "relative_scheduled_days": -1,
            "message": "Your invoice is due tomorrow",
            "status": "PENDING"
          }
        ],
        "computed_amount_money": {
          "amount": 10000,
          "currency": "USD"
        },
        "total_completed_amount_money": {
          "amount": 0,
          "currency": "USD"
        }
      }
    ],
    "invoice_number": "inv-100",
    "title": "Event Planning Services",
    "description": "We appreciate your business!",
    "scheduled_at": "2030-01-13T10:00:00Z",
    "status": "UNPAID",
    "timezone": "America/Los_Angeles",
    "created_at": "2020-06-18T17:45:13Z",
    "updated_at": "2020-06-18T18:23:11Z",
    "primary_recipient": {
      "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",
      "given_name": "Amelia",
      "family_name": "Earhart",
      "email_address": "Amelia.Earhart@example.com",
      "phone_number": "1-212-555-4240"
    },
    "next_payment_amount_money": {
      "amount": 10000,
      "currency": "USD"
    }
  }
}

Share Feedback

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