Opply Opply Documents API
The Opply Documents API from Opply — 7 operation(s) for opply documents.
The Opply Documents API from Opply — 7 operation(s) for opply documents.
openapi: 3.0.3
info:
title: Opply Activity Feed Opply Documents API
version: 0.0.0
tags:
- name: Opply Documents
paths:
/api/v1/companies/opply-document-types/:
get:
operationId: api_v1_companies_opply_document_types_list
description: Returns all available document types for the MoR document upload dropdown.
summary: List Opply document types
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DocumentType'
description: ''
/api/v1/companies/opply-document-types/{uuid}/:
get:
operationId: api_v1_companies_opply_document_types_retrieve
description: Returns details for a specific document type.
summary: Retrieve Opply document type
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentType'
description: ''
/api/v1/companies/opply-documents/:
get:
operationId: api_v1_companies_opply_documents_list
description: Returns all Opply documents for the current MoR company.
summary: List Opply documents (MoR)
parameters:
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: search
required: false
in: query
description: A search term.
schema:
type: string
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedOpplyDocumentList'
description: ''
post:
operationId: api_v1_companies_opply_documents_create
description: Upload a new compliance document (organic certificate, policy, etc.).
summary: Create Opply document
tags:
- Opply Documents
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocument'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OpplyDocument'
multipart/form-data:
schema:
$ref: '#/components/schemas/OpplyDocument'
required: true
security:
- tokenAuth: []
- cookieAuth: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocument'
description: ''
/api/v1/companies/opply-documents-buyer/:
get:
operationId: api_v1_companies_opply_documents_buyer_list
description: Returns Opply compliance documents visible to the buyer. Documents with no countries set are shown to all buyers. Documents with specific countries are only shown to buyers whose company country matches one of those countries.
summary: List Opply documents (Buyer)
parameters:
- in: query
name: is_archived
schema:
type: boolean
description: Filter by computed `is_archived` (active vs archived sub-tab).
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: search
required: false
in: query
description: A search term.
schema:
type: string
- in: query
name: status
schema:
type: string
enum:
- expired
- expiring_soon
- renewed
- valid
description: Filter by computed lifecycle status.
- in: query
name: type_uuid__in
schema:
type: string
description: Filter by comma-separated document type UUIDs.
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedOpplyDocumentBuyerList'
description: ''
/api/v1/companies/opply-documents-buyer/{uuid}/:
get:
operationId: api_v1_companies_opply_documents_buyer_retrieve
description: Returns details for a specific Opply document.
summary: Retrieve Opply document (Buyer)
parameters:
- in: path
name: uuid
schema:
type: string
required: true
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocumentBuyer'
description: ''
/api/v1/companies/opply-documents-buyer/types-facet/:
get:
operationId: api_v1_companies_opply_documents_buyer_types_facet_list
description: Returns the distinct `DocumentType`s that have at least one OpplyDocument visible to the current brand (country-scoped). Used by the FE filter dropdown so it only offers types the user can actually narrow to.
summary: List document types present on Opply documents visible to the buyer
parameters:
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: search
required: false
in: query
description: A search term.
schema:
type: string
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DocumentType'
description: ''
/api/v1/companies/opply-documents/{uuid}/:
get:
operationId: api_v1_companies_opply_documents_retrieve
description: Returns details for a specific Opply document.
summary: Retrieve Opply document (MoR)
parameters:
- in: path
name: uuid
schema:
type: string
required: true
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocument'
description: ''
put:
operationId: api_v1_companies_opply_documents_update
description: Update all fields of an existing Opply document.
summary: Update Opply document
parameters:
- in: path
name: uuid
schema:
type: string
required: true
tags:
- Opply Documents
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocument'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OpplyDocument'
multipart/form-data:
schema:
$ref: '#/components/schemas/OpplyDocument'
required: true
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocument'
description: ''
patch:
operationId: api_v1_companies_opply_documents_partial_update
description: Update specific fields of an existing Opply document.
summary: Partial update Opply document
parameters:
- in: path
name: uuid
schema:
type: string
required: true
tags:
- Opply Documents
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedOpplyDocument'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedOpplyDocument'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedOpplyDocument'
security:
- tokenAuth: []
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/OpplyDocument'
description: ''
delete:
operationId: api_v1_companies_opply_documents_destroy
description: Permanently delete an Opply document.
summary: Delete Opply document
parameters:
- in: path
name: uuid
schema:
type: string
required: true
tags:
- Opply Documents
security:
- tokenAuth: []
- cookieAuth: []
responses:
'204':
description: No response body
components:
schemas:
PaginatedOpplyDocumentList:
type: object
required:
- count
- results
properties:
count:
type: integer
example: 123
next:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=4
previous:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=2
results:
type: array
items:
$ref: '#/components/schemas/OpplyDocument'
DocumentLifecycleStatusEnum:
enum:
- valid
- expired
- expiring_soon
- renewed
type: string
description: '* `valid` - Valid
* `expired` - Expired
* `expiring_soon` - Expiring Soon
* `renewed` - Renewed'
Country:
enum:
- AF
- AX
- AL
- DZ
- AS
- AD
- AO
- AI
- AQ
- AG
- AR
- AM
- AW
- AU
- AT
- AZ
- BS
- BH
- BD
- BB
- BY
- BE
- BZ
- BJ
- BM
- BT
- BO
- BQ
- BA
- BW
- BV
- BR
- IO
- BN
- BG
- BF
- BI
- CV
- KH
- CM
- CA
- KY
- CF
- TD
- CL
- CN
- CX
- CC
- CO
- KM
- CG
- CD
- CK
- CR
- CI
- HR
- CU
- CW
- CY
- CZ
- DK
- DJ
- DM
- DO
- EC
- EG
- SV
- GQ
- ER
- EE
- SZ
- ET
- FK
- FO
- FJ
- FI
- FR
- GF
- PF
- TF
- GA
- GM
- GE
- DE
- GH
- GI
- GR
- GL
- GD
- GP
- GU
- GT
- GG
- GN
- GW
- GY
- HT
- HM
- VA
- HN
- HK
- HU
- IS
- IN
- ID
- IR
- IQ
- IE
- IM
- IL
- IT
- JM
- JP
- JE
- JO
- KZ
- KE
- KI
- KW
- KG
- LA
- LV
- LB
- LS
- LR
- LY
- LI
- LT
- LU
- MO
- MG
- MW
- MY
- MV
- ML
- MT
- MH
- MQ
- MR
- MU
- YT
- MX
- FM
- MD
- MC
- MN
- ME
- MS
- MA
- MZ
- MM
- NA
- NR
- NP
- NL
- NC
- NZ
- NI
- NE
- NG
- NU
- NF
- KP
- MK
- XI
- MP
- 'NO'
- OM
- PK
- PW
- PS
- PA
- PG
- PY
- PE
- PH
- PN
- PL
- PT
- PR
- QA
- RE
- RO
- RU
- RW
- BL
- SH
- KN
- LC
- MF
- PM
- VC
- WS
- SM
- ST
- SA
- SN
- RS
- SC
- SL
- SG
- SX
- SK
- SI
- SB
- SO
- ZA
- GS
- KR
- SS
- ES
- LK
- SD
- SR
- SJ
- SE
- CH
- SY
- TW
- TJ
- TZ
- TH
- TL
- TG
- TK
- TO
- TT
- TN
- TR
- TM
- TC
- TV
- UG
- UA
- AE
- GB
- UM
- US
- UY
- UZ
- VU
- VE
- VN
- VG
- VI
- WF
- EH
- YE
- ZM
- ZW
type: string
description: '* `AF` - Afghanistan
* `AX` - Åland Islands
* `AL` - Albania
* `DZ` - Algeria
* `AS` - American Samoa
* `AD` - Andorra
* `AO` - Angola
* `AI` - Anguilla
* `AQ` - Antarctica
* `AG` - Antigua and Barbuda
* `AR` - Argentina
* `AM` - Armenia
* `AW` - Aruba
* `AU` - Australia
* `AT` - Austria
* `AZ` - Azerbaijan
* `BS` - Bahamas
* `BH` - Bahrain
* `BD` - Bangladesh
* `BB` - Barbados
* `BY` - Belarus
* `BE` - Belgium
* `BZ` - Belize
* `BJ` - Benin
* `BM` - Bermuda
* `BT` - Bhutan
* `BO` - Bolivia
* `BQ` - Bonaire, Sint Eustatius and Saba
* `BA` - Bosnia and Herzegovina
* `BW` - Botswana
* `BV` - Bouvet Island
* `BR` - Brazil
* `IO` - British Indian Ocean Territory
* `BN` - Brunei
* `BG` - Bulgaria
* `BF` - Burkina Faso
* `BI` - Burundi
* `CV` - Cabo Verde
* `KH` - Cambodia
* `CM` - Cameroon
* `CA` - Canada
* `KY` - Cayman Islands
* `CF` - Central African Republic
* `TD` - Chad
* `CL` - Chile
* `CN` - China
* `CX` - Christmas Island
* `CC` - Cocos (Keeling) Islands
* `CO` - Colombia
* `KM` - Comoros
* `CG` - Congo
* `CD` - Congo (the Democratic Republic of the)
* `CK` - Cook Islands
* `CR` - Costa Rica
* `CI` - Côte d''Ivoire
* `HR` - Croatia
* `CU` - Cuba
* `CW` - Curaçao
* `CY` - Cyprus
* `CZ` - Czechia
* `DK` - Denmark
* `DJ` - Djibouti
* `DM` - Dominica
* `DO` - Dominican Republic
* `EC` - Ecuador
* `EG` - Egypt
* `SV` - El Salvador
* `GQ` - Equatorial Guinea
* `ER` - Eritrea
* `EE` - Estonia
* `SZ` - Eswatini
* `ET` - Ethiopia
* `FK` - Falkland Islands (Malvinas)
* `FO` - Faroe Islands
* `FJ` - Fiji
* `FI` - Finland
* `FR` - France
* `GF` - French Guiana
* `PF` - French Polynesia
* `TF` - French Southern Territories
* `GA` - Gabon
* `GM` - Gambia
* `GE` - Georgia
* `DE` - Germany
* `GH` - Ghana
* `GI` - Gibraltar
* `GR` - Greece
* `GL` - Greenland
* `GD` - Grenada
* `GP` - Guadeloupe
* `GU` - Guam
* `GT` - Guatemala
* `GG` - Guernsey
* `GN` - Guinea
* `GW` - Guinea-Bissau
* `GY` - Guyana
* `HT` - Haiti
* `HM` - Heard Island and McDonald Islands
* `VA` - Holy See
* `HN` - Honduras
* `HK` - Hong Kong
* `HU` - Hungary
* `IS` - Iceland
* `IN` - India
* `ID` - Indonesia
* `IR` - Iran
* `IQ` - Iraq
* `IE` - Ireland
* `IM` - Isle of Man
* `IL` - Israel
* `IT` - Italy
* `JM` - Jamaica
* `JP` - Japan
* `JE` - Jersey
* `JO` - Jordan
* `KZ` - Kazakhstan
* `KE` - Kenya
* `KI` - Kiribati
* `KW` - Kuwait
* `KG` - Kyrgyzstan
* `LA` - Laos
* `LV` - Latvia
* `LB` - Lebanon
* `LS` - Lesotho
* `LR` - Liberia
* `LY` - Libya
* `LI` - Liechtenstein
* `LT` - Lithuania
* `LU` - Luxembourg
* `MO` - Macao
* `MG` - Madagascar
* `MW` - Malawi
* `MY` - Malaysia
* `MV` - Maldives
* `ML` - Mali
* `MT` - Malta
* `MH` - Marshall Islands
* `MQ` - Martinique
* `MR` - Mauritania
* `MU` - Mauritius
* `YT` - Mayotte
* `MX` - Mexico
* `FM` - Micronesia
* `MD` - Moldova
* `MC` - Monaco
* `MN` - Mongolia
* `ME` - Montenegro
* `MS` - Montserrat
* `MA` - Morocco
* `MZ` - Mozambique
* `MM` - Myanmar
* `NA` - Namibia
* `NR` - Nauru
* `NP` - Nepal
* `NL` - Netherlands
* `NC` - New Caledonia
* `NZ` - New Zealand
* `NI` - Nicaragua
* `NE` - Niger
* `NG` - Nigeria
* `NU` - Niue
* `NF` - Norfolk Island
* `KP` - North Korea
* `MK` - North Macedonia
* `XI` - Northern Ireland
* `MP` - Northern Mariana Islands
* `NO` - Norway
* `OM` - Oman
* `PK` - Pakistan
* `PW` - Palau
* `PS` - Palestine, State of
* `PA` - Panama
* `PG` - Papua New Guinea
* `PY` - Paraguay
* `PE` - Peru
* `PH` - Philippines
* `PN` - Pitcairn
* `PL` - Poland
* `PT` - Portugal
* `PR` - Puerto Rico
* `QA` - Qatar
* `RE` - Réunion
* `RO` - Romania
* `RU` - Russia
* `RW` - Rwanda
* `BL` - Saint Barthélemy
* `SH` - Saint Helena, Ascension and Tristan da Cunha
* `KN` - Saint Kitts and Nevis
* `LC` - Saint Lucia
* `MF` - Saint Martin (French part)
* `PM` - Saint Pierre and Miquelon
* `VC` - Saint Vincent and the Grenadines
* `WS` - Samoa
* `SM` - San Marino
* `ST` - Sao Tome and Principe
* `SA` - Saudi Arabia
* `SN` - Senegal
* `RS` - Serbia
* `SC` - Seychelles
* `SL` - Sierra Leone
* `SG` - Singapore
* `SX` - Sint Maarten (Dutch part)
* `SK` - Slovakia
* `SI` - Slovenia
* `SB` - Solomon Islands
* `SO` - Somalia
* `ZA` - South Africa
* `GS` - South Georgia and the South Sandwich Islands
* `KR` - South Korea
* `SS` - South Sudan
* `ES` - Spain
* `LK` - Sri Lanka
* `SD` - Sudan
* `SR` - Suriname
* `SJ` - Svalbard and Jan Mayen
* `SE` - Sweden
* `CH` - Switzerland
* `SY` - Syria
* `TW` - Taiwan
* `TJ` - Tajikistan
* `TZ` - Tanzania
* `TH` - Thailand
* `TL` - Timor-Leste
* `TG` - Togo
* `TK` - Tokelau
* `TO` - Tonga
* `TT` - Trinidad and Tobago
* `TN` - Tunisia
* `TR` - Türkiye
* `TM` - Turkmenistan
* `TC` - Turks and Caicos Islands
* `TV` - Tuvalu
* `UG` - Uganda
* `UA` - Ukraine
* `AE` - United Arab Emirates
* `GB` - United Kingdom
* `UM` - United States Minor Outlying Islands
* `US` - United States of America
* `UY` - Uruguay
* `UZ` - Uzbekistan
* `VU` - Vanuatu
* `VE` - Venezuela
* `VN` - Vietnam
* `VG` - Virgin Islands (British)
* `VI` - Virgin Islands (U.S.)
* `WF` - Wallis and Futuna
* `EH` - Western Sahara
* `YE` - Yemen
* `ZM` - Zambia
* `ZW` - Zimbabwe'
OpplyDocumentBuyer:
type: object
description: 'Read-only serializer for buyers viewing Opply documents.
Returns all documents (including archived) with computed status.'
properties:
uuid:
type: string
format: uuid
readOnly: true
type:
allOf:
- $ref: '#/components/schemas/DocumentType'
readOnly: true
file:
type: string
format: uri
readOnly: true
description: The uploaded document file
name:
type: string
readOnly: true
description: Display name for the document
start_date:
type: string
format: date
readOnly: true
nullable: true
description: Start date of document validity
end_date:
type: string
format: date
readOnly: true
nullable: true
description: End/expiry date of document validity
status:
allOf:
- $ref: '#/components/schemas/DocumentLifecycleStatusEnum'
readOnly: true
is_archived:
type: boolean
description: Return whether the document is archived (expired or renewed).
readOnly: true
countries:
type: array
items:
$ref: '#/components/schemas/Country'
readOnly: true
description: ISO country codes this document applies to. Empty = all countries.
required:
- countries
- end_date
- file
- is_archived
- name
- start_date
- status
- type
- uuid
OpplyDocument:
type: object
description: 'Serializer for OpplyDocument - for MoR users.
Handles CRUD operations with computed status fields.'
properties:
uuid:
type: string
format: uuid
readOnly: true
merchant_of_record:
type: integer
readOnly: true
description: The Merchant of Record that owns this document
type:
allOf:
- $ref: '#/components/schemas/DocumentType'
readOnly: true
type_uuid:
type: string
format: uuid
writeOnly: true
renewing_uuid:
type: string
format: uuid
writeOnly: true
nullable: true
file:
type: string
format: uri
description: The uploaded document file
name:
type: string
description: Display name for the document
maxLength: 255
start_date:
type: string
format: date
nullable: true
description: Start date of document validity
end_date:
type: string
format: date
nullable: true
description: End/expiry date of document validity
status:
allOf:
- $ref: '#/components/schemas/DocumentLifecycleStatusEnum'
readOnly: true
is_archived:
type: boolean
description: Return whether the document is archived (expired or renewed).
readOnly: true
superseded_by_uuid:
type: string
format: uuid
readOnly: true
nullable: true
created:
type: string
format: date-time
readOnly: true
modified:
type: string
format: date-time
readOnly: true
countries:
type: array
items:
$ref: '#/components/schemas/Country'
description: ISO country codes this document applies to. Empty = all countries.
required:
- created
- file
- is_archived
- merchant_of_record
- modified
- name
- status
- superseded_by_uuid
- type
- uuid
DocumentType:
type: object
description: Shared serializer for the DocumentType taxonomy (buyer, supplier, Opply documents).
properties:
uuid:
type: string
format: uuid
readOnly: true
name:
type: string
maxLength: 255
description:
type: string
required:
- name
- uuid
PatchedOpplyDocument:
type: object
description: 'Serializer for OpplyDocument - for MoR users.
Handles CRUD operations with computed status fields.'
properties:
uuid:
type: string
format: uuid
readOnly: true
merchant_of_record:
type: integer
readOnly: true
description: The Merchant of Record that owns this document
type:
allOf:
- $ref: '#/components/schemas/DocumentType'
readOnly: true
type_uuid:
type: string
format: uuid
writeOnly: true
renewing_uuid:
type: string
format: uuid
writeOnly: true
nullable: true
file:
type: string
format: uri
description: The uploaded document file
name:
type: string
description: Display name for the document
maxLength: 255
start_date:
type: string
format: date
nullable: true
description: Start date of document validity
end_date:
type: string
format: date
nullable: true
description: End/expiry date of document validity
status:
allOf:
- $ref: '#/components/schemas/DocumentLifecycleStatusEnum'
readOnly: true
is_archived:
type: boolean
description: Return whether the document is archived (expired or renewed).
readOnly: true
superseded_by_uuid:
type: string
format: uuid
readOnly: true
nullable: true
created:
type: string
format: date-time
readOnly: true
modified:
type: string
format: date-time
readOnly: true
countries:
type: array
items:
$ref: '#/components/schemas/Country'
description: ISO country codes this document applies to. Empty = all countries.
PaginatedOpplyDocumentBuyerList:
type: object
required:
- count
- results
properties:
count:
type: integer
example: 123
next:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=4
previous:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=2
results:
type: array
items:
$ref: '#/components/schemas/OpplyDocumentBuyer'
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: sessionid
tokenAuth:
type: apiKey
in: header
name: Authorization
description: Token-based authentication with required prefix "Token"