LogoLogo
System Status
2021-02-23
2021-02-23
  • 2021-02-23
  • Charges
  • Checkouts
  • Checkout specifications
  • Customers
  • Events
  • Fees
  • File links
  • Files
  • Fulfillment cancellations
  • Fulfillment orders
  • Fulfillment returns
  • Fulfillments
  • Inventory items
  • Inventory levels
  • Invoices
  • Orders
  • Payouts
  • Refunds
  • Reservations
  • Returns
  • SKUs
  • Sales summaries
  • Sales transactions
  • Shipments
  • Shipping quotes
  • Sources
  • Tax identifiers
  • Webhooks
Powered by GitBook
On this page

Files

PreviousFile linksNextFulfillment cancellations

Last updated 5 months ago

You can use the File links resource to create a file link when you want to share the contents of a Files object with a customer. If you want unauthenticated access to a file that a customer can download, you can create a link containing a URL pointing to the file and then send it to the customer.

Gets a file by ID

get

Retrieves the details of a file. You must supply the unique identifier of the file.

Authorizations
Path parameters
idstringRequired

File identifier.

Responses
200
OK.
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
404 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /files/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "09e2464f-9b4f-482b-ae89-732183c705be",
  "createdTime": {
    "offset": {
      "totalSeconds": 0,
      "id": "Z",
      "rules": {
        "fixedOffset": true,
        "transitions": [],
        "transitionRules": []
      }
    },
    "nano": 0,
    "year": 2018,
    "monthValue": 4,
    "dayOfMonth": 25,
    "hour": 20,
    "minute": 36,
    "second": 0,
    "dayOfWeek": "WEDNESDAY",
    "dayOfYear": 115,
    "month": "APRIL"
  },
  "fileName": "file.png",
  "links": [
    {
      "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
      "createdTime": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },
        "nano": 0,
        "year": 2018,
        "monthValue": 4,
        "dayOfMonth": 25,
        "hour": 20,
        "minute": 36,
        "second": 0,
        "dayOfWeek": "WEDNESDAY",
        "dayOfYear": 115,
        "month": "APRIL"
      },
      "expired": false,
      "expiresTime": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },
        "nano": 0,
        "year": 2020,
        "monthValue": 4,
        "dayOfMonth": 25,
        "hour": 20,
        "minute": 36,
        "second": 0,
        "dayOfWeek": "SATURDAY",
        "dayOfYear": 116,
        "month": "APRIL"
      },
      "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
      "liveMode": false,
      "metadata": {
        "coupon": "iOS"
      },
      "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
    }
  ],
  "purpose": "tax_document_customer_upload",
  "title": "My 2019 Tax Certificate.",
  "size": 72334,
  "type": "png",
  "url": "https://files.digitalriver.com/files/file_17a0cab7-1ff7-478e-99f9-d4e753dec24d/contents",
  "liveMode": false
}

Deletes a file by ID

delete

Permanently deletes a file. Supply the unique identifier of the file.

Authorizations
Path parameters
idstringRequired

File ID

Responses
204
204 No Content
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
401 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
delete
DELETE /files/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

  • GETReturns a list of files
  • POSTCreates a file
  • GETGets a file by ID
  • DELETEDeletes a file by ID

Returns a list of files

get

Gets all files specified in the request.

Authorizations
Query parameters
endingBeforestringOptional

A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list.

startingAfterstringOptional

A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list.

limitinteger · min: 1 · max: 100Optional

A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.

idsstring[]Optional

Only return objects with these IDs.

purposestringOptional

Only return files with this purpose.

fileNamestringOptional

Only return files with this file name.

titlestringOptional

Only return files with this title.

typestringOptional

Only return files of this type.

