Integrate checkout

Checkout widget

Orchestrate Checkout widget is an easy-to-use client-side integration that enables you to provide your customers with multiple payment options.

Get Started

Step 1: Call checkout endpoint

https://api.orchestrate.finance/v1/checkout/new
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <YOUR-PUBLIC-KEY>");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "customer_email": "[email protected]",
  "customer_name": "hello",
  "country": "Nigeria",
  "amount": 100000,
  "reference": "my-ref"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.orchestrate.finance/v1/checkout/new", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.orchestrate.finance/v1/checkout/new');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer <YOUR-PUBLIC-KEY>',
  'Content-Type' => 'application/json'
));
$request->setBody('{\n    "customer_email": "[email protected]",\n    "customer_name": "hello",\n    "country": "Nigeria",\n    "amount": 100000,\n    "reference": "my-ref"\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
curl --location --request POST 'https://api.orchestrate.finance/v1/checkout/new' \
--header 'Authorization: Bearer <YOUR-PUBLIC-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customer_email": "[email protected]",
    "customer_name": "hello",
    "country": "Nigeria",
    "amount": 100000,
    "reference": "my-ref"
}'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.orchestrate.finance/v1/checkout/new"
  method := "POST"

  payload := strings.NewReader(`{
    "customer_email": "[email protected]",
    "customer_name": "hello",
    "country": "Nigeria",
    "amount": 100000,
    "reference": "my-ref"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer <YOUR-PUBLIC-KEY>")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Step 2: Get Checkout URL from response

Calling the checkout API return a checkout URL

{
    "success": true,
    "data": "https://checkout.orchestrate.finance/checkout?id=62b55e1cdb4f39116566d2bf",
    "message": "checkout created"
}

Step 3: Open checkout URL in a new tab or iframe

1114

Step 4: Setup Webhook to get payment events.Webhooks

We send payment events to your webhook URL after payment has been completed.

Config Parameters

{
    "customer_email": "[email protected]",
    "customer_name": "akin lee",
    "country": "United States",
    "items": [
        {
            "name": "iphone",
            "amount": 100000,
            "quantity": 1
        }
    ],
    "amount": 100000,
    "reference": "my-ref-2",
    "redirect_url": "https://myapp.com/success",
    "close_url": "https://myapp.com"
}
ParameterTypeDescriptionRequired
public_keystringYour public key is how you authorise your request. Your public key can be found on your Orchestrate DashboardTrue
customer_emailstringEmail address of the customer.True
customer_namestringName of the customerFalse
countrystringThe country your customers are paying from. You can get the countries you support by checking the providers section on the Dashboard.True
amountnumberAmount should be passed in it's lowest denominator.
e.g 1000 Kobo.
True
close_urlstringWhen the checkout is closed we redirect the customer to the close_url provided.False
redirect_urlstringWhen a payment is completed we redirect the customer to the redirect_url provided. if none is provided we redirect the customer to a generic payment successful page.False
referencestringA unique string to identify your payment. If none is passed we generate a reference.False
ItemsArrayItems is a list of what customers are paying for. Some payment providers require passing items. If no item is passed we create a default item using the amount and customer name.False
primary_colorstringYou can customise your widget by passing a primary colour.False
secondary_colorstringYou can customise your widget by passing a secondary colour.False