The Coupon Code object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

coupon_name string required
coupon_type string required
customer string
coupon_code string
pricing_rule string
valid_from string
valid_upto string
maximum_use integer
used integer

Default: 0

description string
from_external_ecomm_platform boolean

Default: false

The Coupon Code object
{
  "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
}
GET /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

id string required

The identifier of the coupon code to retrieve.

Returns

Returns the coupon code object if a valid identifier was provided.

GET /api/accounts/coupon-code/{id}
curl https://api.overplane.dev/api/accounts/coupon-code/coupon-code_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "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
}
GET /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

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of coupon code objects.

GET /api/accounts/coupon-code
curl https://api.overplane.dev/api/accounts/coupon-code \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "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
}
POST /api/accounts/coupon-code

Create a coupon code

Creates a new coupon code object.

Body parameters

coupon_name string required
coupon_type string required
customer string
coupon_code string
pricing_rule string
valid_from string
valid_upto string
maximum_use integer
used integer

Default: 0

description string
from_external_ecomm_platform boolean

Default: false

Returns

Returns the newly created coupon code object if the call succeeded.

POST /api/accounts/coupon-code
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"}'
Response
{
  "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
}
PATCH /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

id string required

The identifier of the coupon code to update.

Body parameters

coupon_name string
coupon_type string
customer string
coupon_code string
pricing_rule string
valid_from string
valid_upto string
maximum_use integer
used integer

Default: 0

description string
from_external_ecomm_platform boolean

Default: false

Returns

Returns the updated coupon code object.

PATCH /api/accounts/coupon-code/{id}
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"}'
Response
{
  "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
}
DELETE /api/accounts/coupon-code/{id}

Delete a coupon code

Permanently deletes a coupon code. This cannot be undone.

Path parameters

id string required

The identifier of the coupon code to delete.

Returns

Returns a confirmation that the coupon code has been deleted.

DELETE /api/accounts/coupon-code/{id}
curl https://api.overplane.dev/api/accounts/coupon-code/coupon-code_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "coupon-code_abc123",
  "deleted": true
}