Skip to main content
PUT
/
rentals
/
{rentalId}
Update a rental
curl --request PUT \
  --url https://app.supercycle.com/api/v1/rentals/{rentalId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fulfillAt": "2023-11-07T05:31:56Z",
  "fulfilledAt": "2023-11-07T05:31:56Z",
  "itemId": 123,
  "reallocateConflictingRentals": true,
  "minimumRentalEnd": "2023-11-07T05:31:56Z",
  "receiveAt": "2023-11-07T05:31:56Z",
  "receivedAt": "2023-11-07T05:31:56Z",
  "restockBy": "2023-12-25",
  "prepareFrom": "2023-12-25",
  "rentalEnd": {
    "before": "2023-11-07T05:31:56Z",
    "after": "2023-11-07T05:31:56Z"
  },
  "rentalStart": {
    "before": "2023-11-07T05:31:56Z",
    "after": "2023-11-07T05:31:56Z"
  },
  "tagsAttributes": [
    {
      "title": "<string>",
      "id": 123,
      "_destroy": true
    }
  ]
}
'
import requests

url = "https://app.supercycle.com/api/v1/rentals/{rentalId}"

payload = {
    "fulfillAt": "2023-11-07T05:31:56Z",
    "fulfilledAt": "2023-11-07T05:31:56Z",
    "itemId": 123,
    "reallocateConflictingRentals": True,
    "minimumRentalEnd": "2023-11-07T05:31:56Z",
    "receiveAt": "2023-11-07T05:31:56Z",
    "receivedAt": "2023-11-07T05:31:56Z",
    "restockBy": "2023-12-25",
    "prepareFrom": "2023-12-25",
    "rentalEnd": {
        "before": "2023-11-07T05:31:56Z",
        "after": "2023-11-07T05:31:56Z"
    },
    "rentalStart": {
        "before": "2023-11-07T05:31:56Z",
        "after": "2023-11-07T05:31:56Z"
    },
    "tagsAttributes": [
        {
            "title": "<string>",
            "id": 123,
            "_destroy": True
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    fulfillAt: '2023-11-07T05:31:56Z',
    fulfilledAt: '2023-11-07T05:31:56Z',
    itemId: 123,
    reallocateConflictingRentals: true,
    minimumRentalEnd: '2023-11-07T05:31:56Z',
    receiveAt: '2023-11-07T05:31:56Z',
    receivedAt: '2023-11-07T05:31:56Z',
    restockBy: '2023-12-25',
    prepareFrom: '2023-12-25',
    rentalEnd: {before: '2023-11-07T05:31:56Z', after: '2023-11-07T05:31:56Z'},
    rentalStart: {before: '2023-11-07T05:31:56Z', after: '2023-11-07T05:31:56Z'},
    tagsAttributes: [{title: '<string>', id: 123, _destroy: true}]
  })
};

