Create partner invoice
Overview
Generate a partner invoice for one or more orders, based on their unique reference numbers.
Requirements
You can include only confirmed/approved orders in partner invoices. To include multiple orders in the same partner invoice they must share the same currency.
Parameters
Parameters | Type/Description |
---|---|
sessionID | Required (String) |
Session identifier, output of the Login method. An exception is thrown if the values are incorrect. | |
Sales | Required (Array of strings) |
Array with the reference number of the orders you want included on the same partner invoice. |
Response
Parameters | Type/Description | |
---|---|---|
Proforma |
Object |
|
|
A partner invoice object with the structure detailed below. |
|
|
Number |
String |
|
|
Unique partner invoice identifier |
|
CreateDate |
String |
|
|
Partner invoice creation date |
|
DueDate |
String |
|
|
The date before which the partner needs to pay the invoice. |
|
Status |
String |
|
|
Partner invoice status. Possible values:
|
|
Currency |
String |
|
|
Partner invoice currency ISO code |
|
Total |
String |
|
|
Total costs of all orders included in the partner invoice |
|
PaymentMethod |
String |
|
|
Payment method used to pay for the partner invoice. NULL if the invoice was not paid. |
|
Orders |
String / Array |
|
|
Order references array of strings. A partner invoice only groups approved orders with the same currency. |
|
BusinessModel |
String |
|
|
The business model governing the relationship between you and the partner company. Possible values:
|
|
ProformaPDF |
String |
|
|
Partner invoice PDF download link. Valid for 1 hour. |
Request
<?php
require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
$sales = array(
'ORDER_REFERENCE_1',
'ORDER_REFERENCE_2'
);
try {
$NewProforma= $client->createProforma($sessionID, $sales);
} catch (SoapFault $e) {
echo "NewP: " . $e->getMessage();
exit;
}
var_dump ("NewP ", $NewProforma);
Errors
Error | Description |
---|---|
INVALID_ORDER |
You must provide an array with orders |
INVALID_PARTNER |
No partner was set. |
INVALID_PARTNER |
This partner does not have rights to create a partner invoice. |
INVALID_ORDER |
We cannot create partner invoices for some of your orders. |
INVALID_ORDER |
Some of your orders already have a partner invoice invoice. |
INVALID_ORDER |
The order is not approved. We cannot create a partner invoice. |
INVALID_ORDER |
Your orders must all have the same currency. They now have: |