What happens to purchase code when order is cancelled?

So far, don’t have any cancelled/refunded order (which is good, of course), so can’t really test how it works.

If I use Envato API’s function author/sale to get order information by submitting purchase code, what will happen when purchase is refunded (cancelled)? Will API return no data (such as a code never existed) or order information will still be returned, but it will be identified (how) as inactive?

When a sale is reversed or refunded, the purchase code is invalidated. The API will return an HTTP 404 error with this body:

{
  "error": 404,
  "description": "No sale belonging to the current user found with that code"
}

Cheers! :slight_smile:

1 Like

Thank you, that’s all I needed to know.