fetch('https://app.supercycle.com/api/v1/rentals/{rentalId}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://app.supercycle.com/api/v1/rentals/{rentalId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'fulfillAt' => '2023-11-07T05:31:56Z',
    'fulfilledAt' => '2023-11-07T05:31:56Z',
    'itemId' => 123,
    'reallocateConflictingRentals' => true,
    'minimumRentalEnd' => '2023-11-07T05:31:56Z',
    'receiveAt' => '2023-11-07T05:31:56Z',
    'receivedAt' => '2023-11-07T05:31:56Z',
    'restockBy' => '2023-12-25',
    'prepareFrom' => '2023-12-25',
    'rentalEnd' => [
        'before' => '2023-11-07T05:31:56Z',
        'after' => '2023-11-07T05:31:56Z'
    ],
    'rentalStart' => [
        'before' => '2023-11-07T05:31:56Z',
        'after' => '2023-11-07T05:31:56Z'
    ],
    'tagsAttributes' => [
        [
                'title' => '<string>',
                'id' => 123,
                '_destroy' => true
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.supercycle.com/api/v1/rentals/{rentalId}"

	payload := strings.NewReader("{\n  \"fulfillAt\": \"2023-11-07T05:31:56Z\",\n  \"fulfilledAt\": \"2023-11-07T05:31:56Z\",\n  \"itemId\": 123,\n  \"reallocateConflictingRentals\": true,\n  \"minimumRentalEnd\": \"2023-11-07T05:31:56Z\",\n  \"receiveAt\": \"2023-11-07T05:31:56Z\",\n  \"receivedAt\": \"2023-11-07T05:31:56Z\",\n  \"restockBy\": \"2023-12-25\",\n  \"prepareFrom\": \"2023-12-25\",\n  \"rentalEnd\": {\n    \"before\": \"2023-11-07T05:31:56Z\",\n    \"after\": \"2023-11-07T05:31:56Z\"\n  },\n  \"rentalStart\": {\n    \"before\": \"2023-11-07T05:31:56Z\",\n    \"after\": \"2023-11-07T05:31:56Z\"\n  },\n  \"tagsAttributes\": [\n    {\n      \"title\": \"<string>\",\n      \"id\": 123,\n      \"_destroy\": true\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://app.supercycle.com/api/v1/rentals/{rentalId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fulfillAt\": \"2023-11-07T05:31:56Z\",\n  \"fulfilledAt\": \"2023-11-07T05:31:56Z\",\n  \"itemId\": 123,\n  \"reallocateConflictingRentals\": true,\n  \"minimumRentalEnd\": \"2023-11-07T05:31:56Z\",\n  \"receiveAt\": \"2023-11-07T05:31:56Z\",\n  \"receivedAt\": \"2023-11-07T05:31:56Z\",\n  \"restockBy\": \"2023-12-25\",\n  \"prepareFrom\": \"2023-12-25\",\n  \"rentalEnd\": {\n    \"before\": \"2023-11-07T05:31:56Z\",\n    \"after\": \"2023-11-07T05:31:56Z\"\n  },\n  \"rentalStart\": {\n    \"before\": \"2023-11-07T05:31:56Z\",\n    \"after\": \"2023-11-07T05:31:56Z\"\n  },\n  \"tagsAttributes\": [\n    {\n      \"title\": \"<string>\",\n      \"id\": 123,\n      \"_destroy\": true\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://app.supercycle.com/api/v1/rentals/{rentalId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fulfillAt\": \"2023-11-07T05:31:56Z\",\n  \"fulfilledAt\": \"2023-11-07T05:31:56Z\",\n  \"itemId\": 123,\n  \"reallocateConflictingRentals\": true,\n  \"minimumRentalEnd\": \"2023-11-07T05:31:56Z\",\n  \"receiveAt\": \"2023-11-07T05:31:56Z\",\n  \"receivedAt\": \"2023-11-07T05:31:56Z\",\n  \"restockBy\": \"2023-12-25\",\n  \"prepareFrom\": \"2023-12-25\",\n  \"rentalEnd\": {\n    \"before\": \"2023-11-07T05:31:56Z\",\n    \"after\": \"2023-11-07T05:31:56Z\"\n  },\n  \"rentalStart\": {\n    \"before\": \"2023-11-07T05:31:56Z\",\n    \"after\": \"2023-11-07T05:31:56Z\"\n  },\n  \"tagsAttributes\": [\n    {\n      \"title\": \"<string>\",\n      \"id\": 123,\n      \"_destroy\": true\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "customer": {
    "id": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "shopifyId": 123,
    "defaultAddress": {
      "customerId": 123,
      "default": true,
      "firstName": "<string>",
      "lastName": "<string>",
      "company": "<string>",
      "address1": "<string>",
      "address2": "<string>",
      "city": "<string>",
      "province": "<string>",
      "country": "<string>",
      "zip": "<string>",
      "phone": "<string>",
      "name": "<string>",
      "provinceCode": "<string>",
      "countryCode": "<string>",
      "countryName": "<string>"
    },
    "email": "<string>",
    "firstName": "<string>",
    "lastName": "<string>"
  },
  "itemId": 123,
  "shopifyOrderId": 123,
  "shopifyOrderLineId": 123,
  "item": {
    "id": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "activeRentalId": 123,
    "productTitle": "<string>",
    "serial": "<string>",
    "sequentialId": 123,
    "shopifyVariantId": 123,
    "tags": [
      "<string>"
    ],
    "variantTitle": "<string>",
    "activeReturnId": 123,
    "condition": {
      "id": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "severityKey": "<string>",
      "severityTone": "<string>",
      "title": "<string>"
    },
    "conditionId": 123,
    "imageUrl": "<string>",
    "location": {
      "shopifyId": 123,
      "name": "<string>"
    },
    "pickLocation": "<string>",
    "acquisitionCostCents": 123,
    "roiCents": 123,
    "shopifyProductId": 123,
    "timelineEvents": [
      {
        "id": 123,
        "eventableId": 123,
        "eventableType": "<string>",
        "eventType": "<string>",
        "metadata": {},
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "author": "<string>"
      }
    ],
    "customFields": [
      {
        "id": 123,
        "ownerId": 123,
        "definitionId": 123,
        "key": "<string>",
        "value": "<string>",
        "valueJson": "<unknown>"
      }
    ]
  },
  "fulfillAt": "2023-11-07T05:31:56Z",
  "fulfilledAt": "2023-11-07T05:31:56Z",
  "minimumRentalEnd": "2023-11-07T05:31:56Z",
  "originRentalIntentToken": "<string>",
  "receiveAt": "2023-11-07T05:31:56Z",
  "receivedAt": "2023-11-07T05:31:56Z",
  "rentalStart": "2023-11-07T05:31:56Z",
  "rentalEnd": "2023-11-07T05:31:56Z",
  "restockBy": "2023-11-07T05:31:56Z",
  "prepareFrom": "2023-11-07T05:31:56Z",
  "restockedAt": "2023-11-07T05:31:56Z",
  "sequentialId": 123,
  "shopifyOrderName": "<string>",
  "returnOrderId": 123,
  "membershipCredit": {
    "id": 123,
    "creditCost": 123
  },
  "timelineEvents": [
    {
      "id": 123,
      "eventableId": 123,
      "eventableType": "<string>",
      "eventType": "<string>",
      "metadata": {},
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "author": "<string>"
    }
  ],
  "tags": [
    "<string>"
  ],
  "customFields": [
    {
      "id": 123,
      "ownerId": 123,
      "definitionId": 123,
      "key": "<string>",
      "value": "<string>",
      "valueJson": "<unknown>"
    }
  ]
}
{
  "errors": [
    "Invalid request body"
  ]
}
{
  "error": "Rate limit exceeded. Retry after 42 seconds."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

rentalId
integer
required

Numeric ID of the rental to retrieve.

Body

application/json
fulfillAt
string<date-time>
fulfilledAt
null | string<date-time>
itemId
integer<int64>
reallocateConflictingRentals
boolean

When true and itemId is changed, all other rentals on the newly assigned item are re-allocated to resolve conflicts.

minimumRentalEnd
string<date-time>
packingStatus
enum<string>

Status of the packing process.

Available options:
pending,
printed,
packed
receiveAt
string<date-time>
receivedAt
null | string<date-time>
restockBy
null | string<date>

Set the restock date (YYYY-MM-DD) on the rental's receival, overriding the computed restock buffer. Set null to revert to the computed date.

prepareFrom
null | string<date>

Set the preparation start date (YYYY-MM-DD) on the rental's fulfillment, overriding the computed preparation buffer. Set null to revert to the computed date.

rentalEnd
object
rentalStart
object
tagsAttributes
object[]

Response

Expected response to a valid request

id
integer<int64>
required

Numeric ID of the rental.

createdAt
string<date-time>
required
updatedAt
string<date-time>
required

When this rental was last updated in Supercycle. Use with the list endpoint's updated filter to sync only rentals that changed since your last request.

customer
object
required
itemId
integer<int64>
required
packingStatus
enum<string>
required

Status of the packing process.

Available options:
pending,
printed,
packed
shopifyOrderId
integer<int64>
required
shopifyOrderLineId
integer<int64>
required
methodType
enum<string>

Method type of the rental.

Available options:
calendar,
subscription,
membership,
resale
item
object
fulfillAt
null | string<date-time>

Date and time the rental is due to be dispatched to the customer.

fulfilledAt
null | string<date-time>

Date and time the rental was dispatched to the customer.

minimumRentalEnd
null | string<date-time>
originRentalIntentToken
null | string
receiveAt
null | string<date-time>

Date and time the rental is due to be received back from the customer.

receivedAt
null | string<date-time>

Date and time the rental was received back from the customer.

rentalStart
null | string<date-time>

Date and time the item was received by the customer and the rental period started.

rentalEnd
null | string<date-time>

Date and time the rental period is due to end.

restockBy
null | string<date-time>

Date and time the item is due to be restocked.

prepareFrom
null | string<date-time>

Date and time preparation of the item starts ahead of fulfilment.

restockedAt
null | string<date-time>

Date and time the item was restocked.

sequentialId
null | integer<int32>

Sequential ID of the rental.

shopifyOrderName
string
status
enum<string>

Status of the rental.

Available options:
scheduled,
unfulfilled,
fulfilled,
unreceived,
received,
cancelled
fulfillmentStatus
enum<string>

Current fulfillment status of the rental. Indicates whether the item is due to be sent, scheduled, in progress, overdue, or has been dispatched.

Available options:
pending,
scheduled,
in_progress,
overdue,
complete
receivalStatus
enum<string>

Current receival status of the rental. Indicates whether the item is due to be returned, scheduled for return, overdue for return, or has been received back.

Available options:
pending,
scheduled,
in_progress,
overdue,
complete
returnOrderId
null | integer<int64>

ID of the return order associated with this rental.

membershipCredit
null | object

Membership credit associated with this rental, if any.

timelineEvents
object[]

Timeline events for this rental

tags
string[]
customFields
object[]

Custom fields attached to this rental