ReturnRequests

As the name suggests, returnRequests are a core part of Baback — On this page, we'll dive into the different returnRequest endpoints you can use to manage your returnRequest programmatically. We'll look at how to query, create, update, and delete returnRequest.

The ReturnRequests model

The returnRequest model contains all the information about your returnRequest, such as their orderId, status,customer information and information about the articles.

Properties

  • Name
    _id
    Type
    string
    Description

    Unique identifier for the return request.

  • Name
    orderId
    Type
    string
    Description

    The Shopify ID of the order associated with the return request.

  • Name
    orderName
    Type
    string
    Description

    The Shopify name of the order associated with the return request.

  • Name
    createdAt
    Type
    number
    Description

    Timestamp of when the return request was created.

  • Name
    orderedAt
    Type
    number
    Description

    Timestamp of when the return request was created.

  • Name
    shopId
    Type
    string
    Description

    The ID of the shop associated with the return request.

  • Name
    shippingAddress
    Type
    Address
    Description

    The shipping address for the return.

  • Name
    shippingInfo
    Type
    object
    Description

    Information about the shipping carrier and tracking code for the return.

  • Name
    currency
    Type
    string
    Description

    The currency used for the return request.

  • Name
    customer
    Type
    object
    Description

    Information about the customer initiating the return.

  • Name
    lang
    Type
    string
    Description

    The language preference for the return request.

  • Name
    rebuyRemainingCreditMethod
    Type
    string
    Description

    rebuy remaining credit method

  • Name
    financialInformations
    Type
    object
    Description

    Financial information related to the return request.

  • Name
    logs
    Type
    array
    Description

    An array of logs documenting the history of the return request.


GET/api/return-request/search

Get ReturnRequest

This endpoint allows you to get any return request that belong to your shop.

Optional attributes

  • Name
    order-id
    Type
    string
    Description

    The ID of the order.

  • Name
    order-name
    Type
    string
    Description

    The name of the order.

  • Name
    created-after
    Type
    timestamp
    Description

    The timestamp (in milliseconds) indicating the earliest creation time for the orders to be retrieved.

  • Name
    created-before
    Type
    timestamp
    Description

    The timestamp (in milliseconds) indicating the latest creation time for the orders to be retrieved.

  • Name
    reviewed-after
    Type
    timestamp
    Description

    The timestamp (in milliseconds) indicating the latest reviewed time for the orders to be retrieved.

  • Name
    merchant-treated-after
    Type
    timestamp
    Description

    The timestamp (in milliseconds) indicating the latest merchant treatment time for the orders to be retrieved.

  • Name
    cancelled-after
    Type
    timestamp
    Description

    The timestamp (in milliseconds) indicating the earliest cancelled time for the return to be retrieved.

  • Name
    limit
    Type
    number
    Description

    The maximum number of orders to be returned (maximum authorized is 200)

  • Name
    offset
    Type
    number
    Description

    The number of orders to skip before starting to return the results.

  • Name
    discount-code
    Type
    string
    Description

    The discount code associated with the orders to be retrieved.

  • Name
    currentStatus
    Type
    string
    Description

    Status that the return request to have. It can be created, "approved", "waiting", "shipping", "shipped", "partiallyTreatedLogistician", "treatedLogistician", "partiallyTreatedMerchant", "treatedMerchant", "resolved", "error".

Request

GET
api/return-request/search
curl https://web.baback.co/api/return-request/search?created-after=1675119600000 \
  -H "Authorization: Bearer {token}" \

Response

{
  [ReturnRequest]
}

--

POST/api/return-request

Create ReturnRequest

This endpoint allows you to create a return request from a shopify order.

  • Name
    orderName
    Type
    string
    Description

    The Shopify name of the order.

  • Name
    isPaidReturn
    Type
    boolean
    Description

    True if we charge return fees for refund to the customer

  • Name
    withShippingLabel
    Type
    boolean
    Description

    True if we want to generate a shipping label

Request

GET
api/return-request/search
curl --location 'https://web.baback.co/api/return-request' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '{
"orderName": "#1001",
"isPaidReturn": true,
"withShippingLabel": true,
"lineItems": [
    {
        "sku": "my-sku",
        "quantity": 1,
        "reasonId": "W8wvbGjTjG9Jg37Tn",
        "resolution": "refund"
    }
],
"shippingAddress": {
    "first_name": "Aude",
    "last_name": "Michel",
    "address1": "32 rue de l'\''académie",
    "address2": null,
    "city": "Strasbourg",
    "province": null,
    "province_code": null,
    "zip": "67000",
    "country_code": "FR",
    "phone": "0672930401",
    "country": "France",
    "email": "example@baback.co"
}
}'

Response

{
  [ReturnRequest]
}

GET/api/return-request/export-line-item

Export line item

Allows targeted return requests to be exported by item.

Optional attributes

  • Name
    created-after
    Type
    number
    Description

    The timestamp indicating the earliest creation time for the records to be retrieved.

  • Name
    created-before
    Type
    number
    Description

    The timestamp indicating the latest creation time for the records to be retrieved.

  • Name
    limit
    Type
    number
    Description

    The maximum number of records to be returned.

  • Name
    offset
    Type
    number
    Description

    The number of records to skip before starting to return the results.

Request

GET
/api/return-request/export-line-item
curl https://web.baback.co/api/return-request/export-line-item\
-H "Authorization: Bearer {token}"

Response

[{
        "orderId": string,
        "orderName": string,
        "createdAt": number,
        "status": string,
        "shippingAddress1": string,
        "shippingAddress2": string,
        "shippingCity": string,
        "shippingZip": string,
        "shippingCountry": string,
        "shippingCountry_code": string,
        "shippingInfo_carrier": string,
        "shippingInfoTrackingCode": string,
        "customerId": string,
        "customerEmail": string,
        "customerFirstName": string,
        "customerLastName": string,
        "customerPhone": string,
        "lang": string,
        "refunded": string,
        "discounted": string,
        "initialShippingRefund": string,
        "returnShippingPaid": number,
        "lineItemId": string,
        "sku": string,
        "title": string,
        "price": string,
        "reason": string,
        "productId": string,
        "quantityBought": number,
        "variantTitle": string,
        "variantBarcode": string,
        "resolution": string,
        "logisticianValidated": number,
        "logisticianRejected": string,
        "logisticianReasonRejected": string,
        "merchantValidated": number,
        "merchantRejected": string,
        "merchantReasonRejected": string,
        "variantId": string,
        "quantity": number,
        "newVariantId": string,
        "newVariantBarcode": string,
        "locationId": string
    }]

POSTapi/return-request/{:returnRequestId}/logistician

Validate or reject article in a returnRequest as a logistician

This endpoint allow you to validate / reject articles as logistician lineItemId/sku/barcode one of them is mandatory.

  • Name
    returnRequestId
    Type
    string
    Description

    Id of the returnRequest

Request

POST
api/return-request/{:returnRequestId}/logistician
 curl -L 'https://web.baback.co/api/return-request/{:returnRequestId}/logistician' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {token}' \
    -d '{
        "validated":[
            {
                "lineItemId" ?: "your_line_item_id",
                "sku"?: "your_line_item_sku",
                "barcode"?: "your_line_item_barcode,
                "quantity" : your_quantity
            }
        ],
        "rejected":[
        ]
    }'

Response

{
  "ReturnRequest": returnRequest
}