Update Order

PATCH {{baseUrl}}/pos/orders/:id?raw=false

Updates an open order by adding, replacing, or deleting fields. Square-only: Orders with a completed or canceled status cannot be updated. To pay for an order, use the payments endpoint.

Request Params

KeyDatatypeRequiredDescription
rawbooleanInclude raw response. Mostly used for debugging purposes

Request Body

{"location_id"=>"12345", "merchant_id"=>"12345", "idempotency_key"=>"random_string", "order_number"=>"1F", "order_date"=>"2022-08-12", "closed_date"=>"2022-08-13", "reference_id"=>"my-order-001", "status"=>"open", "payment_status"=>"open", "currency"=>"USD", "title"=>"est ipsum", "note"=>"aliquip", "customer_id"=>"12345", "employee_id"=>"12345", "order_type_id"=>"12345", "table"=>"1F", "seat"=>"23F", "total_amount"=>275, "total_tip"=>700, "total_tax"=>275, "total_discount"=>300, "total_refund"=>0, "total_service_charge"=>0, "refunded"=>false, "customers"=>[{"id"=>"12345", "first_name"=>"Elon", "middle_name"=>"D.", "last_name"=>"Musk", "phone_numbers"=>[{"number"=>"111-111-1111", "id"=>"12345", "country_code"=>"1", "area_code"=>"323", "extension"=>"105", "type"=>"primary"}], "emails"=>[{"email"=>"elon@musk.com", "id"=>"123", "type"=>"primary"}]}], "fulfillments"=>[{"id"=>"12345", "status"=>"other", "type"=>"shipment", "pickup_details"=>{"auto_complete_duration"=>"P1W3D", "cancel_reason"=>"Not hungry", "expires_at"=>"2016-09-04T23:59:33.123Z", "schedule_type"=>"scheduled", "pickup_at"=>"2016-09-04T23:59:33.123Z", "pickup_window_duration"=>"P1W3D", "prep_time_duration"=>"P1W3D", "note"=>"Pickup in the back.", "placed_at"=>"2016-09-04T23:59:33.123Z", "rejected_at"=>"2016-09-04T23:59:33.123Z", "ready_at"=>"2016-09-04T23:59:33.123Z", "expired_at"=>"2016-09-04T23:59:33.123Z", "picked_up_at"=>"2016-09-04T23:59:33.123Z", "canceled_at"=>"2016-09-04T23:59:33.123Z", "is_curbside_pickup"=>false, "curbside_pickup_details"=>{"curbside_details"=>"fugiat sed ad", "buyer_arrived_at"=>"2016-09-04T23:59:33.123Z"}, "recipient"=>{"customer_id"=>"12345", "display_name"=>"Elon Musk", "address"=>{"id"=>"123", "type"=>"primary", "string"=>"25 Spring Street, Blackburn, VIC 3130", "name"=>"HQ US", "line1"=>"Main street", "line2"=>"apt #", "line3"=>"Suite #", "line4"=>"delivery instructions", "street_number"=>"25", "city"=>"San Francisco", "state"=>"CA", "postal_code"=>"94104", "country"=>"US", "latitude"=>"40.759211", "longitude"=>"-73.984638", "county"=>"Santa Clara", "contact_name"=>"Elon Musk", "salutation"=>"Mr", "phone_number"=>"111-111-1111", "fax"=>"122-111-1111", "email"=>"elon@musk.com", "website"=>"https://elonmusk.com", "notes"=>"Address notes or delivery instructions.", "row_version"=>"1-12345"}, "phone_number"=>{"number"=>"111-111-1111", "id"=>"12345", "country_code"=>"1", "area_code"=>"323", "extension"=>"105", "type"=>"primary"}, "email"=>{"email"=>"elon@musk.com", "id"=>"123", "type"=>"primary"}}}, "shipment_details"=>{}}], "line_items"=>[{"name"=>"New York Strip Steak", "item"=>{}, "total_tax"=>2000, "total_discount"=>3000, "total_amount"=>27500, "quantity"=>1, "unit_price"=>27500.5, "applied_taxes"=>[{"tax_id"=>"sales-tax", "amount"=>27500, "currency"=>"USD"}], "applied_discounts"=>[{"discount_id"=>"12345", "amount"=>27500, "currency"=>"USD"}], "modifiers"=>[{"id"=>"12345", "name"=>"New York Strip Steak - no cheese", "amount"=>27500, "currency"=>"USD", "alternate_name"=>"Modifier New", "modifier_group_id"=>"123"}]}], "payments"=>[{"amount"=>27500, "currency"=>"USD"}], "service_charges"=>[{"name"=>"Charge for delivery", "amount"=>27500, "percentage"=>12.5, "currency"=>"USD", "active"=>true, "type"=>"auto_gratuity"}], "refunds"=>[{"amount"=>27500, "currency"=>"USD", "reason"=>"The reason for the refund being issued.", "status"=>"rejected"}], "taxes"=>[{"id"=>"state-sales-tax", "name"=>"State Sales Tax", "amount"=>27500, "currency"=>"USD", "percentage"=>15, "scope"=>"line_item", "type"=>"additive", "auto_applied"=>true}], "discounts"=>[{"type"=>"percentage", "name"=>"10% off", "amount"=>27500, "currency"=>"USD", "scope"=>"order"}], "tenders"=>[{"name"=>"10% off", "type"=>"cash", "note"=>"An optional note associated with the tender at the time of payment.", "amount"=>27500, "percentage"=>10, "currency"=>"USD", "total_amount"=>275, "total_tip"=>7, "total_processing_fee"=>0, "total_tax"=>57468919, "total_discount"=>3, "total_refund"=>0, "total_service_charge"=>0, "buyer_tendered_cash_amount"=>27500, "change_back_cash_amount"=>27500, "card"=>{"bin"=>"41111", "card_brand"=>"discover-diners", "card_type"=>"credit", "prepaid_type"=>"prepaid", "cardholder_name"=>"John Doe", "customer_id"=>"12345", "merchant_id"=>"12345", "exp_month"=>1, "exp_year"=>2022, "fingerprint"=>" Intended as a POS-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.", "last_4"=>"The last 4 digits of the card number.", "enabled"=>true, "billing_address"=>{"id"=>"123", "type"=>"primary", "string"=>"25 Spring Street, Blackburn, VIC 3130", "name"=>"HQ US", "line1"=>"Main street", "line2"=>"apt #", "line3"=>"Suite #", "line4"=>"delivery instructions", "street_number"=>"25", "city"=>"San Francisco", "state"=>"CA", "postal_code"=>"94104", "country"=>"US", "latitude"=>"40.759211", "longitude"=>"-73.984638", "county"=>"Santa Clara", "contact_name"=>"Elon Musk", "salutation"=>"Mr", "phone_number"=>"111-111-1111", "fax"=>"122-111-1111", "email"=>"elon@musk.com", "website"=>"https://elonmusk.com", "notes"=>"Address notes or delivery instructions.", "row_version"=>"1-12345"}, "reference_id"=>"card-001", "version"=>"230320320320"}, "card_status"=>"authorized", "card_entry_method"=>"swiped"}], "voided"=>false, "version"=>"230320320320"}

HEADERS

KeyDatatypeRequiredDescription
x-apideck-consumer-idstring(Required) ID of the consumer which you want to get or push data from
x-apideck-app-idstring(Required) The ID of your Unify application
x-apideck-service-idstringProvide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.
Content-Typestring
Acceptstring

RESPONSES

status: OK

{"status_code":200,"status":"OK","service":"clover","resource":"orders","operation":"update","data":{"id":"12345"}}