Code Monkey home page Code Monkey logo

backend-test's Introduction

Returns Service

Simple returns app that stores all processed returns in masterdata.

returns drawio (2)

Return Document Schema

{
  id?: string;
  email?: string;
  firstName?: string;
  lastName?: string;
  status?: string;
  reason?: string;
  return_method?: string;
  conversion_rate?: number;
  items: any[];
  value: string;
  comments?: string;
  return_amount?: number;
}

GET

Get Orders (last 30 days)

Endpoint: https://{{workspace}}--itglobers.myvtex.com/_v/oms/orders

If no query-params are provided, this endpoint will return all the orders in the last 30 days. All available params can be found here.

POST

Create Return

Endpoint: https://{{workspace}}--itglobers.myvtex.com/_v/oms/returns/create

Create a new return request. All properties are mandatory. For a full refund, the itemsID array must be empty. For a partial refund, the itemsID array must contain the productId of each item that the user wants to return. The return method can be either us_dollars or store_credit. If the return method is US dollars, the conversion rate will be extracted from this API.

Body

Raw (JSON):

{
 "orderId": 1353500506549-01,
 "reason": "Defective product",
 "return_method": "us_dollars",
 "itemsID": []
}

GET

Get Return

Endpoint: https://{{workspace}}--itglobers.myvtex.com/_v/oms/returns/{{orderId}}

Returns all fields from MDv2.

DELETE

Delete Return

Endpoint: https://{{workspace}}--itglobers.myvtex.com/_v/oms/returns/{{orderId}}

Deletes return document only if the status is rechazado or pagado.

PUT

Update Status

Endpoint: https://{{workspace}}--itglobers.myvtex.com/_v/oms/returns/{{orderId}}

Available status codes: creado, en revision, rechazado, pagado.

Body

Raw (JSON):

{
    "status": "rechazado",
    "comments": "items in terrible condition"
}

GraphQL

GraphQL queries and mutations

Query {
  getReturnData(orderId: {{orderId}}) {
    id,
    status,
    reason,
    return_method,
    return_amount,
    conversion_rate,
    items {
      price
    }
  }
}

Mutation {
  deleteReturnData(id: {{orderId}}) { 
    id,
    error
  }
}


Mutation {
  updateStatusData(id: {{orderId}}, status: String, comments: String) {
    id,
    error
  }
}

backend-test's People

Contributors

krackram20 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.