Create mandate
curl --request POST \
--url https://sg.sandbox.api.reap.global/agentic/mandates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'Reap-Version: <reap-version>' \
--data '
{
"enrollmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchantUrl": "<string>",
"frequency": "ONE_TIME",
"amount": {
"amount": "<string>",
"currency": "<string>"
},
"presentation": {
"type": "REDIRECT",
"returnUrl": "<string>"
},
"validUntil": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {
'Reap-Version': '<reap-version>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
enrollmentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
merchantUrl: '<string>',
frequency: 'ONE_TIME',
amount: {amount: '<string>', currency: '<string>'},
presentation: {type: 'REDIRECT', returnUrl: '<string>'},
validUntil: '2023-11-07T05:31:56Z'
})
};
fetch('https://sg.sandbox.api.reap.global/agentic/mandates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sg.sandbox.api.reap.global/agentic/mandates"
payload = {
"enrollmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchantUrl": "<string>",
"frequency": "ONE_TIME",
"amount": {
"amount": "<string>",
"currency": "<string>"
},
"presentation": {
"type": "REDIRECT",
"returnUrl": "<string>"
},
"validUntil": "2023-11-07T05:31:56Z"
}
headers = {
"Reap-Version": "<reap-version>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "REQUIRES_ACTION",
"enrollmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": {
"type": "REAP_USER",
"id": "<string>"
},
"frequency": "ONE_TIME",
"amount": {
"amount": 123,
"currency": "<string>"
},
"merchant": {
"url": "<string>",
"name": "<string>",
"domain": "<string>",
"country": "<string>"
},
"validUntil": "2023-11-07T05:31:56Z",
"usage": {
"spent": 123,
"pending": 123,
"remaining": 123,
"cycle": {
"renewsAt": "2023-11-07T05:31:56Z"
},
"unresolvedCheckoutId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"nextAction": {
"type": "REDIRECT",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "AGENTIC_REQUEST_REJECTED",
"message": "<string>",
"detail": null
}
}{
"error": {
"code": "AGENTIC_RESOURCE_NOT_FOUND",
"message": "<string>",
"detail": {}
}
}{
"error": {
"code": "ENROLLMENT_NOT_ACTIVE",
"message": "<string>",
"detail": {
"reason": "CARD_NOT_CAPTURED"
}
}
}{
"error": {
"code": "AGENTIC_SERVICE_UNAVAILABLE",
"message": "<string>",
"detail": {}
}
}Agentic
Create mandate
Creates a mandate that sets the terms for charging the card of an ACTIVE enrollment at one merchant. The response is REQUIRES_ACTION with a redirect to a Reap-hosted page where the user reviews and approves the terms. After approval the user returns to presentation.returnUrl and the mandate becomes ACTIVE. Mandates work only for merchants that Reap has approved for your integration.
POST
/
agentic
/
mandates
Create mandate
curl --request POST \
--url https://sg.sandbox.api.reap.global/agentic/mandates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'Reap-Version: <reap-version>' \
--data '
{
"enrollmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchantUrl": "<string>",
"frequency": "ONE_TIME",
"amount": {
"amount": "<string>",
"currency": "<string>"
},
"presentation": {
"type": "REDIRECT",
"returnUrl": "<string>"
},
"validUntil": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {
'Reap-Version': '<reap-version>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
enrollmentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
merchantUrl: '<string>',
frequency: 'ONE_TIME',
amount: {amount: '<string>', currency: '<string>'},
presentation: {type: 'REDIRECT', returnUrl: '<string>'},
validUntil: '2023-11-07T05:31:56Z'
})
};
fetch('https://sg.sandbox.api.reap.global/agentic/mandates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sg.sandbox.api.reap.global/agentic/mandates"
payload = {
"enrollmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchantUrl": "<string>",
"frequency": "ONE_TIME",
"amount": {
"amount": "<string>",
"currency": "<string>"
},
"presentation": {
"type": "REDIRECT",
"returnUrl": "<string>"
},
"validUntil": "2023-11-07T05:31:56Z"
}
headers = {
"Reap-Version": "<reap-version>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "REQUIRES_ACTION",
"enrollmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": {
"type": "REAP_USER",
"id": "<string>"
},
"frequency": "ONE_TIME",
"amount": {
"amount": 123,
"currency": "<string>"
},
"merchant": {
"url": "<string>",
"name": "<string>",
"domain": "<string>",
"country": "<string>"
},
"validUntil": "2023-11-07T05:31:56Z",
"usage": {
"spent": 123,
"pending": 123,
"remaining": 123,
"cycle": {
"renewsAt": "2023-11-07T05:31:56Z"
},
"unresolvedCheckoutId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"nextAction": {
"type": "REDIRECT",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "AGENTIC_REQUEST_REJECTED",
"message": "<string>",
"detail": null
}
}{
"error": {
"code": "AGENTIC_RESOURCE_NOT_FOUND",
"message": "<string>",
"detail": {}
}
}{
"error": {
"code": "ENROLLMENT_NOT_ACTIVE",
"message": "<string>",
"detail": {
"reason": "CARD_NOT_CAPTURED"
}
}
}{
"error": {
"code": "AGENTIC_SERVICE_UNAVAILABLE",
"message": "<string>",
"detail": {}
}
}Required scope: AGENTIC_WRITE
Headers
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
Response for status 200