How to edit an order

Configure the API to be able to edit an order in the system.
Written by Beeping Fulfilment
Updated 10 months ago

This method allows you to edit an order. To access this step, you must first perform the basic authentication. If you need to create an order, check this article.

IMPORTANT: You can only update orders in status 1 and 2, that is, those that are in Pending and/or Pending stock.

The data you need to know are:

Method: PUT

Uri: api/order/{external_id}

Endpoint: http://app.gobeeping.com/api/order/61546594651467

Curl Example

curl --location --request PUT 'http://app.gobeeping.com/api/order/615465984651465' \
--header 'Authorization: Basic XXXXXXXXXX’ \
--header 'Content-Type: application/json' \
--data-raw '{
    "data" : {
        "shipping_name":"Jarvin Gómez Updated"
    },
    "lines": [
      {
        "name": "Aspirador portátil 120W",
        "sga_product_id": 1230,
        "external_product_id": "6657388544090",
        "external_variant_id": "39645646848090",
        "amount": 19.99,
        "qty": 1,
        "sku": "8435411515089",
        "barcode": "4654646"
      },
      {
        "name": "Aspirador portátil 180W",
        "sga_product_id": 1231,
        "external_product_id": "6657388544090",
        "external_variant_id": "35645646848090",
        "amount": 19.99,
        "qty": 1,
        "sku": "8535411515089",
        "barcode": "4654646"
      }
    ]
}'

In order to perform the put method, you need to identify the following elements:

  • {external_id}: corresponds to the order ID of your store. In the case of Shopify, if you enter the order you want to mark to ship, you will find the number at the end of the link, for example:

  • 'Authorization: Basic XXXXXXXXXX' : here you must place the Basic Auth obtained in the previous step: how to login.

In addition, you will find the elements divided into two blocks: data and lines

On the one hand, the elements inside data refer to the order information, and you can identify the following ones: 

  • ref: Order internal reference. (String)
  • name: Order name. (String)
  • shipping_name: Name of the recipient.
  • shipping_address_1
  • shipping_address_2
  • shipping_zip: Shipping zip code.
  • shipping_city
  • shipping_province
  • shipping_country
  • shipping_country_code: ISO code of the shipping country.
  • shipping_phone: Shipping contact phone number.
  • email: Shipping contact email.

On the other hand, the elements within lines refer to the information of the product that has been purchased in the order. These elements are:

  • name: Name of the product.
  • sga_product_id: ID of the product in the Beeping system.
  • external_product_id: ID of the product in Shopify.
  • external_variant_id: ID of the variant in Shopify.
  • amount: Price of the product.
  • qty: Quantity of the product.
  • sku: Product reference.
  • barcode: Barcode of the product.

The supported parameters are:

Parameter Description
data

Json with the order data

‘ref’ = ‘string|max:255’,
‘name’ = ‘string|max:255’,
‘shipping_name’ = ‘string|max:255’,
‘shipping_address_1’ = ‘string|max:255’,
‘shipping_address_2’ = ‘string|max:255’,
‘shipping_zip’ = ‘string|max:255’,
‘shipping_city’ = ‘string|max:255’,
‘shipping_province’ = ‘string|max:255’,
‘shipping_country’ = ‘string|max:255’,
‘shipping_country_code’ = ‘string|max:255’,
‘shipping_phone’ = ‘string|max:255’,
‘email’ = ‘email|max:255’,
lines

Json with the product data. It must always be complete.

‘name’ = ‘required|string|max:255’,
‘sga_product_id’ = ‘string|max:255’,
‘external_product_id’ = ‘required|max:255’,
‘external_variant_id’ = ‘string|max:255’,
‘amount’ = ‘required|numeric’,
‘qty’ = ‘required|numeric’,
‘sku’ = ‘required|string’,
‘barcode’ = ‘required|string|max:255’

In these other articles you can learn how to list an order, consult an order, mark an order for shipment or cancel an order.

Did this answer your question?