Download OpenAPI specification:Download
The Emporix API Returns Service allows you to manage your returns.
Creates a single return document with given information.
If a return is being created by a customer directly, then the returns.returns_manage_own
scope is required.
If a return is being created by a tenant employee on behalf of a customer, then the returns.returns_manage
scope is required.
Note: Depending on a case, a different set of fields is required and allowed.
Required scopes (one of)
returns.returns_manage
returns.returns_manage_own
Base schema for a return requested by a customer.
The resource has been successfully created.
Resources cannot be created due to an error.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Return with given code already exists.
Internal Server Error.
{- "orders": [
- {
- "id": "B1LMYY52",
- "items": [
- {
- "id": "32090",
- "quantity": 2,
- "reason": {
- "code": "001"
}
}, - {
- "id": "32102",
- "quantity": 15,
- "reason": {
- "details": "It's too small."
}
}
]
}
], - "reason": {
- "code": "001",
- "details": "The items do not work."
}, - "mixins": {
- "customAttributes": {
- "attr1": "value1"
}
}, - "metadata": {
- "mixins": {
}
}
}
{- "id": "88b1779c-a8bf-4b94-b1be-b0edd149bba5"
}
Retrieves a list of return documents.
Required scopes (one of)
returns.returns_read
returns.returns_read_own
Example response
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "id": "7ba2f2b6-7dc8-45ff-9f20-4e6163c14c2e",
- "approvalStatus": "PENDING",
- "received": false,
- "orders": [
- {
- "id": "B1LMYY52",
- "items": [
- {
- "id": "32090",
- "name": "T-shirt",
- "quantity": 2,
- "reason": {
- "code": "001",
- "details": "It's too small"
}, - "unitPrice": {
- "value": 1.99,
- "currency": "USD"
}, - "total": {
- "value": 3.98,
- "currency": "USD"
}
}, - {
- "id": "32102",
- "name": "Jacket",
- "quantity": 15,
- "unitPrice": {
- "value": 1,
- "currency": "USD"
}, - "total": {
- "value": 15,
- "currency": "USD"
}
}
]
}
], - "reason": {
- "code": "001",
- "details": "The items do not work."
}, - "total": {
- "value": 18.98,
- "currency": "USD"
}, - "expiryDate": "2023-04-31T13:18:02.379Z",
- "metadata": {
- "createdAt": "2023-04-31T13:18:02.379Z",
- "modifiedAt": "2023-04-31T13:18:02.379Z",
- "version": 1
}
}
]
Retrieves a single return document.
Required scopes (one of)
returns.returns_read
returns.returns_read_own
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Not found response due to not-existing entity
{- "id": "7ba2f2b6-7dc8-45ff-9f20-4e6163c14c2e",
- "approvalStatus": "PENDING",
- "received": false,
- "orders": [
- {
- "id": "B1LMYY52",
- "items": [
- {
- "id": "32090",
- "name": "T-shirt",
- "quantity": 2,
- "reason": {
- "code": "001",
- "details": "It's too small"
}, - "unitPrice": {
- "value": 1.99,
- "currency": "USD"
}, - "total": {
- "value": 3.98,
- "currency": "USD"
}
}, - {
- "id": "32102",
- "name": "Jacket",
- "quantity": 15,
- "unitPrice": {
- "value": 1,
- "currency": "USD"
}, - "total": {
- "value": 15,
- "currency": "USD"
}
}
]
}
], - "reason": {
- "code": "001",
- "details": "The items do not work."
}, - "total": {
- "value": 18.98,
- "currency": "USD"
}, - "expiryDate": "2023-04-31T13:18:02.379Z",
- "metadata": {
- "createdAt": "2023-04-31T13:18:02.379Z",
- "modifiedAt": "2023-04-31T13:18:02.379Z",
- "version": 1
}
}
Updates a single return document with given information.
If a return is being updated by a customer directly, then the returns.returns_manage_own
scope is required.
If a return is being updated by a tenant employee on behalf of a customer, then the returns.returns_manage
scope is required.
Note: Depending on a case, a different set of fields is required and allowed.
A customer can change a return only when the return approval status is PENDING
.
Required scopes (one of)
returns.returns_manage
returns.returns_manage_own
Base schema for a return requested by a customer.
No Content
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Not found response due to not-existing entity
Internal Server Error.
{- "id": "6369140c5c6de75d9e84c97f",
- "orders": [
- {
- "id": "B1LMYY52",
- "items": [
- {
- "id": "32090",
- "quantity": 2,
- "reason": {
- "code": "001"
}
}, - {
- "id": "32102",
- "quantity": 15
}
]
}
], - "reason": {
- "code": "001",
- "details": "The items do not work."
}, - "mixins": {
- "customAttributes": {
- "attr1": "value1"
}
}, - "metadata": {
- "version": 1
}
}
{- "code": 0,
- "status": "string",
- "message": "string",
- "details": [
- {
- "message": "string"
}
]
}
Deletes a single return document.
The return can be deleted completely only by an employee, that is a user who has the returns.returns_manage
scope granted. A customer, who has the returns.returns_manage_own
scope granted, can delete a return only if the return status is PENDING
. The return status is changed to CLOSED
during the delete operation.
*Required scopes (one of)
returns.returns_manage
returns.returns_manage_own
No Content
Bad request - a return cannot be deleted because it has an inappropriate status.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Internal Server Error.
{- "code": 400,
- "status": "Bad Request",
- "message": "Deleting this return is not allowed since it doesn't match all preconditions."
}
Parial update of a single return document with given information.
If a return is being updated by a customer directly, then the returns.returns_manage_own
and returns.returns_read_own
scope is required.
If a return is being updated by a tenant employee on behalf of a customer, then the returns.returns_manage
and returns.returns_read
scope is required.
Note: Depending on a case, a different set of fields is allowed.
A customer can change a return only when the return approval status is PENDING
.
The patch request consists of set of operation, that should be defined according to RFC-6902 standard
Required scopes (one of)
returns.returns_manage
returns.returns_manage_own
No Content
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Not found response due to not-existing entity
Internal Server Error.
[- {
- "op": "replace",
- "path": "/requestor/customerId",
- "value": "changedCustomerId"
}
]
{- "code": 0,
- "status": "string",
- "message": "string",
- "details": [
- {
- "message": "string"
}
]
}