Apply a deposit paid to an order - using Create Payment Link api

Our customers pay a $1000 deposit to reserve a spot in our events. When the event takes place we need to “apply” their deposit (we know what they’ve paid) to their order. For example, to attend the event, it may cost the customer $4,500 (depending on hotel room, etc) but we only want to charge them $3,500 (because they’ve paid a $1,000 deposit).

There might be 9 items in the order to we can’t just discount the price of one item, we need a way to just apply a negative amount to the entire order.

Thanks,

With orders applying an already paid for order to another order isn’t currently available. You could add the deposited amount as a line item and fully discount that item. The only problem with that is that it would throw off the reporting of gross and net sales.

If you want to reference a previously paid for order in a new order you can pass in the order_id as metadata or as a note. That way it will tie back to the original order. Also you can make sure you pass in a customer_id for every order created. Then when calling SearchOrders you can filter on the customer_id to pull all orders for that customer. :slightly_smiling_face:

Thanks for the reply - I don’t need it to reference the previous order, I just need to subtract $1,000 from the new order (which will have up to 7 different items in it).

So the real question is: how do I apply a -$1,000 to the order?

I’ve tried creating an item with a negative price (doesn’t work).

I’ve tried creating a discount of $1,000 for an item that cost $0 (doesn’t work).

Any other creative ideas out there? Applying a deposit should be an easy thing and is core to our business.

Thanks.

Right, a negative amount isn’t possible with orders from the Orders API. You’ll need to apply the discount to the whole order. Or you can have a $1000 item and apply the discount to that so it equals $0. :slightly_smiling_face:

But if I add $1000 item and discount it fully to $0 that leaves the amount the same. I need a $1000 less the total amount (because they’ve already paid a deposit).

I like the idea of applying $1000 discount to the entire order - can you point me to documentation on how to achieve that? I’ve tried everything o can think of and can’t get it to work.

This would be a dealbreaker for us as that’s how we conduct our business - pay a deposit to reserve a spot in our event, and then have the deposit applied when you pay the balance.

Thanks again for your help!

I think there’s a bit of confusion. The line item will show the cost of $1000 but with the discount the amount due will be $0. The order will still contain the $1000 for that item as well as having the amounts of the other items in the total.

Also orders can be scoped to item or the entire order. Here is an example order:

{
    "order": {
      "location_id": "{{location_id}}",
      "customer_id": "{{customer_id}}",
      "line_items": [
        {
          "quantity": "1",
          "name": "deposit",
          "base_price_money": {
            "amount": 100000,
            "currency": "USD"
          },
          "applied_discounts": [
            {
              "discount_uid": "12345"
            }
          ]
        },
        {
          "quantity": "1",
          "name": "event",
          "base_price_money": {
            "amount": 400000,
            "currency": "USD"
          }
        }
      ],
      "discounts": [
        {
          "name": "deposit discount",
          "percentage": "100",
          "scope": "LINE_ITEM",
          "type": "FIXED_PERCENTAGE",
          "uid": "12345"
        }
      ]
    }
  }

That will produce the following order:

{
    "order": {
        "id": "7A659DdcCaRq2CwWb5pdkaPBUcMZY",
        "location_id": "3Z4V4WHQK64X9",
        "line_items": [
            {
                "uid": "pxGTScW08Yqm0RjSLGjfxB",
                "quantity": "1",
                "name": "deposit",
                "base_price_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "applied_discounts": [
                    {
                        "uid": "0ZdrFFd0x0A6Ck0i5AQEc",
                        "discount_uid": "12345",
                        "applied_money": {
                            "amount": 100000,
                            "currency": "USD"
                        }
                    }
                ],
                "item_type": "ITEM"
            },
            {
                "uid": "5BveGBghLnr2Euh6GriVf",
                "quantity": "1",
                "name": "event",
                "base_price_money": {
                    "amount": 400000,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 400000,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 400000,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 400000,
                    "currency": "USD"
                },
                "item_type": "ITEM"
            }
        ],
        "discounts": [
            {
                "uid": "12345",
                "name": "deposit discount",
                "percentage": "100",
                "applied_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "type": "FIXED_PERCENTAGE",
                "scope": "LINE_ITEM"
            }
        ],
        "created_at": "2023-03-22T00:17:23.665Z",
        "updated_at": "2023-03-22T00:17:23.665Z",
        "state": "OPEN",
        "version": 1,
        "total_tax_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_discount_money": {
            "amount": 100000,
            "currency": "USD"
        },
        "total_tip_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_money": {
            "amount": 400000,
            "currency": "USD"
        },
        "total_service_charge_money": {
            "amount": 0,
            "currency": "USD"
        },
        "net_amounts": {
            "total_money": {
                "amount": 400000,
                "currency": "USD"
            },
            "tax_money": {
                "amount": 0,
                "currency": "USD"
            },
            "discount_money": {
                "amount": 100000,
                "currency": "USD"
            },
            "tip_money": {
                "amount": 0,
                "currency": "USD"
            },
            "service_charge_money": {
                "amount": 0,
                "currency": "USD"
            }
        },
        "source": {
            "name": "Boats"
        },
        "customer_id": "W3C3EZFTZH18BFXX4M15TXNPQ0",
        "net_amount_due_money": {
            "amount": 400000,
            "currency": "USD"
        }
    }
}

