A refund can be performed when :

  • the bookstore has the right to refund sales (a user permission needs to be enabled)

  • the referred sale is found on the platform

  • the file has not been download by the end user (i.e. the watermarked file or the .acsm licence file wasn't downloaded)

  • the refund amount matches the sale cost


Déclaration

Adress : /api/organisations/[organisation_id]/publications/[publication_id]/sales/cancel

Method : POST

Security : HTTP Basic


Parameters

organisation_id : (Mandatory)

bookstore ID


publication_id : (Mandatory)

publication ISBN


customer_id : (Mandatory)

the customer_id of the referred sale


transaction_id : (Mandatory)

the transaction_id of the referred sale


amount : (Mandatory)

the amount must match the "cost" parameter value of the original sale


reason : (Optional)

optional, the reason for the refund, which will be shown to the publisher


Responses

200 : OK

The refund has been successfully performed and a token is provided as a receipt.


400 : refund_unauthorized

The refund is unauthorized because it has already been fulfilled by the end user.


400 : already_refunded

The refund was already refunded.


400 : cost_mismatch

The amount mismatches the "cost" from the original sale.


401

User authentication failed or user can't perform refunds.


404

The referred sale wasn't found.