Resend an invoice
Use the resendInvoice method via JSON-RPC API 6.0 to resend the shopper invoice of an order by email. By default, the invoice is sent to the shopper’s email address on file. You can also send it to a different recipient.
Request parameters
sessionID
Required (string)
Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.
refNo
Required (string) The reference number of an approved/paid order.
email
Optional (string)
The recipient of the invoice email, for this send only. 2Checkout does not save it as the contact email of the order or of your account. If you omit it, or send an empty string, the invoice is sent to the shopper’s email address on file.
Request sample
<?php
require ('PATH_TO_AUTH');
$refNo = 'YOUR_ORDER_REFERENCE';
$email = 'jonathan.smith@mail.com';
$jsonRpcRequest = array (
'method' => 'resendInvoice',
'params' => array($sessionID, $refNo, $email),
'id' => $i++,
'jsonrpc' => '2.0');
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));Response parameters
Response
Boolean
Returns true when the resend was queued.
Error codes
BAD_REQUEST
The email value is not a valid email address.
RESOURCE_NOT_FOUND
The order reference does not exist or does not belong to your account, or the order has no shopper invoice yet because the invoice is still being generated.
QUEUE_ERROR
The resend could not be queued. Try again later.
Last updated
Was this helpful?