:slightly_smiling_face:

Maybe I don’t understand - But the net_amount_due_money in your example is still $4,000. I need it to be $3,000.

It looks like you are making it $5,000 but discounting it back to $4,000…by adding $1,000 and then discounting it $1,000.

How can I give a blanket discount of $1,000 to the order yo get it to $3,000?

Sorry if I’m missing your guidance, I really do appreciate your help.

In the most simple terms: how can I discount an entire order $1,000? The order will have several items.

That would be this:

{
    "order": {
      "location_id": "{{location_id}}",
      "customer_id": "{{customer_id}}",
      "line_items": [
        {
          "quantity": "1",
          "name": "deposit",
          "base_price_money": {
            "amount": 100000,
            "currency": "USD"
          }
        },
        {
          "quantity": "1",
          "name": "event",
          "base_price_money": {
            "currency": "USD",
            "amount": 300000
          }
        }
      ],
      "discounts": [
        {
          "name": "deposit discount",
          "scope": "ORDER",
          "type": "FIXED_AMOUNT",
          "amount_money": {
            "amount": 100000,
            "currency": "USD"
          }
        }
      ]
    }
  }

Which will give you this order:

{
    "order": {
        "id": "HCiC9uydiy79lnB4wHFIWqgIr66YY",
        "location_id": "3Z4V4WHQK64X9",
        "line_items": [
            {
                "uid": "BZbDkOX3KJ2BeRBcTFt1LD",
                "quantity": "1",
                "name": "deposit",
                "base_price_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 25000,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 75000,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "applied_discounts": [
                    {
                        "uid": "vm2cUcoL82AYiIEvpfYnfB",
                        "discount_uid": "Rh6xOcD7RZeV6PMuIFh3v",
                        "applied_money": {
                            "amount": 25000,
                            "currency": "USD"
                        }
                    }
                ],
                "item_type": "ITEM"
            },
            {
                "uid": "HF6znc9b9XIrLfHBX9MuZC",
                "quantity": "1",
                "name": "event",
                "base_price_money": {
                    "amount": 300000,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 300000,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 75000,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 225000,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 300000,
                    "currency": "USD"
                },
                "applied_discounts": [
                    {
                        "uid": "uBAx5kZRyqzNFt0E57gH9B",
                        "discount_uid": "Rh6xOcD7RZeV6PMuIFh3v",
                        "applied_money": {
                            "amount": 75000,
                            "currency": "USD"
                        }
                    }
                ],
                "item_type": "ITEM"
            }
        ],
        "discounts": [
            {
                "uid": "Rh6xOcD7RZeV6PMuIFh3v",
                "name": "deposit discount",
                "amount_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "applied_money": {
                    "amount": 100000,
                    "currency": "USD"
                },
                "type": "FIXED_AMOUNT",
                "scope": "ORDER"
            }
        ],
        "created_at": "2023-03-22T01:18:51.747Z",
        "updated_at": "2023-03-22T01:18:51.747Z",
        "state": "OPEN",
        "version": 1,
        "total_tax_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_discount_money": {
            "amount": 100000,
            "currency": "USD"
        },
        "total_tip_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_money": {
            "amount": 300000,
            "currency": "USD"
        },
        "total_service_charge_money": {
            "amount": 0,
            "currency": "USD"
        },
        "net_amounts": {
            "total_money": {
                "amount": 300000,
                "currency": "USD"
            },
            "tax_money": {
                "amount": 0,
                "currency": "USD"
            },
            "discount_money": {
                "amount": 100000,
                "currency": "USD"
            },
            "tip_money": {
                "amount": 0,
                "currency": "USD"
            },
            "service_charge_money": {
                "amount": 0,
                "currency": "USD"
            }
        },
        "source": {
            "name": "Boats"
        },
        "customer_id": "W3C3EZFTZH18BFXX4M15TXNPQ0",
        "net_amount_due_money": {
            "amount": 300000,
            "currency": "USD"
        }
    }
}

Also feel free to build and create orders with our API Explorer. :slightly_smiling_face: