via API

DEVELOPER GUIDE

Make a Payment via API

This article will walk you through the steps to make a payment via Zepto API.

1

Create a Contact

Create the payment contact before initiating the transaction.

POST /contacts/anyone
2

Make a Payment

Submit the payment request and define the payment channel strategy.

POST /payments
3

Receive Webhook Updates

Track the payment lifecycle asynchronously through webhook events.

Event-driven flow

Choose your channel

Select the channel strategy that best fits your payment experience and fallback requirements.

Direct Entry only ["direct_entry"]

The transaction will only be processed using the DE channel. If the payment fails via DE, the transaction will fail.

NPP only ["new_payments_platform"]

The transaction will only be processed using the NPP channel. If the payment fails via NPP, the transaction will fail.

Float Account note

To make real-time payments from a Float Account enabled for NPP, set the your_bank_account_id field in the payment request to the ID of your NPP-enabled Float Account.

Step 1 - Create a Contact

Endpoint: POST /contacts/anyone

{
  "name": "Hunter Thompson",
  "email": "[email protected]",
  "branch_code": "123456",
  "account_number": "13048322",
  ... other parameters available, see API docs
}
{
  "data": {
    "id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
    "name": "Hunter Thompson",
    "email": "[email protected]",
    "type": "anyone",
    "metadata": {
      "custom_key": "Custom string",
      "another_custom_key": "Maybe a URL"
    },
    "bank_account": {
      "id": "55afddde-4296-4daf-8e49-7ba481ef9608",
      "account_number": "13048322",
      "branch_code": "123456",
      "bank_name": "National Australia Bank",
      "state": "active",
      "iav_provider": null,
      "iav_status": null,
      "blocks": {
        "debits_blocked": false,
        "credits_blocked": false
      }
    },
    "links": {
      "add_bank_connection": "https://go.sandbox.zeptopayments.com/invite_contact/thomas-morgan-1/1030bfef-cef5-4938-b10b-5841cafafc80"
    }
  }
}

Step 2 - Make a Payment

Endpoint: POST /payments

{
  "description": "The SuperPackage",
  "matures_at": "2016-09-13T00:00:00Z",
  "your_bank_account_id": "...",
  "payouts": [
    {
      "amount": 30000,
      "description": "Payment to customer A",
      "recipient_contact_id": "6a7ed958-f1e8-42dc-8c02-3901d7057357",
    }],
"metadata": {
    "custom_key": "Custom string",
    "another_custom_key": "Maybe a URL",
    "remitter": "CustomRemitter" //the party being credited will see the designated remitter name along the entry on their bank statement.
  }
  ... other parameters available, see API docs
}
{
  "data": {
    "ref": "PB.1",
    "your_bank_account_id": "83623359-e86e-440c-9780-432a3bc3626f",
    "channels": [
      "new_payments_platform"
    ],
    "payouts": [
      {
        "ref": "D.1",
        "recipient_contact_id": "48b89364-1577-4c81-ba02-96705895d457",
        "batch_description": "The SuperPackage",
        "matures_at": "2016-09-13T23:50:44Z",
        "created_at": "2016-09-10T23:50:44Z",
        "status": "maturing",
        "amount": 30000,
        "description": "A tandem skydive jump SB23094",
        "from_id": "83623359-e86e-440c-9780-432a3bc3626f",
        "to_id": "21066764-c103-4e7f-b436-4cee7db5f400",
        "category_purpose_code": "PENS",
        "end_to_end_id": "FFC6D34847134E4D8BF4B9B41BDC94C8",
        "metadata": {
          "invoice_ref": "BILL-0001",
          "invoice_id": "c80a9958-e805-47c0-ac2a-c947d7fd778d",
          "custom_key": "Custom string",
          "another_custom_key": "Maybe a URL"
        }
      }
    ],
    "metadata": {
      "custom_key": "Custom string",
      "another_custom_key": "Maybe a URL"
    }
  }
}

Webhooks Event Flow

Refer to this article to learn more about the webhooks event flow when you make a payment.


Sandbox Simulations

To ensure you understand different outcomes when a transaction is processed and incorporate all the scenarios in your integration, refer to the Sandbox Simulations Guide.