Regenerate Invoice
A merchant can perform following Invoice operations using our REST API.
- Regenerate an invoice
How to Regenerate Invoice?
The merchantInvoiceId
will be referred and a POST request will be send over HTTPS to the invoiceServices/REST/v1/regenerate
endpoint.
In our API Specifications you can find a full list of parameters that can be sent in the initial request.
Sample Request
curl https://tp.sepa-cyber.com/invoiceServices/REST/v1/regenerate \ curl --header "AuthToken:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjb25tZXJjaGFudDEiLCJyb2xlIjoibWVyY2hhbnQiLCJpc3MiOiJQWiIsImV4cCI6MTUwMTE0NjY0MX0.TFmGGKDUgkktmZQvrUTeox1buH1J6lgBVE3Mcy8OVjA" -d "invoiceId=1746" \ -d "authentication.memberId=11344" \ -d "authentication.checksum=ca500ed0627866d384e0f786feba0653" \ -d "merchantRedirectUrl=www.merchantRedirectUrl.com" \ -d "merchantInvoiceId=Invoice01" \ -d "invoiceExpirationPeriod=10"
Sample Response
{ "memberId": "11344", "statusInvoiceResult": { "code": "00013", "description": "Invoice regenerated successfully" }, "invoiceDetails": { "amount": "50.00", "currency": "USD", "invoiceExpirationPeriod": "10", "createdDate": "2017-02-06", "createdTime": " 15:45:38.", "merchantInvoiceId": "Invoice01", "customerEmail": "john.doe@abc.com", "merchantOrderDescription": "Invoice for Goods and Services", "systemInvoiceId": "1760", "transactionUrl": "https://tp.sepa-cyber.com/transaction/PayInvoice?inv=2627&ct=Csico6wVzOYMJcIx" } }
Hashing Rule
SEPA Cyber is supporting MD5 Cryptographic Hash for the authenticity of payment request send to the server.
Below is the description of fields use for generating checksum.
- invoiceId <Unique invoice ID generated through SEPA Cyber>
- memberId <Merchant ID as shared by SEPA Cyber >
- secureKey <Secure Key that can be generated through SEPA Cyber's dashboard>
- merchantRedirectUrl <This URL will receive the result of an asynchronous payment. It must be sent URL encoded>
How to generate Checksum ?
Checksum has to be calculated with following combination and need to be send along with the authentication parameters in each server-to-server request:
Regenerate Invoice:
<invoiceId>|<memberId>|<secureKey>|<merchantRedirectUrl>
Sample Code
import java.security.MessageDigest def generateMD5Checksum() { String values= "3442|11344|JobfvPiEO4m0FHIFCmcaeIqiUlyXU0GC|https://merchantRedirectUrl.com"; MessageDigest digest = MessageDigest.getInstance(MD5) digest.update(values.bytes); new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0') }