This document provides details on how to create, update, manage, and retrieve one-time or subscription-based products using the Dodo Payments API.
Action | Method | Endpoint |
---|---|---|
Create Product | POST | /products |
Update Product | PATCH | /products/{product_id} |
Upload Product Image | PUT | /products/{product_id}/images |
Retrieve Products | GET | /products |
Archive Product | POST | /products/{product_id}/archive |
Unarchive Product | POST | /products/{product_id}/unarchive |
POST
request to the /products
endpoint with details such as name, description, price, currency, and whether it is a recurring product.
For detailed request and response structure, refer to the Create Product API documentation.
PATCH
request to the /products/{product_id}
endpoint. You can update properties such as name, price, and description while keeping other details unchanged.
For the full list of updateable fields and response formats, refer to the Update Product API documentation.
GET
request to the /products
endpoint. This allows you to retrieve product details, including active and archived products.
For more details, refer to the Retrieve Products API documentation.
POST
request to the /products/{product_id}/archive
endpoint. This action hides the product but does not delete it permanently.
For more details, refer to the Archive Product API documentation.
POST
request to the /products/{product_id}/unarchive
endpoint. This will reactivate the product and make it available for use again.
For more details, refer to the Unarchive Product API documentation.
/products/{product_id}/images
endpoint, then use the provided URL to upload the image within 60 seconds.
For more details, refer to the Upload Product Image API documentation.
PUT
method. This ensures secure and temporary access to AWS S3 for uploading the image.
axios
, node-fetch
requests
, boto3
net/http
GuzzleHttp
rest-client
200 OK
status, indicating that the image has been stored successfully.
Authorization
header.product_id
in the update and image upload endpoints matches an existing product.recurring: true
and specify a billing_cycle
(daily
, weekly
, monthly
, yearly
).