Create a charge

Create a charge for merchant with the given information in the request payload

Create a charge

POST /charges

Request Body

Name
Type
Description

name

string

Charge name

description

string

Charge description

logoUrl

string

Charge image URL

localPrice*

Object

amount: Charge amount

currency: Charge local currency

metadata

any

Self defined metadata

redirectUrl

string

Redirect URL

cancelUrl

string

Cancel URL

{
    "statusCode": 201,
    "time": "2022-01-12T16:32:37.178Z",
    "data": {
        "code": "_PM3TX-7nVNY4K1pDqz8u",
        "hostedUrl": "https://payment.fizen.io/commerce/charges/_PM3TX-7nVNY4K1pDqz8u"
    },
}

Example request:

curl --location --request POST 'https://pay-api.fizen.io/api/integration/v1/charges' \
--header 'X-FP-API-KEY: 7abd3993-daf7-4322-84c6-c86e04b3d884' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Charge name",
    "description": "Charge description",
    "localPrice": {
        "amount": 100,
        "currency": "USD"
    },
    "metadata": {
        "orderId": "order-id1",
        "orderKey": "key1",
        "source": "some-ecommerce"
    },
    "logoUrl": "https://logo-url.com/image.png",
    "redirectUrl": "https://ecommerce-endpoint.com/redirect-url",
    "cancelUrl": "https://ecommerce-endpoint.com/cancel-url"
}'

Example response:

{
    "statusCode": 201,
    "time": "2022-01-12T16:32:37.178Z",
    "data": {
        "code": "OST1FNY35QDL",
        "hostedUrl": "https://payment.fizen.io/commerce/charges/OST1FNY35QDL"
    },
}

Last updated