Description
Create an invoice for a collection.
Error will be thrown if no collection
with provided $TRANSACTION_NUMBER is found.
Items information and item details information required to be sent along with the request.
Item details can be an empty array if not applicable.
Warning: This operation requires outlet access permissions enabled, contact an admin should you require it
Parameters
Parameter | Type | Value | Required |
operation_name | String | createInvoice | true |
variables | JSON | $JSON_OBJECT | true |
$JSON_OBJECT Structure
Key | Type | Value | Required |
brandId | String | $SHARED_BRAND_ID | true |
base | Float | $BASE | true |
final | Float | $FINAL | true |
discount | Float | $DISCOUNT | true |
itemDiscount | Float | $ITEM_DISCOUNT | true |
code | String | $CODE | true |
transactionNumber | String | $TRANSACTION_NUMBER | true |
items | ItemAttributes | $ITEM_ATTRIBUTE_OBJECT | true |
$ITEM_ATTRIBUTE_OBJECT Structure
Key | Type | Value | Required |
base | Float | $BASE | true |
final | Float | $FINAL | true |
discount | Float | $DISCOUNT | true |
skuCode | String | $SKU_CODE | true |
name | String | $NAME | true |
itemDetails | ItemDetailAttributes | $ITEM_ATTRIBUTE_DETAIL_OBJECT | true |
$ITEM_DETAIL_ATTRIBUTES_OBJECT Structure
Key | Type | Value | Required |
name | String | $NAME | true |
cost | Float | $FLOAT | true |
Example
Request
curl \
-X POST \
-H "Content-Type: application/json" \
-H "Token: $TOKEN" \
-d '{
"operation_name": "createInvoice",
"variables": {
"base": 100.0,
"final": 90.0,
"code": "A12345",
"discount": 5.0,
"itemDiscount": 5.0,
"items": [
{
"base": 100.0,
"final": 95.0,
"skuCode": "Item1",
"name": "Ball",
"discount": 5.0,
"itemDetails": [
{
"name": "Black",
"cost": 0.0
}
]
}
],
"brandId": $SHARED_BRAND_ID,
"transactionNumber": $TRANSACTION_NUMBER
}
}' \
https://mulahpoints.com/third_party
Response
{
"data": {
"thirdPartyCreateInvoice": {
"result": $SUCCESS_MESSAGE,
"errors": [
{message: $ERROR_MESSAGE}
]
}
}
}