Untitled

 avatar
unknown
python
3 years ago
1.5 kB
6
Indexable
    response = requests.post(
        f'{store_data["domain"]}/api/?gate=productsstocks/set/{IDOSELLCOM_API_VERSION}/json',

        headers={
            'Content-Type': 'application/json'
        },

        json={
            'authenticate': {
                'system_login': decrypt(store_data['login'], CRYPTOGRAPHY_FERNET_KEY).decode(),
                'system_key': idosellcom_hash_password(decrypt(store_data['password'], CRYPTOGRAPHY_FERNET_KEY).decode())
            },

            'params': {
                'products': [
                    {
                        'ident': {
                            'identType': 'id',
                            'identValue': str(data['idosellcom_product_id'])
                        },

                        'sizes': [{
                            'ident': {
                                'identType': 'id',
                                'identValue': 'uniw'
                            },

                            'quantity': {
                                'stocks': [{
                                    'stock_id': int(data['stock_id']),
                                    'quantity_operation': {
                                        'operation': data['operation'],
                                        'quantity': float(data['quantity'])
                                    }
                                }]
                            }
                        }]
                    }
                ]
            }
        }
    )
Editor is loading...