Download OpenAPI specification:Download
The Emporix API Approval Service allows you to manage approval requests related to orders. The orders are referred to as resources.
Key Features:
Key Benefits:
Creates a single approval document with information about the approver and order details.
In case of any validation problems, the below errorCodes
can be returned:
Required scopes
approval.approval_manage_own
The resource has been successfully created.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource with given code already exists.
{- "id": "64e241ced632aa413a27a318",
- "resourceType": "CART",
- "resourceId": "cartId",
- "action": "CHECKOUT",
- "approver": {
- "userId": "aaa2f2b6-7dc8-45ff-9f20-4e6163c14cbb"
}, - "comment": "Comment to the approval user",
- "details": {
- "currency": "EUR",
- "paymentMethods": [
- {
- "provider": "stripe",
- "customAttributes": {
- "paymentType": "invoice"
}, - "method": "invoice",
- "amount": 3
}
], - "shipping": {
- "zoneId": "deliveryarea",
- "methodId": "4-more_hours_timeframe",
- "amount": 10,
- "methodName": "Delivery method name",
- "shippingTaxCode": "STANDARD"
}, - "payment": {
- "paymentId": "636cc738-f0cd-11ed-a05b-0242ac120003",
- "customAttributes": {
- "attribute1": "value of the attribute1",
- "attribute2": "value of the attribute2"
}
}, - "addresses": [
- {
- "contactName": "John Doe",
- "street": "Fritz-Elsas-Straße",
- "streetNumber": "20",
- "streetAppendix": "",
- "zipCode": "70173",
- "city": "Stuttgart",
- "country": "DE",
- "type": "SHIPPING",
- "contactPhone": "123456789"
}, - {
- "contactName": "John Doe",
- "street": "Fritz-Elsas-Straße",
- "streetNumber": "20",
- "streetAppendix": "",
- "zipCode": "70173",
- "city": "Stuttgart",
- "country": "DE",
- "type": "BILLING",
- "contactPhone": "123456789"
}
]
}
}
{- "id": "88b1779c-a8bf-4b94-b1be-b0edd149bba5"
}
Retrieves a list of approval documents which is assigned to the user. The user needs to be a requestor or the approval giver. Retrieves a list of approval documents which is assigned to the user. The user needs to be a requestor or an approval giver.
Required scopes
approval.approval_read_own
Example response
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "id": "64e241ced632aa413a27a318",
- "status": "PENDING",
- "resourceType": "CART",
- "resource": {
- "id": "cartId",
- "items": [
- {
- "quantity": 1,
- "itemPrice": {
- "currency": "EUR",
- "amount": 10
}, - "itemYrn": "urn:yaas:saasag:caasproduct:product:myshop;4474e3dfaee4c10def3d9b24"
}
], - "totalPrice": {
- "currency": "EUR",
- "amount": 10
}, - "subTotalPrice": {
- "currency": "EUR",
- "amount": 10
}, - "subtotalAggregate": {
- "currency": "EUR",
- "netValue": 10,
- "grossValue": 12,
- "taxValue": 20
}, - "siteCode": "main",
- "deliveryWindow": {
- "id": "deliveryWindowId",
- "slotId": "deliveryWindowSlotId",
- "deliveryDate": "2023-04-30T13:18:02.379Z"
}
}, - "action": "CHECKOUT",
- "requestor": {
- "userId": "aaa2f2b6-7dc8-45ff-9f20-4e6163c14ceb",
- "firstName": "John",
- "lastName": "Doe"
}, - "approver": {
- "userId": "aaa2f2b6-7dc8-45ff-9f20-4e6163c14cbb",
- "firstName": "John",
- "lastName": "Doe"
}, - "comment": "Comment to the approval user",
- "approverComment": "Important comment to the requestor user",
- "expiryDate": "2023-04-31T13:18:02.379Z",
- "details": {
- "currency": "EUR",
- "paymentMethods": [
- {
- "provider": "stripe",
- "customAttributes": {
- "paymentType": "invoice"
}, - "method": "invoice",
- "amount": 3
}
], - "shipping": {
- "zoneId": "deliveryarea",
- "methodId": "4-more_hours_timeframe",
- "amount": 10,
- "methodName": "Delivery method name",
- "shippingTaxCode": "STANDARD"
}, - "payment": {
- "paymentId": "636cc738-f0cd-11ed-a05b-0242ac120003",
- "customAttributes": {
- "attribute1": "value of the attribute1",
- "attribute2": "value of the attribute2"
}
}, - "addresses": [
- {
- "contactName": "John Doe",
- "street": "Fritz-Elsas-Straße",
- "streetNumber": "20",
- "streetAppendix": "",
- "zipCode": "70173",
- "city": "Stuttgart",
- "country": "DE",
- "type": "SHIPPING",
- "contactPhone": "123456789"
}, - {
- "contactName": "John Doe",
- "street": "Fritz-Elsas-Straße",
- "streetNumber": "20",
- "streetAppendix": "",
- "zipCode": "70173",
- "city": "Stuttgart",
- "country": "DE",
- "type": "BILLING",
- "contactPhone": "123456789"
}
]
}, - "metadata": {
- "createdAt": "2023-04-31T13:18:02.379Z",
- "modifiedAt": "2023-04-31T13:18:02.379Z",
- "version": 1
}
}
]
Retrieves a single approval document which is assigned to the user. The user needs to be a requestor or an approval giver.
In case of any validation problems, the below errorCodes
can be returned:
Required scopes
approval.approval_read_own
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource cannot be found
{- "id": "64e241ced632aa413a27a318",
- "status": "PENDING",
- "resourceType": "CART",
- "resource": {
- "id": "cartId",
- "items": [
- {
- "quantity": 1,
- "itemPrice": {
- "currency": "EUR",
- "amount": 10
}, - "itemYrn": "urn:yaas:saasag:caasproduct:product:myshop;4474e3dfaee4c10def3d9b24"
}
], - "totalPrice": {
- "currency": "EUR",
- "amount": 10
}, - "subTotalPrice": {
- "currency": "EUR",
- "amount": 10
}, - "subtotalAggregate": {
- "currency": "EUR",
- "netValue": 10,
- "grossValue": 12,
- "taxValue": 20
}, - "siteCode": "main",
- "deliveryWindow": {
- "id": "deliveryWindowId",
- "slotId": "deliveryWindowSlotId",
- "deliveryDate": "2023-04-30T13:18:02.379Z"
}
}, - "action": "CHECKOUT",
- "requestor": {
- "userId": "aaa2f2b6-7dc8-45ff-9f20-4e6163c14ceb",
- "firstName": "John",
- "lastName": "Doe"
}, - "approver": {
- "userId": "aaa2f2b6-7dc8-45ff-9f20-4e6163c14cbb",
- "firstName": "John",
- "lastName": "Doe"
}, - "comment": "Comment to the approval user",
- "approverComment": "Important comment to the requestor user",
- "expiryDate": "2023-04-31T13:18:02.379Z",
- "details": {
- "currency": "EUR",
- "paymentMethods": [
- {
- "provider": "stripe",
- "customAttributes": {
- "paymentType": "invoice"
}, - "method": "invoice",
- "amount": 3
}
], - "shipping": {
- "zoneId": "deliveryarea",
- "methodId": "4-more_hours_timeframe",
- "amount": 10,
- "methodName": "Delivery method name",
- "shippingTaxCode": "STANDARD"
}, - "payment": {
- "paymentId": "636cc738-f0cd-11ed-a05b-0242ac120003",
- "customAttributes": {
- "attribute1": "value of the attribute1",
- "attribute2": "value of the attribute2"
}
}, - "addresses": [
- {
- "contactName": "John Doe",
- "street": "Fritz-Elsas-Straße",
- "streetNumber": "20",
- "streetAppendix": "",
- "zipCode": "70173",
- "city": "Stuttgart",
- "country": "DE",
- "type": "SHIPPING",
- "contactPhone": "123456789"
}, - {
- "contactName": "John Doe",
- "street": "Fritz-Elsas-Straße",
- "streetNumber": "20",
- "streetAppendix": "",
- "zipCode": "70173",
- "city": "Stuttgart",
- "country": "DE",
- "type": "BILLING",
- "contactPhone": "123456789"
}
]
}, - "metadata": {
- "createdAt": "2023-04-31T13:18:02.379Z",
- "modifiedAt": "2023-04-31T13:18:02.379Z",
- "version": 1
}
}
Partially updates a single approval document with given information. To update the approval, the user needs to be a requestor or an approval giver. Single update may contain multiple partial updates in the form of an array. It contains the allowed operations list:
add
(adding an item to the items list)remove
(removing an item from the items list)replace
(replacing an item with given id with new definition)
Approval can be updated only when status is PENDING.In case of any validation problems, the below errorCodes
can be returned:
Required scopes
approval.approval_manage_own
required | string |
required | string |
A status of the approval (string) or string or object or object |
No Content
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource cannot be found
[- {
- "op": "REPLACE",
- "path": "/comment",
- "value": "new comment"
}, - {
- "op": "REPLACE",
- "path": "/status",
- "value": "APPROVED"
}
]
{- "code": 400,
- "status": "Bad Request",
- "message": "Problem with validation",
- "details": [
- {
- "message": "resourceType: cannot be null"
}
], - "errorCode": "APPROVAL-400001"
}
Deletes a single approval document.
A customer, who has the approval.approval_manage_own
scope granted and is assigned to the approval as a requestor, can delete an approval. The approval can only be deleted if its status is PENDING
. The approval status is changed to CLOSED
during deletion.
In case of any validation problems, the below errorCodes
can be returned:
*Required scopes
approval.approval_manage_own
No Content
Bad request - an approval cannot be deleted because it has an inappropriate status.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource cannot be found
{- "code": 400,
- "status": "Bad Request",
- "message": "Deleting this approval is not allowed since it doesn't match all preconditions.",
- "errorCode": "APPROVAL-400001"
}
Checks the approval for given resource
In case of any validation problems, the below errorCodes
can be returned:
Required scopes
approval.approval_read_own
Approval permitted response
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "resourceId": "cartId",
- "resourceType": "CART",
- "action": "CHECKOUT"
}
{- "status": "APPROVED",
- "action": "CHECKOUT",
- "permitted": true,
- "approvalId": "64ef8d12b6385140afea1603"
}
Search for the users who can be assigned to the approvals.
In case of any validation problem, the below errorCodes
can be returned:
Required scopes
approval.approval_read_own
Approval permitted response
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "resourceId": "cartId",
- "resourceType": "CART",
- "action": "CHECKOUT"
}
[- {
- "userId": "aaa2f2b6-7dc8-45ff-9f20-4e6163c14ceb",
- "firstName": "John",
- "lastName": "Doe"
}
]