For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create partner invoice

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.

Request parameters

Parameter
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.

Request sample

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication
require ('PATH_TO_SET_PARTNER'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/Partner/00Set_partner

$sales = array(
'ORDER_REFERENCE_1',
'ORDER_REFERENCE_2'
);

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'createProforma',
'params' => array($sessionID, $sales)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

Response parameters

Parameters
Type / Description

Proforma

Object A partner invoice object with the structure detailed below.

Proforma.Number

String Unique partner invoice identifier

Proforma.CreateDate

String Partner invoice creation date

Proforma.DueDate

String The date before which the partner needs to pay the invoice.

Proforma.Status

String

Partner invoice status. Possible values:

  • Unpaid

  • Overdue

  • Paid

  • Canceled

Proforma.Currency

String Partner invoice currency ISO code

Proforma.Total

String Total costs of all orders included in the partner invoice

Proforma.PaymentMethod

String Payment method used to pay for the partner invoice. NULL if the invoice was not paid.

Proforma.Orders

String / Array Order references array of strings. A partner invoice only groups approved orders with the same currency.

Proforma.BusinessModel

String

The business model governing the relationship between you and the partner company. Possible values:

  • RESELLER: payments made to Avangate as a master reseller

  • SERVICE_PROVIDER: direct payments to your accounts via wire transfer

Proforma.ProformaPDF

String Partner invoice PDF download link. Valid for 1 hour.

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:

Last updated

Was this helpful?