API method

addProductsToSale

Method allows to add products order to specific sale.

GET
Usage URL
https://b2b.onesto-energy.pl/api/addProductsToSale.json?key=YOURAPIKEY

Query params

Put these in your URL, e.g. ?id=123.

  • lang string

    Language of result. ISO 2 Letter Language Codes

    Example

    en, pl, cs

  • test boolean 1 = true, 0 = false

    Enables a sandbox mode - no data will be written on the server.

POST data

Change the request to POST and send these fields as form-data.

  • id integer
    required

    Sale ID

  • products object[]
    required

    Array with products IDs and quantities

    Nested fields
    • id integer
      required

      Product ID

    • qty float
      required

      Quantity

Response fields

Fields returned by this method.

  • messages object

    Generic success or failure message.
    Click here for more information

    Nested fields
    • success string[]

      List of success messages

    • danger string[]

      List of errors, blocks the operation

    • warning string[]

      List of warnings, does not block the operation

Input POST
id=112087&
products[0][id]=45356&
products[0][qty]=1&
products[1][id]=47990&
products[1][qty]=1
Response JSON
Example URL: https://b2b.onesto-energy.pl/api/addProductsToSale.json?key=YOURAPIKEY&lang=en

{
    "messages": {
        "success": [
            "Products have been successfully merged with selected sale."
        ]
    }
}
Response XML
Example URL: https://b2b.onesto-energy.pl/api/addProductsToSale.xml?key=YOURAPIKEY&lang=en

<?xml version="1.0" encoding="utf-8"?>
<root>
	<messages>
		<success>
			<item>Products have been successfully merged with selected sale.</item>
		</success>
	</messages>
</root>