Invoices
Find Partner Invoices
/v1/networks/billings/affiliates/invoicestable
This endpoint allows to fetch partner invoices. Different filters can be used to narrow down the set of invoices that will be returned by the endpoint. You can, for example, use the filters to only return the unpaid invoices for a specific affiliate ID.
Paging
This endpoint supports paging. Refer to our User Guide for usage.
Body Params
Search terms are optional but can be used to look for specific words.
The name of the field used for search. On this endpoint, it can only ever be name
. Searching by name
will actually search the invoice ID, the partner ID as well as the partner name.
The value to search.
Filters are also completely optional but are usually used to narrow down the set of invoices returned. They can be used individually or combined in a single request.
One or multiple partner IDs for which the invoices will be returned.
Return a specific set of invoice IDs.
One or multiple account manager IDs for which the invoices will be returned.
Only return invoices with a start date greater or equal to this value. Takes a date in the YYYY-MM-DD
format
Only return invoices with an end date smaller or equal to this value. Takes a date in the YYYY-MM-DD
format
Only return invoices with an invoice balance grater than this value.
Only return invoices with an invoice balance smaller than this value.
Only return invoices with a status equal to this value. Can only be paid
, unpaid
or deleted
Filters based on whether the invoice is visible to the partner or not. Can be visible
or hidden
Only return invoices for which the payment terms is a number of days contained in this array.
Request Examples
cURL
curl --request POST 'https://api.eflow.team/v1/networks/billings/affiliates/invoicestable' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Example 1 : Find all invoices for partners named “Google” where the invoice period finished before April 4th 2020 :
{
"search_terms":
[
{
"search_type": "name",
"value": "Google"
}
],
"filters":
{
"max_end_time": "2020-04-01"
}
}
Example 2 : Find all unpaid invoices for affiliate ID 8080 :
{
"search_terms": [],
"filters":
{
"affiliate_invoice_status": "unpaid",
"network_affiliate_ids":
[
8080
]
}
}
Response
{
"invoices": [
{
"network_affiliate_invoice_id": 368,
"network_id": 1,
"network_affiliate_id": 27,
"network_affiliate_name": "Example Affiliate",
"affiliate_invoice_status": "paid",
"start_time": "2019-12-01 00:00:00",
"end_time": "2020-03-06 23:59:59",
"timezone_id": 55,
"balance": 0,
"paid": 200,
"billed": 200,
"currency_id": "USD",
"payment_terms": 20,
"is_hidden_affiliate": false,
"public_notes": "",
"internal_notes": "",
"payment_type": "masspay",
"time_created": 1583541215,
"time_saved": 1599140043
}
],
"paging": {
"page": 1,
"page_size": 50,
"total_count": 1
}
}
Partner Invoices Summary
/v1/networks/billings/affiliates/summary
This endpoint is very similar to the endpoint documented above (“Find Partner Invoices”). The filters are exactly the same, but instead of returning multiple invoices, the endpoint will simply return the “summary” (billed amount, balance, etc.) of the invoices involved.
Body Params
Search terms are optional but can be used to look for specific words.
The name of the field used for search. On this endpoint, it can only ever be name
. Searching by name
will actually search the invoice ID, the partner ID as well as the partner name.
The value to search.
Filters are also completely optional but are usually used to narrow down the set of invoices returned. They can be used individually or combined in a single request.
One or multiple partner IDs for which the invoices will be returned.
Return a specific set of invoice IDs.
One or multiple account manager IDs for which the invoices will be returned.
Only return invoices with a start date greater or equal to this value. Takes a date in the YYYY-MM-DD
format
Only return invoices with an end date smaller or equal to this value. Takes a date in the YYYY-MM-DD
format
Only return invoices with an invoice balance grater than this value.
Only return invoices with an invoice balance smaller than this value.
Only return invoices with a status equal to this value. Can only be paid
, unpaid
or deleted
Filters based on whether the invoice is visible to the partner or not. Can be visible
or hidden
Only return invoices for which the payment terms is a number of days contained in this array.
Request Examples
cURL
curl --request POST 'https://api.eflow.team/v1/networks/billings/affiliates/summary' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Example 1 : Find the summary for invoices for partners named “Google” where the invoice period finished before April 4th 2020 :
{
"search_terms":
[
{
"search_type": "name",
"value": "Google"
}
],
"filters":
{
"max_end_time": "2020-04-01"
}
}
Example 2 : Find invoice summary for unpaid invoices for affiliate ID 8080 :
{
"search_terms": [],
"filters":
{
"affiliate_invoice_status": "unpaid",
"network_affiliate_ids":
[
8080
]
}
}
Response
{
"total_count": 1,
"balance": 23,
"billed": 23,
"paid": 0
}
Find Partner Invoice by ID
/v1/networks/billings/affiliates/invoices/:invoiceId
This endpoint allows you fetch the details of a single partner invoice.
Path Parameters
Parameter | Description |
---|---|
invoiceId | The ID of the partner invoice you want to fetch |
Request Example
cURL
curl --request GET '/v1/networks/billings/affiliates/invoices/553' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
"network_affiliate_invoice_id": 553,
"network_id": 1,
"network_affiliate_id": 27,
"status": "unpaid",
"start_time": "2020-09-03 00:00:00",
"end_time": "2020-09-09 23:59:59",
"public_notes": "",
"internal_notes": "",
"timezone_id": 80,
"balance": 72.95,
"currency_id": "USD",
"is_hidden_affiliate": false,
"payment_terms": 15,
"time_created": 1599711451,
"time_saved": 1626114580,
"relationship": {
"details": [
{
"network_affiliate_invoice_detail_id": 240,
"network_affiliate_invoice_id": 553,
"network_offer_id": 3,
"network_offer_name": "Example Offer Name",
"amount": 72.95,
"invoice_currency_amount": 72.95,
"currency_id": "USD",
"notes": "",
"quantity": 1,
"time_created": 0,
"time_saved": 0,
"referral_history_id": 0
}
]
},
"details": null,
"extra_periods": null
}
Create Partner Invoice
/v1/networks/billings/affiliates/invoices
This endpoint allows you to create a partner invoice via the API. Note that creating an invoice (whether marked as paid or unpaid) will never in itself trigger a payment.
Body Params
The ID of the partner that will be invoiced.
Status of the invoice that will be created. Can be paid
, unpaid
or deleted
Invoice start date in the YYYY-MM-DD
format
Invoice end date in the YYYY-MM-DD
format
Notes that will be visible to both the network employees and the invoiced partner.
Notes that will be visible to network employees but not the invoiced partner.
Determines whether the invoice is visible to the partner or not.
Number of days for the affiliate payment term (i.e. pass 20
for NET 20)
Request Examples
cURL
curl --request POST 'https://api.eflow.team/v1/networks/billings/affiliates/invoices' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT BODY HERE>'
Example body :
{
"network_affiliate_id": 7,
"start_time": "2021-12-01",
"end_time": "2021-12-20",
"status": "unpaid",
"is_hidden_affiliate": false,
"payment_terms": 15,
"public_notes": "public note visible to affiliate",
"internal_notes": "internal note not visible to affiliate"
}