Collaborator Products

This set of APIs is all about linking products to collaborators.

Note this API is only for 'advance connected products' aka product groups (as seen in the UI). Any products connected manually in the UI in the basic section will not be shown here. But anything connected in the product groups section will be visible in these APIs.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the collaborator.

  • Name
    type
    Type
    string
    Description

    Type of link to products, valid options are:

    • products.all
    • products.tag
    • products.vendor
    • products
  • Name
    type_values
    Type
    array
    Description
  • Name
    condition
    Type
    string
    Description
  • Name
    condition_values
    Type
    array
    Description
  • Name
    condition
    Type
    string
    Description
  • Name
    amount
    Type
    int
    Description

    Flat amount for the collaborator

  • Name
    shipping_amount
    Type
    int
    Description
  • Name
    percent
    Type
    decimal(3,2)
    Description

    Percentage for the collaborator

  • Name
    shipping_percent
    Type
    decimal(3,2)
    Description
  • Name
    shipping_percent
    Type
    int
    Description
  • Name
    created_at
    Type
    int
    Description

    Unix timestamp of when this was created

  • Name
    updated_at
    Type
    int
    Description

    Unix timestamp of when this was updated

  • Name
    products_count
    Type
    int
    Description

    Count of all the products connected to this group

  • Name
    products
    Type
    collaborator-products
    Description

    Paginated list of products connected to the group.

  • Name
    collaborator
    Type
    collaborator
    Description
    Collaborator object

GET/v1/collaborators/:id

List all product groups

This endpoint allows you to view all product groups for a collaborator.

Request

GET
/v1/collaborators/:id/products
curl -X GET https://collabpay.app/api/v1/collaborators/edfe9e9c-fc3c-4384-934e-cdee1ac91607/products \
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H "Authorization: Bearer {token}"

Response

{
    "data": [
        {
            "id": "dc379a39-1e3a-427a-b541-837910ef7bf8",
            "type": "product.tag",
            "type_values": [
                "ABC"
            ],
            "condition": null,
            "condition_values": null,
            "amount": null,
            "shipping_amount": null,
            "percent": "10.00",
            "shipping_percent": null,
            "created_at": 1729161441,
            "updated_at": 1729161441,
            "products_count": 0,
            "collaborator": {
                "id": "96381884-08a5-4fb2-b045-3b868da59f99",
                "currency": "USD",
                "payout_measurement": "month",
                "payout_frequency": 1,
                "payout_threshold": 0,
                "should_pay_automatically": true,
                "payout_holding_days": null,
                "notes": null,
                "permissions": {
                    "see_product_price": false,
                    "see_product_quantity": false,
                    "see_product_discount": false,
                    "see_product_tax": false,
                    "see_customer_email": false,
                    "see_customer_name": false,
                    "see_order_status": false,
                    "see_order_payment_gateway": false,
                    "see_order_shipping_address": false,
                    "see_order_billing_address": false,
                    "see_product_cost": false,
                    "see_product_stock": false
                },
                "account": {
                    "name": "TEST USER",
                    "paypal_email": null,
                    "is_managed": true
                }
            }
        },
        {
            "id": "945fd8ad-85c8-4458-85e9-09ac3454fb39",
            "type": "product.tag",
            "type_values": [
                "ABC"
            ],
            "condition": null,
            "condition_values": null,
            "amount": null,
            "shipping_amount": null,
            "percent": "10.00",
            "shipping_percent": null,
            "created_at": 1729161519,
            "updated_at": 1729161519,
            "products_count": 0,
            "collaborator": {
                "id": "96381884-08a5-4fb2-b045-3b868da59f99",
                "currency": "USD",
                "payout_measurement": "month",
                "payout_frequency": 1,
                "payout_threshold": 0,
                "should_pay_automatically": true,
                "payout_holding_days": null,
                "notes": null,
                "permissions": {
                    "see_product_price": false,
                    "see_product_quantity": false,
                    "see_product_discount": false,
                    "see_product_tax": false,
                    "see_customer_email": false,
                    "see_customer_name": false,
                    "see_order_status": false,
                    "see_order_payment_gateway": false,
                    "see_order_shipping_address": false,
                    "see_order_billing_address": false,
                    "see_product_cost": false,
                    "see_product_stock": false
                },
                "account": {
                    "name": "TEST USER",
                    "paypal_email": null,
                    "is_managed": true
                }
            }
        },
        {
            "id": "1ae79109-f2c0-42b8-aac5-717bdc7d6d0c",
            "type": "product.tag",
            "type_values": [
                "ABC"
            ],
            "condition": null,
            "condition_values": null,
            "amount": null,
            "shipping_amount": null,
            "percent": "10.00",
            "shipping_percent": null,
            "created_at": 1729161714,
            "updated_at": 1729161714,
            "products_count": 0,
            "collaborator": {
                "id": "96381884-08a5-4fb2-b045-3b868da59f99",
                "currency": "USD",
                "payout_measurement": "month",
                "payout_frequency": 1,
                "payout_threshold": 0,
                "should_pay_automatically": true,
                "payout_holding_days": null,
                "notes": null,
                "permissions": {
                    "see_product_price": false,
                    "see_product_quantity": false,
                    "see_product_discount": false,
                    "see_product_tax": false,
                    "see_customer_email": false,
                    "see_customer_name": false,
                    "see_order_status": false,
                    "see_order_payment_gateway": false,
                    "see_order_shipping_address": false,
                    "see_order_billing_address": false,
                    "see_product_cost": false,
                    "see_product_stock": false
                },
                "account": {
                    "name": "TEST USER",
                    "paypal_email": null,
                    "is_managed": true
                }
            }
        }
    ]
}

