Customer chose a payment method
POST
/v1/public/payments/{id}/pay
const url = 'http://localhost:4000/v1/public/payments/example/pay?cs=example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"provider":"wave","phone":"+221771234567"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'http://localhost:4000/v1/public/payments/example/pay?cs=example' \ --header 'Content-Type: application/json' \ --data '{ "provider": "wave", "phone": "+221771234567" }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string
Query Parameters
Section titled “Query Parameters”cs
required
Payment client secret
string
Payment client secret
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
provider
required
string
phone
string
Example
+221771234567Responses
Section titled “ Responses ”Payment with next_action
Media typeapplication/json
object
id
required
string
livemode
required
boolean
amount
required
integer
currency
required
string
status
required
string
description
required
string | null
merchant
required
object
name
required
string
provider
required
string | null
available_providers
required
Array<string>
next_action
required
expires_at
required
string
return_url
required
Where to send the customer once status is terminal
string | null
Example
{ "status": "requires_payment_method", "provider": "wave", "available_providers": [ "wave" ], "next_action": { "type": "redirect" }}Validation error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Not found
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Invalid state
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Rate limited; see Retry-After response header
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}