Create a Charge

Plugin icon

Web checkout API

Give your shoppers the option to pay with Zip on your web platform with our web checkout solution.

The API call you will make to complete a zip payment is a call to our /charges endpoint. This request is made once you have received an Approved checkout result back from Zip.

This API call will contain:

  • Authority
  • Reference
  • Amount
  • Currency
  • Capture flag

The Zip API response will contain:

  • Charge Id - a unique reference for your charge, to be used for refunds or cancel / capture flows
  • State - the current state of the charge (authorised captured approved)
  • Captured amount
  • Refunded amount
  • Product
  • Receipt number - a unique customer facing reference for your charge. To be printed on receipts and is used in legacy 'in-store' refund scenario's.

📘

State validation

If you are validating the value of the state in the response please ensure your system accepts the values listed above as successful responses.

This /charges API call should be made from your server and not directly from the client front end.

Authority

Zip require an authority token to process a charge. This will be:

  • The checkout Id obtained from the first API call to Zip

Here is an example of how this information can be passed:

"authority": {
    "type": "checkout_id",
    "value": "au-co_xxxxxxxxxxxxxxxxxxx"
}

Charge details

Zip require certain charge details to be passed at the time of charge as below:

  • Reference
  • Amount
  • Currency
  • Capture flag

Here are some examples of how this information can be passed:

{ 
    "reference": "your_order_ reference",
    "amount": 300,
    "currency": "AUD"
}

Capture flag

When a charge is made, it must be specified if the funds should be immediately captured or only authorised (see API calls and Payment Flows). This can be passed to Zip as below:

{ 
    "capture": true
}

The full request

An example payload can be found below:

{
  "authority": {
    "type": "checkout_id",
    "value": "au-co_xxxxxxxxxxxxxxxxx"
  },
  "reference": "your_order_reference",
  "amount": 300,
  "currency": "AUD",
  "capture": true
}

With a successful response from Zip, you have now completed your charge!


📘

Order Management

  • If you have completed your charge with the capture flag set to false, you will still need to capture or cancel the charge.
  • Additionally, implementing refunds is advised, but not required

📘

Go live

Next its time to review your go live requirements