POST/v1/collaborators/:id/products

Create a product group

This endpoint allows to create a product group for a collaborator.

Create a product group.

Note once created, products are linked in the background; not all products will be linked right away.


Required attributes

  • Name
    items
    Type
    array
    Description

    This is the items for itemType.

    • products.all
      • This does not need any value, all values will be ignored as this is for all products.
    • products.tag
      • array of product vendors for this group, e.g. ["Bobs products", "discounts"]
    • products.vendor
      • array of product vendors for this group, e.g. ["roger", "steve"]
    • products
      • array product ids for this group ["aeda9be5-c9e1-40ec-8c76-be098262b7f6"]
  • Name
    splitConditions
    Type
    array
    Description

    This the array of values for the splitConditionType.

    • county.code
      • This is the two digit country code, e.g. UK, US, AU
  • Name
    type_modifier
    Type
    array
    Description

    Default WITH

    Options: WITH or NOT

  • Name
    itemType
    Type
    string
    Description

    Type of link to products, valid options are:

    • products.all
    • products.tag
    • products.vendor
    • products
  • Name
    splitConditionType
    Type
    string | null
    Description

    Any condition when splitting with the collaborator.

    • null
      • No condition
    • order.tag
      • Only split when this order tag is present
    • customer.tag
      • Only split when this customer tag is present
    • discount.code
      • Only split when this discount code is used
    • country.code
      • Only split when the billing address is in this country
    • referer
      • Only split when this referer is used
  • Name
    condition_modifier
    Type
    string
    Description

    This allows you to set the condition to be WITH or NOT WITH. e.g only splitting when country is AU, or only splitting with country is NOT AU.

    Options: WITH or NOT

  • Name
    type
    Type
    string
    Description

    percentage or flat

  • Name
    percentage
    Type
    decimal(3,2)
    Description

    Decimal percentage to 2DP, required when type = percentage

  • Name
    amount
    Type
    int
    Description

    Flat amount to pay the collaborator in cents (or lowest currency format), required when type = flat

  • Name
    deduct_for_other_splits
    Type
    bool
    Description

    Only used when splitConditionType = referer

    This will deduct this as a cost for other collaborators, see more here.

Request

POST
/v1/collaborators/:id/products
curl -X PUT https://collabpay.app/api/v1/collaborators/edfe9e9c-fc3c-4384-934e-cdee1ac91607/products \
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H "Authorization: Bearer {token}"
-d {
    "items": ["ABC"],
    "splitConditions": [],
    "type_modifier": "WITH",
    "itemType": "product.tag",
    "splitConditionType": null,
    "condition_modifier": null,
    "type": "percentage",
    "percent": 10,
}

Response

{
    "data": {
        "id": "361713b8-4dd0-4197-b881-ad56ed228956",
        "type": "product.tag",
        "type_values": [
            "ABC"
        ],
        "condition": null,
        "condition_values": null,
        "amount": null,
        "shipping_amount": null,
        "percent": 10,
        "shipping_percent": null,
        "created_at": 1729160534,
        "updated_at": 1729160534,
        "collaborator": {
            "id": "96381884-08a5-4fb2-b045-3b868da59f99",
            "currency": "USD",
            "payout_measurement": "month",
            "payout_frequency": 1,
            "payout_threshold": 0,
            "should_pay_automatically": true,
            "payout_holding_days": null,
            "notes": null,
            "permissions": {
                "see_product_price": false,
                "see_product_quantity": false,
                "see_product_discount": false,
                "see_product_tax": false,
                "see_customer_email": false,
                "see_customer_name": false,
                "see_order_status": false,
                "see_order_payment_gateway": false,
                "see_order_shipping_address": false,
                "see_order_billing_address": false,
                "see_product_cost": false,
                "see_product_stock": false
            },
            "account": {
                "name": "TEST USER",
                "paypal_email": null,
                "is_managed": true
            }
        },
        "products": {
            "data": [],
            "meta": {
                "current_page": 1,
                "from": null,
                "last_page": 1,
                "path": "https://collabpay.app/api/v1/collaborators/96381884-08a5-4fb2-b045-3b868da59f99/products/361713b8-4dd0-4197-b881-ad56ed228956",
                "per_page": 15,
                "to": null,
                "total": 0
            }
        }
    }
}

