The Coupon Code object
Attributes
Unique identifier for the object.
ISO 8601 timestamp of when the object was created.
ISO 8601 timestamp of when the object was last updated.
Default: 0
Default: false
{
"id": "coupon-code_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"coupon_name": "coupon_name_example",
"coupon_type": "coupon_type_example",
"customer": "customer_example",
"coupon_code": "coupon_code_example",
"pricing_rule": "pricing_rule_example",
"valid_from": "valid_from_example",
"valid_upto": "valid_upto_example",
"maximum_use": 0,
"used": 0,
"description": "description_example",
"from_external_ecomm_platform": false
} /api/accounts/coupon-code/{id} Retrieve a coupon code
Retrieves the details of an existing coupon code. Supply the unique coupon code ID that was returned from a previous request.
Path parameters
The identifier of the coupon code to retrieve.
Returns
Returns the coupon code object if a valid identifier was provided.
curl https://api.overplane.dev/api/accounts/coupon-code/coupon-code_abc123 \
-H "Authorization: Bearer sk_test_..." {
"id": "coupon-code_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"coupon_name": "coupon_name_example",
"coupon_type": "coupon_type_example",
"customer": "customer_example",
"coupon_code": "coupon_code_example",
"pricing_rule": "pricing_rule_example",
"valid_from": "valid_from_example",
"valid_upto": "valid_upto_example",
"maximum_use": 0,
"used": 0,
"description": "description_example",
"from_external_ecomm_platform": false
} /api/accounts/coupon-code List all coupon codes
Returns a list of coupon codes. The results are sorted by creation date, with the most recently created appearing first.
Query parameters
Maximum number of objects to return. Default: 20.
Number of objects to skip for pagination. Default: 0.
Returns
A paginated list of coupon code objects.
curl https://api.overplane.dev/api/accounts/coupon-code \
-H "Authorization: Bearer sk_test_..." {
"data": [
{
"id": "coupon-code_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"coupon_name": "coupon_name_example",
"coupon_type": "coupon_type_example",
"customer": "customer_example",
"coupon_code": "coupon_code_example",
"pricing_rule": "pricing_rule_example",
"valid_from": "valid_from_example",
"valid_upto": "valid_upto_example",
"maximum_use": 0,
"used": 0,
"description": "description_example",
"from_external_ecomm_platform": false
}
],
"has_more": false,
"total": 1
} /api/accounts/coupon-code Create a coupon code
Creates a new coupon code object.
Body parameters
Default: 0
Default: false
Returns
Returns the newly created coupon code object if the call succeeded.
curl https://api.overplane.dev/api/accounts/coupon-code \
-H "Authorization: Bearer sk_test_..." \
-X POST \
-H "Content-Type: application/json" \
-d '{"coupon_name":"coupon_name_example","coupon_type":"coupon_type_example"}' {
"id": "coupon-code_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"coupon_name": "coupon_name_example",
"coupon_type": "coupon_type_example",
"customer": "customer_example",
"coupon_code": "coupon_code_example",
"pricing_rule": "pricing_rule_example",
"valid_from": "valid_from_example",
"valid_upto": "valid_upto_example",
"maximum_use": 0,
"used": 0,
"description": "description_example",
"from_external_ecomm_platform": false
} /api/accounts/coupon-code/{id} Update a coupon code
Updates the specified coupon code by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Path parameters
The identifier of the coupon code to update.
Body parameters
Default: 0
Default: false
Returns
Returns the updated coupon code object.
curl https://api.overplane.dev/api/accounts/coupon-code/coupon-code_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"coupon_name":"coupon_name_example","coupon_type":"coupon_type_example"}' {
"id": "coupon-code_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"coupon_name": "coupon_name_example",
"coupon_type": "coupon_type_example",
"customer": "customer_example",
"coupon_code": "coupon_code_example",
"pricing_rule": "pricing_rule_example",
"valid_from": "valid_from_example",
"valid_upto": "valid_upto_example",
"maximum_use": 0,
"used": 0,
"description": "description_example",
"from_external_ecomm_platform": false
} /api/accounts/coupon-code/{id} Delete a coupon code
Permanently deletes a coupon code. This cannot be undone.
Path parameters
The identifier of the coupon code to delete.
Returns
Returns a confirmation that the coupon code has been deleted.
curl https://api.overplane.dev/api/accounts/coupon-code/coupon-code_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X DELETE {
"id": "coupon-code_abc123",
"deleted": true
}