Sample-creativemarkeplace

From Barion Documentation
Revision as of 13:11, 20 February 2019 by Botza (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Creative marketplace - C2C sample

This example is the input of v2 /Payment/Start API call for an online marketplace, where customers can shop creative crafts (beer mug and hand made jewelry) from different vendors and the marketplace receives a 10% commission from each vendor. The API call is initiated by the marketplace, as the facilitator. Read more about C2C Payments and review transaction and API mappings.

API Input JSON

{
    POSKey: "999FFDDA-04FF-333F-CCCC-345FCB555FFC",
    PaymentType: "Immediate",             
    PaymentWindow: "00:30:00",
    PaymentRequestId: "fa-01",
    PayerHint: "[email protected]",
    Locale: "en-US",
    Currency: "EUR",
    FundingSources: [
        "All"
    ],
    Transactions: [
        {
            POSTransactionId: "fa-01-01",
            Payee: "[email protected]",
            Total: 50,
            //Immediately after crediting €50 to [email protected], €5 will be sent to the marketplace.
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-01-01",
                    Payee: "[email protected]",
                    Total: 5,
                    Comment: "Marketplace commission: TR-01-01-01."
                },
            ],
            Items: [
                {
                    Name: "Beer mug",
                    Description: "Artisan beer mug, 1L, pottery ",
                    Quantity: 1,
                    Unit: "db",
                    UnitPrice: 50,
                    ItemTotal: 50,
                    SKU: ""
                },
            ]
        },
        {
            POSTransactionId: "fa-01-02",
            Payee: "[email protected]",
            Total: 30,
            //Immediately after crediting €30 to [email protected], €3 will be sent to the marketplace.
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-02-01",
                    Payee: "[email protected]",
                    Total: 3,
                    Comment: "Marketplace commission: TR-01-02-01."
                },
            ],
            Items: [
                {
                    Name: "Necklace",
                    Description: "Hand made copper necklace with glass decor",
                    Quantity: 1,
                    Unit: "db",
                    UnitPrice: 30,
                    ItemTotal: 30,
                    SKU: ""
                },
            ]
        }

    ]
}


More Code Samples