Files
The Files resource in the Digital River API provides a secure and organized way to manage and access various documents and records associated with order management. This resource facilitates the uploading and storing of files, such as customer tax certificates and invoices, ensuring they are readily available for retrieval and review. By leveraging the Files resource, you can efficiently handle documentation critical to transaction processing and compliance within the Digital River ecosystem.
Gets all files specified in the request.
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.
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.
A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.
Only return objects with these IDs.
Only return files with this purpose.
Only return files with this file name.
Only return files with this title.
Only return files of this type.
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
}
]
}
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.
A file to upload. The file should follow the specifications of RFC 2388 (which defines file transfers for the multipart/form-data protocol).
The purpose of the uploaded file.
tax_document_customer_upload
Possible values: A filename for the file, suitable for saving to a filesystem.
file.png
A user friendly title for the document.
My 2019 Tax Certificate.
Time at which the link expires.
{"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"}
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
}
Retrieves the details of a file. You must supply the unique identifier of the file.
File identifier.
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
}
Permanently deletes a file. Supply the unique identifier of the file.
File ID
DELETE /files/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated