Difference between revisions of "Sample-localmarkeplace"

From Barion Documentation
Jump to navigation Jump to search
Line 69: Line 69:
 
         {
 
         {
 
             POSTransactionId: "fa-01-02",
 
             POSTransactionId: "fa-01-02",
             Payee: "jeweler@example.com",
+
             Payee: "secondfarmer@example.com",
 
             Total: 30,
 
             Total: 30,
            //Immediately after crediting €30 to [email protected], €3 will be sent to the marketplace.
 
 
             PayeeTransactions: [
 
             PayeeTransactions: [
 
                 {
 
                 {
 
                     POSTransactionId: "TR-01-02-01",
 
                     POSTransactionId: "TR-01-02-01",
 
                     Payee: "[email protected]",
 
                     Payee: "[email protected]",
                     Total: 30,
+
                     Total: 3,
 
                     Comment: "Marketplace commission: TR-01-02-01."
 
                     Comment: "Marketplace commission: TR-01-02-01."
 
                 },
 
                 },
 +
                {
 +
                    POSTransactionId: "TR-01-02-02",
 +
                    Payee: "[email protected]",
 +
                    Total: 3,
 +
                    Comment: "Local agent commission: TR-01-02-02."
 +
                },   
 
             ],
 
             ],
 
             Items: [
 
             Items: [
 
                 {
 
                 {
                     Name: "Necklace",
+
                     Name: "Old Amsterdam",
                     Description: "Hand made copper necklace with glass decor",
+
                     Description: "Hard cheese from the Netherlands",
 +
                    Quantity: 2,
 +
                    Unit: "pcs",
 +
                    UnitPrice: 10,
 +
                    ItemTotal: 20,
 +
                    SKU: ""
 +
                },
 +
                {
 +
                    Name: "Edam",
 +
                    Description: "Soft cheese from the Netherlands",
 
                     Quantity: 1,
 
                     Quantity: 1,
                     Unit: "db",
+
                     Unit: "pcs",
                     UnitPrice: 30,
+
                     UnitPrice: 10,
                     ItemTotal: 30,
+
                     ItemTotal: 10,
 
                     SKU: ""
 
                     SKU: ""
 
                 },
 
                 },

Revision as of 20:54, 4 September 2017

Local producers' marketplace - C2C sample

This example is the input of v2 /Payment/Start API call for an online marketplace, where customers can shop groceries from several local producers, delivered to a local marketplace managed by a local agent. The agent and the marketplace both receive a 10% commission from each farmer. The API call is initiated by the marketplace, as the facilitator.

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: 20,
            //Immediately after crediting €20 to [email protected], €2 will be sent to the marketplace and €2 will be sent to the local agent.
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-01-01",
                    Payee: "[email protected]",
                    Total: 2,
                    Comment: "Marketplace commission: TR-01-01-01."
                },
                {
                    POSTransactionId: "TR-01-01-02",
                    Payee: "[email protected]",
                    Total: 2,
                    Comment: "Local agent commission: TR-01-01-02."
                },     
            ],
            Items: [
                {
                    Name: "Carrots",
                    Description: "Organic carrots",
                    Quantity: 2,
                    Unit: "kg",
                    UnitPrice: 2,
                    ItemTotal: 4,
                    SKU: ""
                },
                {
                    Name: "Cabbages",
                    Description: "Cabbages",
                    Quantity: 2,
                    Unit: "kg",
                    UnitPrice: 2,
                    ItemTotal: 4,
                    SKU: ""
                },
                {
                    Name: "Artichokes",
                    Description: "Organic artichokes",
                    Quantity: 6,
                    Unit: "pcs",
                    UnitPrice: 2,
                    ItemTotal: 12,
                    SKU: ""
                },
            ]
        },
        {
            POSTransactionId: "fa-01-02",
            Payee: "[email protected]",
            Total: 30,
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-02-01",
                    Payee: "[email protected]",
                    Total: 3,
                    Comment: "Marketplace commission: TR-01-02-01."
                },
                {
                    POSTransactionId: "TR-01-02-02",
                    Payee: "[email protected]",
                    Total: 3,
                    Comment: "Local agent commission: TR-01-02-02."
                },     
            ],
            Items: [
                {
                    Name: "Old Amsterdam",
                    Description: "Hard cheese from the Netherlands",
                    Quantity: 2,
                    Unit: "pcs",
                    UnitPrice: 10,
                    ItemTotal: 20,
                    SKU: ""
                },
                {
                    Name: "Edam",
                    Description: "Soft cheese from the Netherlands",
                    Quantity: 1,
                    Unit: "pcs",
                    UnitPrice: 10,
                    ItemTotal: 10,
                    SKU: ""
                },
            ]
        }

    ]
}

More Code Samples