Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Pulkit Singhal
    @pulkitsinghal
    as for a command in vend-tools that leverages it, let me go look
    You too can perform github code searches in case u want to find a reference usage quickly if i take too long to get back
    Pulkit Singhal
    @pulkitsinghal
    @rudza - did you get what u need or do u want to do a screen share for 5mins for any clarifications?
    RJ
    @rudza
    @pulkitsinghal - Hi! Now I'm using custom made HTTP request usin Meteor HTTP package.
    Pulkit Singhal
    @pulkitsinghal
    Super cool
    Where Can I see it in action?
    RJ
    @rudza
    I had to contact Vend customer support, because it seems that Register Sales can't be Voided through their API.
    Unfortunately, the app is not yet publicly available.
    Piotr Zurek
    @pzurek
    @rudza I'm afraid that's not correct. Sales can definitely be voided via the API.

    it's as simple as posting

    {
       "id": "some_sale_id",
       "status": "VOIDED"
    }

    to the /api/register_sales endpoint. Of course that's a simplified payload. You should probably just grab the whole sale payload, change the status and post it back.

    RJ
    @rudza
    Really?
    It looks really simple. :D
    RJ
    @rudza

    @pzurek

    Unfortunately this doesnt work for me:

    Vend.voidSale = function(sale) {
      var url = Meteor.settings.private.vend.api_base_url,
        headers = {
          'Authorization': 'Bearer' + Vend.settings.accessToken,
          'Content-Type': 'application/x-www-form-urlencoded',
          'Accept': 'application/json'
        };
    
      sale.status = 'VOIDED';
      var response = HTTP.post(url + '/api/register_sales', {params: sale, headers: headers});
    };
    It returns the newly created sale, not the changed one.
    :/
    Piotr Zurek
    @pzurek
    Well, that's an interesting choice of the content-type. I'd suggest sticking to json though.
    RJ
    @rudza
    Hi!
    Here me again! :D
    Got some trouble with my computer and lost some code. :/
    So, I am back on Vend API. =)
    So, now I try to create new sale through Vend APi.
    I successfully send POST request and receive a response:
    This message was deleted
    RJ
    @rudza
    result { register_sale: { id: '02d59481-b6ad-11e5-f667-c057f2330ec6', register_id: '02d59481-b67d-11e5-f667-ba2e7c3a87f7', market_id: '1', customer_id: '02d59481-b6ad-11e5-f667-bb1a91446409', customer_name: 'Ron', customer: { id: '02d59481-b6ad-11e5-f667-bb1a91446409', name: 'Ron', customer_code: 'Ron-AH76', customer_group_id: '02d59481-b6ad-11e5-f667-bb1a913fc935', customer_group_name: 'Southwest Enterprise', first_name: 'Ron', last_name: 'Tenenbaum', company_name: '', phone: '', mobile: '', fax: '', email: '', twitter: '', website: '', physical_address1: '', physical_address2: '', physical_suburb: '', physical_city: '', physical_postcode: '', physical_state: '', physical_country_id: 'SG', postal_address1: '', postal_address2: '', postal_suburb: '', postal_city: '', postal_postcode: '', postal_state: '', postal_country_id: 'SG', updated_at: '2016-01-21 15:11:22', deleted_at: '', balance: '-250.000', year_to_date: '250.00000', date_of_birth: '', sex: '', custom_field_1: '', custom_field_2: '', custom_field_3: '', custom_field_4: '', note: '', contact: [Object] }, user_id: '02d59481-b67d-11e5-f667-ba2e7c3c1b23', user_name: 'rt@email.com', sale_date: '2016-01-21T15:59:26Z', created_at: '2016-01-21 15:59:26', updated_at: '2016-01-21 15:59:26', total_price: 95, total_cost: 0, total_tax: 0, tax_name: 'No Tax', note: '', status: 'OPEN', short_code: 'hirhau', invoice_number: '20', return_for: '', register_sale_products: [ [Object] ], totals: { total_tax: 0, total_price: 95, total_payment: 0, total_to_pay: 95 }, register_sale_payments: [], taxes: [ [Object] ] } }
    But I cant see it in Vend..
    Where should I see it?
    In my POST request I sent that Sale with status: OPEN and it didnt showed up.
    When I sent the Sale with status: ONACCOUNT - it showed up.
    Pulkit Singhal
    @pulkitsinghal
    Did you just answer your own question? Or is there something left for the community to answer?
    @rudza - in my experience if the end API returns a response saying the sale was created then it should show up in UI
    RJ
    @rudza
    Yes, that's true!
    Pulkit Singhal
    @pulkitsinghal
    It's funny that only OPEN status ones don't show up, where are you looking? The sales history screen? Are there any filters turned on?
    Also have you tried URL hacking with the sale id
    RJ
    @rudza
    It seems that sales with status OPEN should show up only in Current Sale screen
    Pulkit Singhal
    @pulkitsinghal
    For example: type the URL yourself - 'my.vendhq.com/sales/sale-id';
    Ok @rudza - seems like you have your answer already
    RJ
    @rudza
    Yep.
    Thanks, anyway. ;)
    Pulkit Singhal
    @pulkitsinghal
    By the way can we talk
    Over PM?
    RJ
    @rudza
    Sure.
    Alzy
    @Alzy
    Hi! I'm conjuring up a solution to automate my inventory imports on my system and I'm very happy I've found vend-tools. I haven't started it up yet but it looks very promising! I understand there's a command to export all products. Is it possible to limit which columns the resulting csv will have? For example, can I export all product SKUs and Inventory Quantities?
    Pulkit Singhal
    @pulkitsinghal
    @alzy glad you like it
    You can customize the existing command or copy and edit a new command file to do what you need , yes!
    Also checkout posXdata.io ... the free account will do what you need I believe
    Alzy
    @Alzy
    Thank you! @pulkitsinghal I checked out posXdata but it doesn't seem to do what I was looking for so I'm starting work on a vend-tools solution. When setting up 'Redirect URI' on a new vend application, what should I use for this field? I'm not quite sure what it means
    Pulkit Singhal
    @pulkitsinghal
    @alzy - give me 1.5 hours and then I can have a screen sharing call with you to help out
    Redirect uri should be used when you need to establish access and refresh token during Vend oauth
    Alzy
    @Alzy
    @pulkitsinghal awesome! thank you very much. I really appreciate it. I will standby til then