PUT/v1/collaborators/:id/products/:id

Update a product group

This endpoint allows to update the product group for a collaborator.

See create for the payload attributes.

Request

PUT
/v1/collaborators/:id/products/:id
curl -X PUT https://collabpay.app/api/v1/collaborators/96381884-08a5-4fb2-b045-3b868da59f99/products/361713b8-4dd0-4197-b881-ad56ed228956 \
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H "Authorization: Bearer {token}"
-d {
    "items": ["ABC", "DEF"],
    "splitConditions": [],
    "type_modifier": "WITH",
    "itemType": "product.tag",
    "splitConditionType": null,
    "condition_modifier": null,
    "type": "percentage",
    "percent": 20,
}

Response

{
    "data": {
        "id": "a85bca66-5065-4fba-adb0-4d97e52676d2",
        "type": "product.tag",
        "type_values": [
            "ABC",
            "DEF"
        ],
        "condition": null,
        "condition_values": null,
        "amount": null,
        "shipping_amount": null,
        "percent": 20,
        "shipping_percent": null,
        "created_at": 1729161199,
        "updated_at": 1729161199,
        "collaborator": {
            "id": "96381884-08a5-4fb2-b045-3b868da59f99",
            "currency": "USD",
            "payout_measurement": "month",
            "payout_frequency": 1,
            "payout_threshold": 0,
            "should_pay_automatically": true,
            "payout_holding_days": null,
            "notes": null,
            "permissions": {
                "see_product_price": false,
                "see_product_quantity": false,
                "see_product_discount": false,
                "see_product_tax": false,
                "see_customer_email": false,
                "see_customer_name": false,
                "see_order_status": false,
                "see_order_payment_gateway": false,
                "see_order_shipping_address": false,
                "see_order_billing_address": false,
                "see_product_cost": false,
                "see_product_stock": false
            },
            "account": {
                "name": "TEST USER",
                "paypal_email": null,
                "is_managed": true
            }
        },
        "products": {
            "data": [],
            "meta": {
                "current_page": 1,
                "from": null,
                "last_page": 1,
                "path": "https://collabpay.app/api/v1/collaborators/96381884-08a5-4fb2-b045-3b868da59f99/products/361713b8-4dd0-4197-b881-ad56ed228956",
                "per_page": 15,
                "to": null,
                "total": 0
            }
        }
    }
}

GET/v1/collaborators/:id/products/:id

View a product group

This endpoint allows you to view product group for a collaborator.

Request

GET
/v1/collaborators/:id/products/:id
curl -X GET https://collabpay.app/api/v1/collaborators/96381884-08a5-4fb2-b045-3b868da59f99/products/361713b8-4dd0-4197-b881-ad56ed228956 \
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H "Authorization: Bearer {token}"

Response

{
    "data": {
        "id": "361713b8-4dd0-4197-b881-ad56ed228956",
        "type": "product.tag",
        "type_values": [
            "ABC"
        ],
        "condition": null,
        "condition_values": null,
        "amount": null,
        "shipping_amount": null,
        "percent": "10.00",
        "shipping_percent": null,
        "created_at": 1729160534,
        "updated_at": 1729160534,
        "collaborator": {
            "id": "96381884-08a5-4fb2-b045-3b868da59f99",
            "currency": "USD",
            "payout_measurement": "month",
            "payout_frequency": 1,
            "payout_threshold": 0,
            "should_pay_automatically": true,
            "payout_holding_days": null,
            "notes": null,
            "permissions": {
                "see_product_price": false,
                "see_product_quantity": false,
                "see_product_discount": false,
                "see_product_tax": false,
                "see_customer_email": false,
                "see_customer_name": false,
                "see_order_status": false,
                "see_order_payment_gateway": false,
                "see_order_shipping_address": false,
                "see_order_billing_address": false,
                "see_product_cost": false,
                "see_product_stock": false
            },
            "account": {
                "name": "TEST USER",
                "paypal_email": null,
                "is_managed": true
            }
        },
        "products": {
            "data": [],
            "meta": {
                "current_page": 1,
                "from": null,
                "last_page": 1,
                "path": "https://collabpay.app/api/v1/collaborators/96381884-08a5-4fb2-b045-3b868da59f99/products/361713b8-4dd0-4197-b881-ad56ed228956",
                "per_page": 15,
                "to": null,
                "total": 0
            }
        }
    }
}

DELETE/v1/collaborators/:id/products/:id

Delete a product group

This endpoint allows you to delete product groups from your collaborator.

Request

DELETE
/v1/collaborators/:id/products/:id
curl -X DELETE https://collabpay.app/api/v1/collaborators/edfe9e9c-fc3c-4384-934e-cdee1ac91607/products/cb37475c-bdd4-46d9-8ece-390331740b2f \
  -H 'Content-Type: application/json'
  -H 'Accept: application/json'
  -H "Authorization: Bearer {token}"