// checkout.provider_metadata requires amount and currency
await paykit.checkouts.create({
customer: { email: 'user@example.com' },
item_id: 'my-product',
session_type: 'one_time',
quantity: 1,
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
provider_metadata: {
amount: '400', // in the standard currency unit (e.g. Birr), as a string
currency: 'ETB', // ETB or USD
},
});
// refund.provider_metadata is typed as { reference?: string }
await paykit.refunds.create({
payment_id: 'tx_ref_from_the_original_transaction',
amount: 400,
reason: 'requested_by_customer',
provider_metadata: {
reference: 'REF123', // your own distinctive reference for the refund request
},
});