Reactivate a purchase
POST
/purchases/{id}/reactivate
const url = 'https://api.getdpd.com/v2/purchases/1/reactivate';const options = { method: 'POST', headers: { Authorization: 'Basic <credentials>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({buyer_email: 'hello@example.com', refulfill: 'true'})};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.getdpd.com/v2/purchases/1/reactivate \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data buyer_email=hello@example.com \ --data refulfill=trueDoes the same as reactivating a purchase in the DPD admin: emails the customer their purchase again. Only works on active purchases.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
Request Body
Section titled “Request Body”Media typeapplication/x-www-form-urlencoded
object
buyer_email
Send to this address instead, and change the purchase’s email address to it. Leave it off to use the address on the purchase.
string format: email
refulfill
Also send the purchase to its fulfillment service again.
boolean
Example generated
buyer_email=hello%40example.com&refulfill=trueResponses
Section titled “Responses”The purchase was reactivated.
Media typeapplication/json
object
status
string
Example
{ "status": "OK"}The username or API password is wrong.
Nothing found: the record doesn’t exist or isn’t yours, the list is empty, or the page is past the last one.
Media typeapplication/json
object
status
string
Example
{ "status": "NOTFOUND"}The purchase isn’t active, or buyer_email isn’t a valid address.
Media typeapplication/json
object
errors
object
key
additional properties
string
Example
{ "errors": { "status": "Purchase is not active" }}