Responses
200
200 OK
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /files HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "hasMore": true,
  "data": [
    {
      "id": "09e2464f-9b4f-482b-ae89-732183c705be",
      "createdTime": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },
        "nano": 0,
        "year": 2018,
        "monthValue": 4,
        "dayOfMonth": 25,
        "hour": 20,
        "minute": 36,
        "second": 0,
        "dayOfWeek": "WEDNESDAY",
        "dayOfYear": 115,
        "month": "APRIL"
      },
      "fileName": "file.png",
      "links": [
        {
          "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
          "createdTime": {
            "offset": {
              "totalSeconds": 0,
              "id": "Z",
              "rules": {
                "fixedOffset": true,
                "transitions": [],
                "transitionRules": []
              }
            },
            "nano": 0,
            "year": 2018,
            "monthValue": 4,
            "dayOfMonth": 25,
            "hour": 20,
            "minute": 36,
            "second": 0,
            "dayOfWeek": "WEDNESDAY",
            "dayOfYear": 115,
            "month": "APRIL"
          },
          "expired": false,
          "expiresTime": {
            "offset": {
              "totalSeconds": 0,
              "id": "Z",
              "rules": {
                "fixedOffset": true,
                "transitions": [],
                "transitionRules": []
              }
            },
            "nano": 0,
            "year": 2020,
            "monthValue": 4,
            "dayOfMonth": 25,
            "hour": 20,
            "minute": 36,
            "second": 0,
            "dayOfWeek": "SATURDAY",
            "dayOfYear": 116,
            "month": "APRIL"
          },
          "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
          "liveMode": false,
          "metadata": {
            "coupon": "iOS"
          },
          "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
        }
      ],
      "purpose": "tax_document_customer_upload",
      "title": "My 2019 Tax Certificate.",
      "size": 72334,
      "type": "png",
      "url": "https://files.digitalriver.com/files/file_17a0cab7-1ff7-478e-99f9-d4e753dec24d/contents",
      "liveMode": false
    }
  ]
}

Creates a file

post

To upload a file to Digital River, you’ll need to send a request of type multipart/form-data. The request should contain the file you would like to upload, as well as the parameters for creating a file.

Authorizations
Body
filestring · binaryRequired

A file to upload. The file should follow the specifications of RFC 2388 (which defines file transfers for the multipart/form-data protocol).

purposestring · enumRequired

The purpose of the uploaded file.

Example: tax_document_customer_uploadPossible values:
fileNamestringOptional

A filename for the file, suitable for saving to a filesystem.

Example: file.png
titlestringOptional

A user friendly title for the document.

Example: My 2019 Tax Certificate.
linkExpiresTimestring · date-timeOptional

Time at which the link expires.

Example: {"offset":{"totalSeconds":0,"id":"Z","rules":{"fixedOffset":true,"transitions":[],"transitionRules":[]}},"nano":0,"year":2020,"monthValue":4,"dayOfMonth":25,"hour":20,"minute":36,"second":0,"dayOfWeek":"SATURDAY","dayOfYear":116,"month":"APRIL"}
Responses
201
201 Created
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
post
POST /files HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 379

{
  "file": "binary",
  "purpose": "tax_document_customer_upload",
  "fileName": "file.png",
  "title": "My 2019 Tax Certificate.",
  "linkExpiresTime": {
    "offset": {
      "totalSeconds": 0,
      "id": "Z",
      "rules": {
        "fixedOffset": true,
        "transitions": [],
        "transitionRules": []
      }
    },
    "nano": 0,
    "year": 2020,
    "monthValue": 4,
    "dayOfMonth": 25,
    "hour": 20,
    "minute": 36,
    "second": 0,
    "dayOfWeek": "SATURDAY",
    "dayOfYear": 116,
    "month": "APRIL"
  }
}
{
  "id": "09e2464f-9b4f-482b-ae89-732183c705be",
  "createdTime": {
    "offset": {
      "totalSeconds": 0,
      "id": "Z",
      "rules": {
        "fixedOffset": true,
        "transitions": [],
        "transitionRules": []
      }
    },
    "nano": 0,
    "year": 2018,
    "monthValue": 4,
    "dayOfMonth": 25,
    "hour": 20,
    "minute": 36,
    "second": 0,
    "dayOfWeek": "WEDNESDAY",
    "dayOfYear": 115,
    "month": "APRIL"
  },
  "fileName": "file.png",
  "links": [
    {
      "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
      "createdTime": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },
        "nano": 0,
        "year": 2018,
        "monthValue": 4,
        "dayOfMonth": 25,
        "hour": 20,
        "minute": 36,
        "second": 0,
        "dayOfWeek": "WEDNESDAY",
        "dayOfYear": 115,
        "month": "APRIL"
      },
      "expired": false,
      "expiresTime": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },
        "nano": 0,
        "year": 2020,
        "monthValue": 4,
        "dayOfMonth": 25,
        "hour": 20,
        "minute": 36,
        "second": 0,
        "dayOfWeek": "SATURDAY",
        "dayOfYear": 116,
        "month": "APRIL"
      },
      "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
      "liveMode": false,
      "metadata": {
        "coupon": "iOS"
      },
      "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
    }
  ],
  "purpose": "tax_document_customer_upload",
  "title": "My 2019 Tax Certificate.",
  "size": 72334,
  "type": "png",
  "url": "https://files.digitalriver.com/files/file_17a0cab7-1ff7-478e-99f9-d4e753dec24d/contents",
  "liveMode": false
}