Developer Center

UpdateInvoiceItem

The specified invoice item is updated with the given parameters.

Method / Endpoint

PUT/ {{API_URL}} Billing/UpdateInvoiceItem/ {{ID}}

Request Parameters

Parameter Name Type Requirement Description
{{ID}} Integer Yes Invoice Item Sequence Number
owner_id Integer No Invoice ID Number
If defined, the invoice item will be moved to the new invoice ID number you specified.
sequence Integer No Invoice Item Sequence Number
description String No Invoice Item Description
quantity Integer No Invoice Item Quantity. Default : 1
amount Double No Invoice Item Unit Price
total Double No Invoice Item Total Amount. Default: Unit Price
order_id Integer No The product/service ID number to which the invoice item is linked. This information can be obtained from the "id" field in the "users_products" table in the database.
due_date String No If the invoice item is linked to a product/service, it must have the same end date as the product/service. Format: YYYY-MM-DD HH:ii:ss
attributes Object No If the invoice item is linked to a product/service, it contains information about the purchase or renewal of the linked product/service.

External Sample

curl --location --request PUT
'https://example.com/api/Billing/UpdateInvoiceItem/123' \
--header 'Content-Type: application/json' \
--header 'Apikey: [YOUR_API_KEY]' \
--data '{
    "sequence": 3,
    "description": "test description 3",
    "quantity": 1,
    "tax_exempt": false,
    "amount": 100,
    "total": 100,
    "order_id": 0,
    "due_date": "2023-12-20 23:59:59",
    "attributes": {
        "sample3": "Example test 3"
    }
}'

Internal Sample

Helper::Load("Api");
try {
    $result = Api::Billing()->UpdateInvoiceItem([
        'id'            => 1233, // Invoice Item ID
        'sequence'      => 3,
        'description'   => 'test description 3',
        'quantity'      => 1,
        'tax_exempt'    => false,
        'amount'        => 100,
        'total'         => 100,
        'order_id'      => 0,
        'due_date'      => '2023-12-20 23:59:59',
        'attributes'    => [
            'sample3'   => 'Example test 3',
        ],
    ]);
    print_r($result);
}
catch (Exception $e)
{
    echo 'Error: '.$e->getMessage();
}

Sample JSON Response

{
    "status": "successful",
    "data": {
        "id": 572,
        "sequence": 3,
        "owner_id": 468,
        "description": "test description 3",
        "quantity": 1,
        "tax_exempt": false,
        "amount": 100,
        "total": 100,
        "order_id": 0,
        "due_date": "2023-12-20 23:59:59",
        "attributes": {
            "sample3": "Example test 3"
        }
    }
}

Response Parameters

Parameters Name Type Description
status String Action Status "successful" or "error"
message String Error message if action status is "error"
data Object It contains the same values as the "items" parameters in the response parameters in the "GetInvoice" document.
CreateInvoiceItem

Do you have any questions?

Feel free to contact us
Contact Us
Copyright © 2024. All Rights Reserved.
Join Our Discord Channel
Top